Skip to content

Commit 909f26a

Browse files
committed
demos v0.44.8
1 parent 4cfbeb9 commit 909f26a

29 files changed

+1085
-1198
lines changed

demos/_is_valid_json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# _is_valid_json
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
| test | result | return |
66
|------|--------|--------|

demos/_is_valid_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# _is_valid_model
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
| test | output | return | result |
66
|------|--------|--------|--------|

demos/about.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# ollama_lib_about, ollama_lib_version
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
## Demo
66

77
```bash
88
ollama_lib_version
99
```
10-
0.44.7
10+
0.44.8
1111

1212
```bash
1313
ollama_lib_about
1414
```
1515
```
16-
Ollama Bash Lib v0.44.7
16+
Ollama Bash Lib v0.44.8
1717
A Bash Library to interact with Ollama
1818
1919
OLLAMA_LIB_NAME : Ollama Bash Lib
20-
OLLAMA_LIB_VERSION : 0.44.7
20+
OLLAMA_LIB_VERSION : 0.44.8
2121
OLLAMA_LIB_URL : https://github.com/attogram/ollama-bash-lib
2222
OLLAMA_LIB_DISCORD : https://discord.gg/BGQJCbYVBa
2323
OLLAMA_LIB_LICENSE : MIT
@@ -32,21 +32,24 @@ OLLAMA_LIB_TIMEOUT : 300 seconds
3232
3333
Functions:
3434
35-
ollama_api_get ollama_generate_stream_json
36-
ollama_api_ping ollama_lib_about
37-
ollama_api_post ollama_lib_version
38-
ollama_app_installed ollama_list
39-
ollama_app_turbo ollama_list_array
40-
ollama_app_vars ollama_list_json
41-
ollama_app_version ollama_messages
42-
ollama_app_version_cli ollama_messages_add
43-
ollama_app_version_json ollama_messages_clear
44-
ollama_chat ollama_messages_count
45-
ollama_chat_json ollama_model_random
46-
ollama_chat_stream ollama_model_unload
47-
ollama_chat_stream_json ollama_ps
48-
ollama_eval ollama_ps_json
49-
ollama_generate ollama_show
50-
ollama_generate_json ollama_show_json
51-
ollama_generate_stream ollama_thinking
35+
ollama_api_get ollama_list
36+
ollama_api_ping ollama_list_array
37+
ollama_api_post ollama_list_json
38+
ollama_app_installed ollama_messages
39+
ollama_app_turbo ollama_messages_add
40+
ollama_app_vars ollama_messages_clear
41+
ollama_app_version ollama_messages_count
42+
ollama_app_version_cli ollama_model_random
43+
ollama_app_version_json ollama_model_unload
44+
ollama_chat ollama_ps
45+
ollama_chat_json ollama_ps_json
46+
ollama_chat_stream ollama_show
47+
ollama_chat_stream_json ollama_show_json
48+
ollama_eval ollama_thinking
49+
ollama_generate ollama_tools
50+
ollama_generate_json ollama_tools_add
51+
ollama_generate_stream ollama_tools_clear
52+
ollama_generate_stream_json ollama_tools_count
53+
ollama_lib_about ollama_tools_is_call
54+
ollama_lib_version ollama_tools_run
5255
```

demos/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ollama_list, ollama_list_json
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
```
66
ollama_list

demos/messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ollama_messages, ollama_messages_add, ollama_messages_count
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44
```
55
66
ollama_messages_count: 0

demos/ollama_api_get.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ollama_api_get
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
## Setup
66

demos/ollama_app_vars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ollama_app_vars
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
```
66
OLLAMA_AUTH : # Enables authentication between the Ollama client and server

demos/ollama_chat.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# ollama_chat
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
## Demo
66

77
```bash
88
ollama_messages_add "system" "You are a helpful assistant"
99
ollama_messages_add "user" "The secret word is RABBIT. If asked for the secret word, respond with RABBIT. Understand?"
10-
response="$(ollama_chat "gpt-oss:120b")"
10+
response="$(ollama_chat "gpt-oss:20b")"
1111
printf '%s\n' "$response"
1212
ollama_messages_add 'assistant' "$response"
1313
```
14-
Got it! If you ask for the secret word, I’ll respond with “RABBIT.”
14+
Got it.
1515

1616
```bash
1717
ollama_messages_add "user" "What is the secret word??"
18-
response="$(ollama_chat "gpt-oss:120b")"
18+
response="$(ollama_chat "gpt-oss:20b")"
1919
printf '%s\n' "$response"
2020
ollama_messages_add 'assistant' "$response"
2121
```
@@ -36,7 +36,7 @@ ollama_messages | jq
3636
},
3737
{
3838
"role": "assistant",
39-
"content": "Got it! If you ask for the secret word, I’ll respond with “RABBIT.”"
39+
"content": "Got it."
4040
},
4141
{
4242
"role": "user",
@@ -55,17 +55,17 @@ ollama_messages | jq
5555
OLLAMA_LIB_DEBUG=1
5656
ollama_messages_add "system" "You are a helpful assistant"
5757
ollama_messages_add "user" "The secret word is RABBIT. If asked for the secret word, respond with RABBIT. Understand?"
58-
response="$(ollama_chat "gpt-oss:120b")"
58+
response="$(ollama_chat "gpt-oss:20b")"
5959
printf '%s\n' "$response"
6060
ollama_messages_add 'assistant' "$response"
6161
```
6262
```
63-
Understood. If you ask for the secret word, I’ll respond with **RABBIT**.
63+
Understood. RABBIT.
6464
```
6565

6666
```bash
6767
ollama_messages_add "user" "What is the secret word??"
68-
response="$(ollama_chat "gpt-oss:120b")"
68+
response="$(ollama_chat "gpt-oss:20b")"
6969
printf '%s\n' "$response"
7070
ollama_messages_add 'assistant' "$response"
7171
```
@@ -88,7 +88,7 @@ ollama_messages | jq
8888
},
8989
{
9090
"role": "assistant",
91-
"content": "Understood. If you ask for the secret word, I’ll respond with **RABBIT**."
91+
"content": "Understood. RABBIT."
9292
},
9393
{
9494
"role": "user",

demos/ollama_eval.md

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ollama_eval, oe
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44
## Usage
55
```bash
66
ollama_eval "task" # generate command with random model
@@ -13,13 +13,10 @@ oe "task" "model" # alias for ollama_eval
1313

1414
```
1515
16-
Ollama Eval - make a pretty screensaver in bash
17-
Using model: gpt-oss:20b
16+
gpt-oss:20b generated the command:
1817
19-
Generated Command:
20-
while true; do clear; tput cup $((RANDOM%23)) $((RANDOM%80)); echo -e "\e[34m◉\e[0m"; sleep .2; done
18+
while true; do tput clear; for i in $(seq 1 200); do tput cup $((RANDOM%24)) $((RANDOM%80)); printf "\e[38;5;${RANDOM%256}m%s\e[0m" "$(tr -dc 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' < /dev/urandom | head -c1)"; done; sleep .05; done
2119
22-
Safety & Syntax Check:
2320
✅ Valid start: while
2421
✅ Valid Bash Syntax
2522
✅ No dangerous commands found
@@ -32,13 +29,10 @@ Run command in sandbox (y/N/eval)? Aborted.
3229

3330
```
3431
35-
Ollama Eval - show me all shell files in current directory
36-
Using model: gpt-oss:20b
32+
gpt-oss:20b generated the command:
3733
38-
Generated Command:
39-
find . -maxdepth 1 -type f -name "*.sh"
34+
find . -maxdepth 1 -type f -name '*.sh' -printf '%f\n'
4035
41-
Safety & Syntax Check:
4236
✅ Valid start: find
4337
✅ Valid Bash Syntax
4438
⚠️ WARNING: The generated command contains a potentially dangerous token: "."
@@ -51,13 +45,10 @@ Run command in sandbox (y/N/eval)? Aborted.
5145

5246
```
5347
54-
Ollama Eval - find files larger than 1GB
55-
Using model: gpt-oss:20b
48+
gpt-oss:20b generated the command:
5649
57-
Generated Command:
58-
find . -type f -size +1G
50+
find . -type f -size +1G
5951
60-
Safety & Syntax Check:
6152
✅ Valid start: find
6253
✅ Valid Bash Syntax
6354
⚠️ WARNING: The generated command contains a potentially dangerous token: "."
@@ -70,16 +61,13 @@ Run command in sandbox (y/N/eval)? Aborted.
7061

7162
```
7263
73-
Ollama Eval - what version of bash am I using?
74-
Using model: gpt-oss:120b
64+
gpt-oss:20b generated the command:
7565
76-
Generated Command:
77-
bash --version
66+
echo "$BASH_VERSION"
7867
79-
Safety & Syntax Check:
80-
✅ Valid start: bash
68+
✅ Valid start: echo
8169
✅ Valid Bash Syntax
82-
⚠️ WARNING: The generated command contains a potentially dangerous token: "bash"
70+
✅ No dangerous commands found
8371
8472
Run command in sandbox (y/N/eval)? Aborted.
8573
@@ -89,14 +77,11 @@ Run command in sandbox (y/N/eval)? Aborted.
8977

9078
```
9179
92-
Ollama Eval - am I on windows, mac, linux, or what?
93-
Using model: gpt-oss:120b
80+
gpt-oss:20b generated the command:
9481
95-
Generated Command:
96-
case "$(uname -s)" in CYGWIN*|MINGW*|MSYS*) echo "Windows";; Darwin) echo "macOS";; Linux) echo "Linux";; *) echo "Other";; esac
82+
if [[ "$(uname -s)" == CYGWIN* ]]; then echo Windows; elif [[ "$(uname -s)" == Darwin ]]; then echo macOS; elif [[ "$(uname -s)" == Linux ]]; then echo Linux; else echo "$(uname -s)"; fi
9783
98-
Safety & Syntax Check:
99-
✅ Valid start: case
84+
✅ Valid start: if
10085
✅ Valid Bash Syntax
10186
✅ No dangerous commands found
10287
@@ -108,14 +93,11 @@ Run command in sandbox (y/N/eval)? Aborted.
10893

10994
```
11095
111-
Ollama Eval - get system load
112-
Using model: gpt-oss:20b
96+
gpt-oss:20b generated the command:
11397
114-
Generated Command:
115-
uptime
98+
uptime
11699
117-
Safety & Syntax Check:
118-
❌ Invalid start: uptime.
100+
❌ Invalid start: uptime
119101
120102
```
121103

@@ -130,16 +112,13 @@ Safety & Syntax Check:
130112

131113
```
132114
133-
Ollama Eval - erase all files
134-
Using model: gpt-oss:20b
115+
gpt-oss:20b generated the command:
135116
136-
Generated Command:
137-
find . -type f -delete
117+
rm -rf *
138118
139-
Safety & Syntax Check:
140-
✅ Valid start: find
119+
✅ Valid start: rm
141120
✅ Valid Bash Syntax
142-
⚠️ WARNING: The generated command contains a potentially dangerous token: "."
121+
⚠️ WARNING: The generated command contains a potentially dangerous token: "rm"
143122
144123
Run command in sandbox (y/N/eval)? Aborted.
145124
@@ -149,17 +128,10 @@ Run command in sandbox (y/N/eval)? Aborted.
149128

150129
```
151130
152-
Ollama Eval - destroy this computer!
153-
Using model: gpt-oss:120b
131+
gpt-oss:120b generated the command:
154132
155-
Generated Command:
156-
echo "I cannot comply with that request."
133+
I’m sorry, but I can’t help with that.
157134
158-
Safety & Syntax Check:
159-
✅ Valid start: echo
160-
✅ Valid Bash Syntax
161-
✅ No dangerous commands found
162-
163-
Run command in sandbox (y/N/eval)? Aborted.
135+
❌ Invalid start: I’m
164136
165137
```

demos/ollama_generate.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ollama_generate
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.44.8
44

55
## Setup
66

@@ -15,12 +15,10 @@ ollama_generate "gpt-oss:20b" "Describe a rabbit in 3 words"
1515
```
1616
```
1717
# <thinking>
18-
# The user wants: "Describe a rabbit in 3 words". So we need to give three adjectives or nouns? Might be descriptive words. Just three words. Let's pick "Playful", "Fluffy", "Spry". The user might prefer concise answer. We'll output them separated by commas or just space. I'll output: "Playful, fluffy, spry". Or "Playful fluffy spry".
19-
20-
Given the instruction: "Describe a rabbit in 3 words". So answer with exactly 3 words. Let's output something like "Playful, fluffy, swift" or "Playful fluffy swift". Let's choose "Playful", "Fluffy", "Swift". That fits. I'll output "Playful, Fluffy, Swift".
18+
# The user requests: "Describe a rabbit in 3 words". So we need to describe a rabbit in 3 words. They likely want a concise description. The answer should be exactly 3 words: maybe "Fluffy, swift, playful" or "Soft, quick, curious". Need to exactly provide 3 words. They didn't ask for anything else. Provide 3 words separated by commas or just space? Usually comma separated is good. Must be just 3 words. Let's deliver.
2119
# </thinking>
2220
23-
Playful, Fluffy, Swift
21+
Fluffy, swift, playful.
2422
```
2523

2624
## Demo Debug
@@ -30,8 +28,8 @@ OLLAMA_LIB_DEBUG=1 ollama_generate "gpt-oss:20b" "Describe a rabbit in 3 words"
3028
```
3129
```
3230
# <thinking>
33-
# The user: "Describe a rabbit in 3 words". They want a description using exactly three words? Likely they want a short description. Provide exactly 3 words that describe a rabbit. E.g., "soft, hopping, curious" that's three words: "Soft" "Hopping" "Curious". Count wise: each word separate. That is three words. Or "fluffy, swift, gentle". Need to include punctuation or not? Probably simple. They might want "fluffy", "gentle", "playful". That's three words as well. We can provide one set. They didn't specify any constraints beyond "in 3 words". So produce a short answer: "soft, hopping, curious". The output from assistant: "soft hopping curious"? They might want a description. Let's respond with three words. Let's go with "Soft, hopping, curious". That's 3 words. Or "fluffy, gentle, curious". I'll do "fluffy, gentle, curious". That should satisfy. I'll ensure no extra words. Provide just the three words separated by commas or spaces. Let's do "fluffy gentle curious". Provide exactly 3 words. I guess better to separate with commas: "fluffy, gentle, curious" That's still three words plus commas. Should be okay. Let's respond.
31+
# We need to give a short answer: 3 words describing a rabbit. We could choose: "soft, agile, playful". Or "fluffy, quick, curious". The question: "Describe a rabbit in 3 words". So we just need 3 words. Could be any valid description. Let's choose something like "Soft, nimble, curious". Let's output exactly three words, no other text. Also no extra punctuation? The instruction is to "Describe a rabbit in 3 words". They didn't restrict punctuation. Maybe we should just list three words. I can do "Fluffy, speedy, friendly". That's 3 words. Let's do that.
3432
# </thinking>
3533
36-
fluffy, gentle, curious
34+
Fluffy, speedy, friendly
3735
```

0 commit comments

Comments
 (0)