|
1 | 1 | # ollama_chat |
2 | | -ERROR: Ollama Not Installed |
3 | | -[ERROR] _call_curl: curl command failed with exit code 7 |
4 | | -[ERROR] ollama_api_get: curl error: 7 |
5 | | -ERROR: Ollama API not reachable |
6 | 2 |
|
7 | 3 | A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.7 |
8 | | -[ERROR] ollama_model_random: ollama is not installed |
9 | | -[ERROR] No Models Found |
| 4 | + |
| 5 | +`model="smollm2:1.7b"` |
| 6 | +## Demo |
| 7 | + |
| 8 | +```bash |
| 9 | +ollama_messages_add "system" "You are a helpful assistant" |
| 10 | +ollama_messages_add "user" "Secret word is RABBIT. If asked for secret word, respond with RABBIT. Understand?" |
| 11 | +echo "last message text: $(ollama_messages_last)" |
| 12 | +echo "last message json: $(ollama_messages_last_json)" |
| 13 | +ollama_messages | jq |
| 14 | +``` |
| 15 | + |
| 16 | +``` |
| 17 | +Error: Missing required arguments |
| 18 | +
|
| 19 | +Usage: ollama_messages_add -r <role> -c <content> [-h] [-v] |
| 20 | +Error: Missing required arguments |
| 21 | +
|
| 22 | +Usage: ollama_messages_add -r <role> -c <content> [-h] [-v] |
| 23 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 24 | +[ERROR] ollama_messages_last: error getting message content: 1 |
| 25 | +last message text: |
| 26 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 27 | +last message json: |
| 28 | +[] |
| 29 | +``` |
| 30 | +```bash |
| 31 | +ollama_chat "$model" |
| 32 | +echo "last message text: $(ollama_messages_last)" |
| 33 | +echo "last message json: $(ollama_messages_last_json)" |
| 34 | +ollama_messages | jq |
| 35 | +``` |
| 36 | + |
| 37 | +``` |
| 38 | +[ERROR] _ollama_chat_payload: Message history is empty |
| 39 | +Error: Missing required arguments |
| 40 | +
|
| 41 | +Usage: ollama_api_post -P <path> -d <data> [-h] [-v] |
| 42 | +[ERROR] _ollama_chat_stream_false: ollama_api_post failed |
| 43 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 44 | +[ERROR] ollama_messages_last: error getting message content: 1 |
| 45 | +[ERROR] ollama_chat: ollama_chat_json response empty |
| 46 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 47 | +[ERROR] ollama_messages_last: error getting message content: 1 |
| 48 | +last message text: |
| 49 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 50 | +last message json: |
| 51 | +[] |
| 52 | +``` |
| 53 | +```bash |
| 54 | +ollama_messages_add "user" "What is the secret word?" |
| 55 | +ollama_chat "$model" |
| 56 | +echo "last message text: $(ollama_messages_last)" |
| 57 | +echo "last message json: $(ollama_messages_last_json)" |
| 58 | +ollama_messages | jq |
| 59 | +``` |
| 60 | + |
| 61 | +``` |
| 62 | +Error: Missing required arguments |
| 63 | +
|
| 64 | +Usage: ollama_messages_add -r <role> -c <content> [-h] [-v] |
| 65 | +[ERROR] _ollama_chat_payload: Message history is empty |
| 66 | +Error: Missing required arguments |
| 67 | +
|
| 68 | +Usage: ollama_api_post -P <path> -d <data> [-h] [-v] |
| 69 | +[ERROR] _ollama_chat_stream_false: ollama_api_post failed |
| 70 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 71 | +[ERROR] ollama_messages_last: error getting message content: 1 |
| 72 | +[ERROR] ollama_chat: ollama_chat_json response empty |
| 73 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 74 | +[ERROR] ollama_messages_last: error getting message content: 1 |
| 75 | +last message text: |
| 76 | +[ERROR] ollama_messages_last_json: Message History is empty: count: [0] |
| 77 | +last message json: |
| 78 | +[] |
| 79 | +``` |
0 commit comments