OllamaResponse
Defined in: adapters/ollama.ts:109
Ollama API response structure.
Includes the generated message plus performance metrics like duration and token counts specific to local model execution.
- OllamaRequest
- OllamaMessage
Example
Section titled “Example”const response: OllamaResponse = { model: 'llama2', created_at: '2024-01-15T12:00:00Z', message: { role: 'assistant', content: 'Hello! How can I help?' }, done: true, total_duration: 1500000000, prompt_eval_count: 10, eval_count: 6};Properties
Section titled “Properties”created_at
Section titled “created_at”created_at:
string
Defined in: adapters/ollama.ts:114
ISO 8601 timestamp
done:
boolean
Defined in: adapters/ollama.ts:120
Whether generation is complete
eval_count?
Section titled “eval_count?”
optionaleval_count:number
Defined in: adapters/ollama.ts:132
Number of tokens in generation
load_duration?
Section titled “load_duration?”
optionalload_duration:number
Defined in: adapters/ollama.ts:126
Model loading duration in nanoseconds
message
Section titled “message”message:
OllamaMessage
Defined in: adapters/ollama.ts:117
Generated message
model:
string
Defined in: adapters/ollama.ts:111
Model that generated the response
prompt_eval_count?
Section titled “prompt_eval_count?”
optionalprompt_eval_count:number
Defined in: adapters/ollama.ts:129
Number of tokens in prompt evaluation
total_duration?
Section titled “total_duration?”
optionaltotal_duration:number
Defined in: adapters/ollama.ts:123
Total inference duration in nanoseconds