simple_chat
Send a single user prompt to an Ollama model and obtain a JSON response with model output and metadata. Ideal for basic question answering without conversation history.
Instructions
Basic chat interaction with Ollama models.
This is a simplified chat implementation that provides basic conversation
capabilities without advanced features. For advanced features, please use
complex_chat (not implemented yet).
Limitations:
1. No conversation history (messages array)
2. No streaming support (stream)
3. No system prompts (system role)
4. No image input support (images)
5. No format control (format)
6. No parameter tuning (options)
7. No keep-alive control (keep_alive)
Features:
1. Basic chat: Single message and response
2. Error handling: Connection and format validation
3. Performance metrics: Processing time and token statistics
Args:
model (str): Model name to use, e.g., "llama2", "mistral"
prompt (str): User input text
Returns:
str: JSON-formatted string containing:
- Model response and metadata if successful
- Error details if the request fails or response format is invalid
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| prompt | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |