Skip to content

Commit be54024

Browse files
committed
demos v0.45.8
1 parent 7a72137 commit be54024

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2746
-384
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ ollama_generate "mistral:7b" "Describe Bash in 3 words"
5050
# Powerful, Flexible, Scripting.
5151

5252
# Tab completion to view available library functions
53-
ollama_<TAB><TAB>
54-
# ollama_api_get ollama_generate ollama_messages_last_json
55-
# ollama_api_ping ollama_generate_json ollama_model_random
56-
# ollama_api_post ollama_generate_stream ollama_model_unload
57-
# ollama_app_installed ollama_generate_stream_json ollama_ps
58-
# ollama_app_turbo ollama_lib_about ollama_ps_json
59-
# ollama_app_vars ollama_lib_version ollama_show
60-
# ollama_app_version ollama_list ollama_show_json
61-
# ollama_app_version_cli ollama_list_array ollama_thinking
62-
# ollama_app_version_json ollama_list_json ollama_tools
63-
# ollama_chat ollama_messages ollama_tools_add
64-
# ollama_chat_json ollama_messages_add ollama_tools_clear
65-
# ollama_chat_stream ollama_messages_clear ollama_tools_count
66-
# ollama_chat_stream_json ollama_messages_count ollama_tools_is_call
67-
# ollama_eval ollama_messages_last ollama_tools_run
53+
ollama_<TAB>
54+
# ollama_api_get ollama_generate_json ollama_model_random
55+
# ollama_api_ping ollama_generate_stream ollama_model_unload
56+
# ollama_api_post ollama_generate_stream_json ollama_ps
57+
# ollama_app_installed ollama_lib_about ollama_ps_json
58+
# ollama_app_turbo ollama_lib_version ollama_show
59+
# ollama_app_vars ollama_list ollama_show_json
60+
# ollama_app_version ollama_list_array ollama_thinking
61+
# ollama_app_version_cli ollama_list_json ollama_tools
62+
# ollama_app_version_json ollama_messages ollama_tools_add
63+
# ollama_chat ollama_messages_add ollama_tools_clear
64+
# ollama_chat_json ollama_messages_clear ollama_tools_count
65+
# ollama_chat_stream ollama_messages_count ollama_tools_is_call
66+
# ollama_chat_stream_json ollama_messages_last ollama_tools_run
67+
# ollama_generate ollama_messages_last_json
6868
```
6969

7070
## Usage

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.45.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.8
44

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

demos/_is_valid_model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# _is_valid_model
22

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

55
| test | output | return | result |
66
|------|--------|--------|--------|
77
| `mistral:7b` | mistral:7b | 0 | ✅ PASS |
8-
| `` | dolphin3:8b | 0 | ✅ PASS |
8+
| `` | gpt-oss:120b | 0 | ✅ PASS |
99
| `hf.co/user/Model-name:QUANT` | hf.co/user/Model-name:QUANT | 0 | ✅ PASS |
1010
| `abcdefghijklmnopqrstuvwxyz` | abcdefghijklmnopqrstuvwxyz | 0 | ✅ PASS |
1111
| `1234567890` | 1234567890 | 0 | ✅ PASS |

demos/about.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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.45.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.8
44

55
## Demo
66

77
```bash
88
ollama_lib_version
99
```
10-
0.45.7
10+
0.45.8
1111

1212
```bash
1313
ollama_lib_about
@@ -16,46 +16,42 @@ ollama_lib_about
1616
A Bash Library to interact with Ollama
1717
1818
OLLAMA_LIB_NAME : Ollama Bash Lib
19-
OLLAMA_LIB_VERSION : 0.45.7
19+
OLLAMA_LIB_VERSION : 0.45.8
2020
OLLAMA_LIB_URL : https://github.com/attogram/ollama-bash-lib
2121
OLLAMA_LIB_DISCORD : https://discord.gg/BGQJCbYVBa
2222
OLLAMA_LIB_LICENSE : MIT
2323
OLLAMA_LIB_COPYRIGHT : Copyright (c) 2025 Ollama Bash Lib, Attogram Project <https://github.com/attogram>
24-
OLLAMA_LIB_API : http://localhost:11434
24+
OLLAMA_LIB_API : https://ollama.com
2525
OLLAMA_LIB_DEBUG : 0
2626
OLLAMA_LIB_STREAM : 0
2727
OLLAMA_LIB_THINKING : off
2828
OLLAMA_LIB_MESSAGES : 0 messages
29-
OLLAMA_LIB_TURBO_KEY : NO
29+
OLLAMA_LIB_TURBO_KEY : YES [REDACTED]
3030
OLLAMA_LIB_TIMEOUT : 300 seconds
3131
3232
Functions:
3333
34-
_ollama_chat_payload ollama_generate_stream
35-
_ollama_chat_stream_false ollama_generate_stream_json
36-
_ollama_chat_stream_true ollama_lib_about
37-
_ollama_eval_check_danger ollama_lib_version
38-
_ollama_eval_check_sanity ollama_list
39-
_ollama_eval_check_syntax ollama_list_array
40-
_ollama_eval_permission_eval ollama_list_json
41-
_ollama_eval_permission_sandbox ollama_messages
42-
_ollama_eval_prompt ollama_messages_add
43-
_ollama_generate_json_payload ollama_messages_clear
44-
_ollama_thinking_stream ollama_messages_count
45-
ollama_api_get ollama_messages_last
46-
ollama_api_ping ollama_messages_last_json
47-
ollama_api_post ollama_model_random
48-
ollama_app_installed ollama_model_unload
49-
ollama_app_turbo ollama_ps
50-
ollama_app_vars ollama_ps_json
51-
ollama_app_version ollama_show
52-
ollama_app_version_cli ollama_show_json
53-
ollama_app_version_json ollama_thinking
54-
ollama_chat ollama_tools
55-
ollama_chat_json ollama_tools_add
56-
ollama_chat_stream ollama_tools_clear
57-
ollama_chat_stream_json ollama_tools_count
58-
ollama_eval ollama_tools_is_call
59-
ollama_generate ollama_tools_run
60-
ollama_generate_json
34+
_ollama_chat_payload ollama_lib_version
35+
_ollama_chat_stream_false ollama_list
36+
_ollama_chat_stream_true ollama_list_array
37+
_ollama_generate_json_payload ollama_list_json
38+
_ollama_thinking_stream ollama_messages
39+
ollama_api_get ollama_messages_add
40+
ollama_api_ping ollama_messages_clear
41+
ollama_api_post ollama_messages_count
42+
ollama_app_installed ollama_messages_last
43+
ollama_app_turbo ollama_messages_last_json
44+
ollama_app_vars ollama_model_random
45+
ollama_app_version ollama_model_unload
46+
ollama_app_version_cli ollama_ps
47+
ollama_app_version_json ollama_ps_json
48+
ollama_chat ollama_show
49+
ollama_chat_json ollama_show_json
50+
ollama_chat_stream ollama_thinking
51+
ollama_chat_stream_json ollama_tools
52+
ollama_generate ollama_tools_add
53+
ollama_generate_json ollama_tools_clear
54+
ollama_generate_stream ollama_tools_count
55+
ollama_generate_stream_json ollama_tools_is_call
56+
ollama_lib_about ollama_tools_run
6157
```

demos/help.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# help via -h and --help
22

3-
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.8
44
## Testing -h for all functions (first argument)
55

66
`ollama_api_get -h`
@@ -1062,33 +1062,3 @@ Get the version of the Ollama Bash Lib.
10621062
This function returns the current version number of the library as defined in the 'OLLAMA_LIB_VERSION' variable.
10631063
It is useful for checking the library version for compatibility or debugging purposes.
10641064
```
1065-
1066-
`ollama_eval -h`
1067-
```
1068-
Usage: ollama_eval -t <task> [-m <model> [-h] [-v]
1069-
1070-
Generate and evaluate a command-line task.
1071-
1072-
-t <task> The task to be run on the command line.
1073-
-m <model> Model to use to generate command (Optional) If empty, uses random model.
1074-
-h Show this help and exit.
1075-
-v Show version information and exit.
1076-
1077-
This function takes a description of a task, sends it to a model to generate a shell command, and then prompts the user for permission to execute it.
1078-
It includes safety features like syntax checking and a sandbox mode for execution. This is a powerful tool for converting natural language into shell commands.
1079-
```
1080-
1081-
`oe -h`
1082-
```
1083-
Usage: ollama_eval -t <task> [-m <model> [-h] [-v]
1084-
1085-
Generate and evaluate a command-line task.
1086-
1087-
-t <task> The task to be run on the command line.
1088-
-m <model> Model to use to generate command (Optional) If empty, uses random model.
1089-
-h Show this help and exit.
1090-
-v Show version information and exit.
1091-
1092-
This function takes a description of a task, sends it to a model to generate a shell command, and then prompts the user for permission to execute it.
1093-
It includes safety features like syntax checking and a sandbox mode for execution. This is a powerful tool for converting natural language into shell commands.
1094-
```

demos/help.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ functions=(
5454
ollama_thinking ot
5555
ollama_lib_about olab
5656
ollama_lib_version olv
57-
ollama_eval oe
5857
)
5958

6059
echo '## Testing -h for all functions (first argument)'
@@ -64,11 +63,3 @@ for func in "${functions[@]}"; do
6463
printf '`%s -h`\n```\n%s\n```\n' "$func" "$("$func" -h)"
6564
echo
6665
done
67-
68-
#echo '## Testing --help for all functions (first argument)'
69-
#echo
70-
#for func in "${functions[@]}"; do
71-
# # shellcheck disable=SC2016
72-
# printf '`%s --help`\n```\n%s\n```\n' "$func" "$("$func" --help)"
73-
# echo
74-
#done

demos/list.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
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.45.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.8
44

55
```
66
ollama_list
77
```
88
```
9-
NAME ID SIZE MODIFIED
10-
dolphin3:8b d5ab9ae8e1f2 4.9 GB 4 weeks ago
11-
gemma3n:e2b 719372f8c7de 5.6 GB 2 weeks ago
12-
granite3.3:2b 07bd1f170855 1.5 GB 2 weeks ago
13-
hf.co/bartowski/Ministral-8B-Instruct-2410-GGUF:IQ4_XS d6e3345a2af6 4.4 GB 2 weeks ago
14-
mistral:7b 6577803aa9a0 4.4 GB 2 weeks ago
15-
qwen3:8b 500a1f067a9f 5.2 GB 4 weeks ago
16-
smollm2:1.7b cef4a1e09247 1.8 GB 2 weeks ago
9+
NAME ID SIZE MODIFIED
10+
gpt-oss:120b d98fe6ba01e6 65 GB 2 weeks ago
11+
gpt-oss:20b 05afbac4bad6 13 GB 2 weeks ago
1712
```
1813

1914
```
2015
ollama_list_array
2116
```
2217
```
23-
dolphin3:8b gemma3n:e2b granite3.3:2b hf.co/bartowski/Ministral-8B-Instruct-2410-GGUF:IQ4_XS mistral:7b qwen3:8b smollm2:1.7b
18+
gpt-oss:120b gpt-oss:20b
2419
```
2520

2621
```

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.45.7
3+
A [demo](../README.md#demos) of [Ollama Bash Lib](https://github.com/attogram/ollama-bash-lib) v0.45.8
44
```
55
66
ollama_messages_count: 0

demos/ollama_api_get.md

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# ollama_api_get
22

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

55
## Setup
66

7-
OLLAMA_HOST: http://localhost:11434
7+
OLLAMA_HOST: https://ollama.com
88

9-
OLLAMA_LIB_API: http://localhost:11434
9+
OLLAMA_LIB_API: https://ollama.com
1010

1111

1212
## Demo
@@ -15,15 +15,23 @@ OLLAMA_LIB_API: http://localhost:11434
1515
```
1616
ollama_api_get
1717
18-
result: lines: 1
19-
result: output: Ollama is running
18+
result: lines: 394
19+
result: output:
20+
21+
22+
23+
24+
25+
26+
<!doctype html>
27+
<html class="h-full
2028
```
2129

