simple_generate
Generate text from a prompt using any Ollama model. Provide the model name and prompt to receive a response with generated content and metadata.
Instructions
Basic text generation with Ollama models.
This is a simplified implementation of the /api/generate endpoint that provides
basic text generation capabilities without advanced features.
Limitations:
1. No streaming support
2. No raw mode
3. No format control
4. No parameter tuning (options)
5. No context management
Features:
1. Basic generation: Single prompt 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): Text prompt for generation
Returns:
str: JSON-formatted string containing:
- Generated text and metadata if successful
- Error details if the request fails
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| prompt | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |