Skip to content

Commit 6fa322c

Browse files
committed
Updating JSon comment.
1 parent 1d349f1 commit 6fa322c

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

lib/src/mind/ai/llm/ollama_wingman.cpp

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ OllamaWingman::~OllamaWingman()
5757
/**
5858
* OpenAI cURL GET request.
5959
*
60+
* @see https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion
61+
* @see https://github.com/ollama/ollama/blob/main/docs/api.md#list-local-models
6062
* @see https://ollama.com/library/llama2
6163
* @see https://json.nlohmann.me/
6264
*/
@@ -70,11 +72,12 @@ void OllamaWingman::curlGet(CommandWingmanChat& command) {
7072
replaceAll("\"", "\\\"", escapedPrompt);
7173

7274
/*
73-
ollama API JSon request example (see unit test):
75+
ollama API JSon request example - chat vs. generate answer:
7476
7577
curl -X POST http://localhost:11434/api/generate -d '{
7678
"model": "llama2",
77-
"prompt":"Why is the sky blue?"
79+
"prompt":"Why is the sky blue?",
80+
"stream": false
7881
}'
7982
8083
*/
@@ -212,30 +215,22 @@ void OllamaWingman::curlGet(CommandWingmanChat& command) {
212215

213216
// parse JSon
214217
/*
215-
OpenAI API JSon response example:
218+
ollama API JSon response example:
219+
216220
{
217-
"id": "chatcmpl-8gspbsufrxF42A6JfaiwuxoitQ1fT",
218-
"object": "chat.completion",
219-
"created": 1705231239,
220-
"model": "gpt-3.5-turbo-0613",
221-
"choices": [
222-
{
223-
"index": 0,
224-
"message": {
225-
"role": "assistant",
226-
"content": "...LLM answer...",
227-
},
228-
"logprobs": null,
229-
"finish_reason": "stop"
230-
}
231-
],
232-
"usage": {
233-
"prompt_tokens": 26,
234-
"completion_tokens": 491,
235-
"total_tokens": 517
236-
},
237-
"system_fingerprint": null
221+
"model": "llama2",
222+
"created_at": "2023-08-04T19:22:45.499127Z",
223+
"response": "The sky is blue because it is the color of the sky.",
224+
"done": true,
225+
"context": [1, 2, 3],
226+
"total_duration": 5043500667,
227+
"load_duration": 5025959,
228+
"prompt_eval_count": 26,
229+
"prompt_eval_duration": 325953000,
230+
"eval_count": 290,
231+
"eval_duration": 4709213000
238232
}
233+
239234
*/
240235

241236
// parse response string to JSon object

0 commit comments

Comments
 (0)