2230
```
23-
ollama_api_get "/api/version"
31+
ollama_api_get -P "/api/version"
2432
25-
result: lines: 1
26-
result: output: Ollama is running
33+
result: lines: 1
34+
result: output: {"version":"0.0.0"}
2735
```
2836

2937
## Demo Debug
@@ -34,23 +42,33 @@ result: output: Ollama is running
3442
```
3543
ollama_api_get
3644
37-
[DEBUG] 22:21:27:278104300: ollama_api_get: []
38-
[DEBUG] 22:21:27:306103200: _call_curl: [GET] []
39-
[DEBUG] 22:21:27:328663800: _call_curl: OLLAMA_LIB_API: http://localhost:11434
40-
[DEBUG] 22:21:27:350677100: _call_curl: args: -s -N --max-time 300 -H Content-Type: application/json -w \n%{http_code} -X GET http://localhost:11434
41-
[DEBUG] 22:21:27:710818300: ollama_api_get: success
42-
result: lines: 1
43-
result: output: Ollama is running
44-
```
45+
[DEBUG] 11:36:21:146034000: ollama_api_get: []
46+
[DEBUG] 11:36:21:153820000: _call_curl: [GET] []
47+
[DEBUG] 11:36:21:161509000: _call_curl: OLLAMA_LIB_API: https://ollama.com
48+
[DEBUG] 11:36:21:168242000: _call_curl: Turbo Mode
49+
[DEBUG] 11:36:21:174913000: _call_curl: args: -s -N --max-time 300 -H Content-Type: application/json -w \n%{http_code} -H Authorization: Bearer [REDACTED] -X GET https://ollama.com
50+
[DEBUG] 11:36:21:385896000: ollama_api_get: success
51+
result: lines: 394
52+
result: output:
4553
54+
55+
56+
57+
58+
59+
<!doctype html>
60+
<html class="h-full
4661
```
47-
ollama_api_get "/api/version"
4862

49-
[DEBUG] 22:21:27:781003700: ollama_api_get: []
50-
[DEBUG] 22:21:27:803875500: _call_curl: [GET] []
51-
[DEBUG] 22:21:27:825930500: _call_curl: OLLAMA_LIB_API: http://localhost:11434
52-
[DEBUG] 22:21:27:867215900: _call_curl: args: -s -N --max-time 300 -H Content-Type: application/json -w \n%{http_code} -X GET http://localhost:11434
53-
[DEBUG] 22:21:28:190240400: ollama_api_get: success
54-
result: lines: 1
55-
result: output: Ollama is running
63+
```
64+
ollama_api_get -P "/api/version"
65+
66+
[DEBUG] 11:36:21:407847000: ollama_api_get: [/api/version]
67+
[DEBUG] 11:36:21:414728000: _call_curl: [GET] [/api/version]
68+
[DEBUG] 11:36:21:421749000: _call_curl: OLLAMA_LIB_API: https://ollama.com
69+
[DEBUG] 11:36:21:428110000: _call_curl: Turbo Mode
70+
[DEBUG] 11:36:21:434236000: _call_curl: args: -s -N --max-time 300 -H Content-Type: application/json -w \n%{http_code} -H Authorization: Bearer [REDACTED] -X GET https://ollama.com/api/version
71+
[DEBUG] 11:36:21:629869000: ollama_api_get: success
72+
result: lines: 1
73+
result: output: {"version":"0.0.0"}
5674
```

demos/ollama_api_get.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ demo() {
2626

2727
echo
2828
echo '```'
29-
echo 'ollama_api_get "/api/version"'
29+
echo 'ollama_api_get -P "/api/version"'
3030
echo
31-
result=$( ollama_api_get "/api/version")
31+
result=$( ollama_api_get -P "/api/version")
3232
echo "result: lines: $(echo "$result" | wc -l)"
3333
echo "result: output: ${result:0:42}"
3434
echo '```';

0 commit comments

Comments
 (0)