Skip to content

Commit 2b2b865

Browse files
committed
v0.46.2 - OBL_ vars
1 parent 11f61eb commit 2b2b865

Some content is hidden

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

45 files changed

+272
-272
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,33 +143,33 @@ $ ollama_app_turbo on
143143
Enter Ollama API Key (input hidden):
144144
```
145145

146-
This will set and export `OLLAMA_LIB_API` and `OLLAMA_HOST` to `https://ollama.com`,
147-
and set `OLLAMA_LIB_TURBO_KEY` to your key.
146+
This will set and export `OBL_API` and `OLLAMA_HOST` to `https://ollama.com`,
147+
and set `OBL_TURBO_KEY` to your key.
148148

149-
Note: `OLLAMA_LIB_TURBO_KEY` is never exported.
149+
Note: `OBL_TURBO_KEY` is never exported.
150150
You must decide yourself if you want to export it into your environment.
151151
```
152-
export OLLAMA_LIB_KEY=my.super.secret.key
152+
export OBL_KEY=my.super.secret.key
153153
```
154154

155155
If the key is set, then `ollama_app_turbo on` will not prompt you again for the key.
156156

157157
To turn **off** Turbo Mode, simply use `ollama_app_turbo off`.
158-
This will unset `OLLAMA_LIB_TURBO_KEY`
159-
and reset `OLLAMA_LIB_API` and `OLLAMA_HOST` to `http://localhost:11434`
158+
This will unset `OBL_TURBO_KEY`
159+
and reset `OBL_API` and `OLLAMA_HOST` to `http://localhost:11434`
160160

161161
Use `ollama_lib_about` to view your current settings.
162162

163163
### Howto debug
164164

165-
The `OLLAMA_LIB_DEBUG` variable controls if debug messages are sent to `stderr`
165+
The `OBL_DEBUG` variable controls if debug messages are sent to `stderr`
166166

167-
Set `OLLAMA_LIB_DEBUG=1` to turn on debugging.
168-
Set `OLLAMA_LIB_DEBUG=0` to turn off debugging.
167+
Set `OBL_DEBUG=1` to turn on debugging.
168+
Set `OBL_DEBUG=0` to turn off debugging.
169169

170170
Examples:
171171
```
172-
OLLAMA_LIB_DEBUG=1 ollama_generate gpt-oss:20b "Three words about debugging"
172+
OBL_DEBUG=1 ollama_generate gpt-oss:20b "Three words about debugging"
173173
```
174174

175175
## Demos
@@ -276,7 +276,7 @@ To run all demos and save output to Markdown files: [demos/run.demos.sh](demos/r
276276
| Function | About | Usage | Output | Return |
277277
|------------------------------|-----------------------------------------|---------------------------------------|----------------------------|-------------------------------------------------|
278278
| `_is_valid_json` | Is a string valid JSON? | `_is_valid_json "string"` | none | `0` if valid json<br />`1` or higher if invalid |
279-
| `_debug` | Debug message (if `OLLAMA_LIB_DEBUG=1`) | `_debug "message"` | message to `stderr` | `0`/`1` |
279+
| `_debug` | Debug message (if `OBL_DEBUG=1`) | `_debug "message"` | message to `stderr` | `0`/`1` |
280280
| `_error` | Error message | `_error "message"` | message to `stderr` | `0`/`1` |
281281

282282
## Requirements

apps/interactive.chat.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ startup() {
77
source "$ollama_bash_lib"
88
if ! ollama_app_installed; then echo 'ERROR: Ollama Not Installed'; fi;
99
if ! ollama_api_ping; then echo 'ERROR: Ollama API not reachable'; fi
10-
echo; echo "A [demo](../README.md#demos) of [$OLLAMA_LIB_NAME]($OLLAMA_LIB_URL) v$OLLAMA_LIB_VERSION"
10+
echo; echo "A [demo](../README.md#demos) of [$OBL_NAME]($OBL_URL) v$OBL_VERSION"
1111
}
1212

1313
shutdown() {

apps/interactive.generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ startup() {
99
source "$ollama_bash_lib"
1010
if ! ollama_app_installed; then echo 'ERROR: Ollama Not Installed'; fi;
1111
if ! ollama_api_ping; then echo 'ERROR: Ollama API not reachable'; fi
12-
echo; echo "A [demo](../README.md#demos) of [$OLLAMA_LIB_NAME]($OLLAMA_LIB_URL) v$OLLAMA_LIB_VERSION"
12+
echo; echo "A [demo](../README.md#demos) of [$OBL_NAME]($OBL_URL) v$OBL_VERSION"
1313
}
1414

1515
shutdown() {

demos/_is_valid_json.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ startup() {
99
source "$ollama_bash_lib"
1010
#if ! ollama_app_installed; then echo "ERROR: Ollama Not Installed"; fi;
1111
#if ! ollama_api_ping; then echo "ERROR: Ollama API not reachable"; fi
12-
echo; echo "A [demo](../README.md#demos) of [$OLLAMA_LIB_NAME]($OLLAMA_LIB_URL) v$OLLAMA_LIB_VERSION"
12+
echo; echo "A [demo](../README.md#demos) of [$OBL_NAME]($OBL_URL) v$OBL_VERSION"
1313
}
1414

1515
startup

demos/_is_valid_model.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ startup() {
99
source "$ollama_bash_lib"
1010
#if ! ollama_app_installed; then echo "ERROR: Ollama Not Installed"; fi;
1111
#if ! ollama_api_ping; then echo "ERROR: Ollama API not reachable"; fi
12-
echo; echo "A [demo](../README.md#demos) of [$OLLAMA_LIB_NAME]($OLLAMA_LIB_URL) v$OLLAMA_LIB_VERSION"
12+
echo; echo "A [demo](../README.md#demos) of [$OBL_NAME]($OBL_URL) v$OBL_VERSION"
1313
}
1414

1515
startup

demos/about.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ ollama_lib_about
1515
```
1616
A Bash Library to interact with Ollama
1717
18-
OLLAMA_LIB_NAME : Ollama Bash Lib
19-
OLLAMA_LIB_VERSION : 0.46.1
20-
OLLAMA_LIB_URL : https://github.com/attogram/ollama-bash-lib
21-
OLLAMA_LIB_DISCORD : https://discord.gg/BGQJCbYVBa
22-
OLLAMA_LIB_LICENSE : MIT
23-
OLLAMA_LIB_COPYRIGHT : Copyright (c) 2025 Ollama Bash Lib, Attogram Project <https://github.com/attogram>
24-
OLLAMA_LIB_API : https://ollama.com
25-
OLLAMA_LIB_DEBUG : 0
26-
OLLAMA_LIB_STREAM : 0
27-
OLLAMA_LIB_THINKING : off
28-
OLLAMA_LIB_MESSAGES : 0 messages
29-
OLLAMA_LIB_TURBO_KEY : YES [REDACTED]
30-
OLLAMA_LIB_TIMEOUT : 300 seconds
18+
OBL_NAME : Ollama Bash Lib
19+
OBL_VERSION : 0.46.1
20+
OBL_URL : https://github.com/attogram/ollama-bash-lib
21+
OBL_DISCORD : https://discord.gg/BGQJCbYVBa
22+
OBL_LICENSE : MIT
23+
OBL_COPYRIGHT : Copyright (c) 2025 Ollama Bash Lib, Attogram Project <https://github.com/attogram>
24+
OBL_API : https://ollama.com
25+
OBL_DEBUG : 0
26+
OBL_STREAM : 0
27+
OBL_THINKING : off
28+
OBL_MESSAGES : 0 messages
29+
OBL_TURBO_KEY : YES [REDACTED]
30+
OBL_TIMEOUT : 300 seconds
3131
3232
Functions:
3333

demos/about.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ startup() {
99
source "$ollama_bash_lib"
1010
#if ! ollama_app_installed; then echo "ERROR: Ollama Not Installed"; fi;
1111
#if ! ollama_api_ping; then echo "ERROR: Ollama API not reachable"; fi
12-
echo; echo "A [demo](../README.md#demos) of [$OLLAMA_LIB_NAME]($OLLAMA_LIB_URL) v$OLLAMA_LIB_VERSION"
12+
echo; echo "A [demo](../README.md#demos) of [$OBL_NAME]($OBL_URL) v$OBL_VERSION"
1313
}
1414

1515
startup

demos/deprecated.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ _redact() {
4747
local msg="${1:-}"
4848
local out="$msg"
4949

50-
local explicit_vars=( OLLAMA_LIB_TURBO_KEY )
50+
local explicit_vars=( OBL_TURBO_KEY )
5151
local var val
5252
for var in "${explicit_vars[@]}"; do
5353
val=${!var}
@@ -207,7 +207,7 @@ raw_nano() {
207207
# Requires: none
208208
# Returns: 0
209209
_DEPRECATED_escape_control_characters() {
210-
if (( OLLAMA_LIB_SAFE_MODE != 1 )); then # If Safe Mode is OFF, do not escape control characters
210+
if (( OBL_SAFE_MODE != 1 )); then # If Safe Mode is OFF, do not escape control characters
211211
printf '%s' "$1"
212212
return 0
213213
fi
@@ -248,7 +248,7 @@ _DEPRECATED_escape_control_characters() {
248248
#
249249
# _escape_control_characters "some string"
250250
#
251-
# If OLLAMA_LIB_SAFE_MODE is 1, bytes 0‑31 and 127 are turned into JSON‑legal
251+
# If OBL_SAFE_MODE is 1, bytes 0‑31 and 127 are turned into JSON‑legal
252252
# escapes:
253253
# * \b, \t, \n, \f, \r for the five most common controls
254254
# * \u00XX for any other control character
@@ -258,7 +258,7 @@ _escape_control_characters() {
258258
# 1️⃣ Safe‑mode shortcut – when safe‑mode is OFF we simply echo the
259259
# original argument unchanged.
260260
# --------------------------------------------------------------
261-
if (( OLLAMA_LIB_SAFE_MODE != 1 )); then # safe‑mode OFF → no escaping
261+
if (( OBL_SAFE_MODE != 1 )); then # safe‑mode OFF → no escaping
262262
printf '%s' "$1"
263263
return 0
264264
fi

demos/help.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Generate a completion from a model as JSON.
101101
-v Show version information and exit.
102102
103103
This function sends a prompt to a specified model and returns the model's response as a raw JSON object.
104-
If streaming is enabled via the global 'OLLAMA_LIB_STREAM' variable, it will return a stream of JSON objects.
104+
If streaming is enabled via the global 'OBL_STREAM' variable, it will return a stream of JSON objects.
105105
This is a foundational function for 'ollama_generate' and 'ollama_generate_stream', which process this JSON output into plain text.
106106
```
107107

@@ -117,7 +117,7 @@ Generate a completion from a model as JSON.
117117
-v Show version information and exit.
118118
119119
This function sends a prompt to a specified model and returns the model's response as a raw JSON object.
120-
If streaming is enabled via the global 'OLLAMA_LIB_STREAM' variable, it will return a stream of JSON objects.
120+
If streaming is enabled via the global 'OBL_STREAM' variable, it will return a stream of JSON objects.
121121
This is a foundational function for 'ollama_generate' and 'ollama_generate_stream', which process this JSON output into plain text.
122122
```
123123

@@ -162,7 +162,7 @@ Generate a completion from a model as a stream of JSON objects.
162162
-h Show this help and exit.
163163
-v Show version information and exit.
164164
165-
This function sets the global 'OLLAMA_LIB_STREAM' variable to 1 and then calls 'ollama_generate_json'.
165+
This function sets the global 'OBL_STREAM' variable to 1 and then calls 'ollama_generate_json'.
166166
It is the basis for 'ollama_generate_stream', which further processes the output into a continuous stream of text.
167167
```
168168

@@ -177,7 +177,7 @@ Generate a completion from a model as a stream of JSON objects.
177177
-h Show this help and exit.
178178
-v Show version information and exit.
179179
180-
This function sets the global 'OLLAMA_LIB_STREAM' variable to 1 and then calls 'ollama_generate_json'.
180+
This function sets the global 'OBL_STREAM' variable to 1 and then calls 'ollama_generate_json'.
181181
It is the basis for 'ollama_generate_stream', which further processes the output into a continuous stream of text.
182182
```
183183

@@ -248,7 +248,7 @@ Add a message to the current session's message history.
248248
-h Show this help and exit.
249249
-v Show version information and exit.
250250
251-
This function appends a new message object to the \'OLLAMA_LIB_MESSAGES\' array.
251+
This function appends a new message object to the \'OBL_MESSAGES\' array.
252252
This history is then used by \'ollama_chat\' and related functions to maintain a conversation with the model.
253253
```
254254

@@ -263,7 +263,7 @@ Add a message to the current session's message history.
263263
-h Show this help and exit.
264264
-v Show version information and exit.
265265
266-
This function appends a new message object to the \'OLLAMA_LIB_MESSAGES\' array.
266+
This function appends a new message object to the \'OBL_MESSAGES\' array.
267267
This history is then used by \'ollama_chat\' and related functions to maintain a conversation with the model.
268268
```
269269

@@ -276,7 +276,7 @@ Clear all messages from the current session.
276276
-h Show this help and exit.
277277
-v Show version information and exit.
278278
279-
This function resets the \'OLLAMA_LIB_MESSAGES\' array, effectively deleting the entire conversation history for the current session.
279+
This function resets the \'OBL_MESSAGES\' array, effectively deleting the entire conversation history for the current session.
280280
This is useful for starting a new conversation without restarting the script.
281281
```
282282

@@ -289,7 +289,7 @@ Clear all messages from the current session.
289289
-h Show this help and exit.
290290
-v Show version information and exit.
291291
292-
This function resets the \'OLLAMA_LIB_MESSAGES\' array, effectively deleting the entire conversation history for the current session.
292+
This function resets the \'OBL_MESSAGES\' array, effectively deleting the entire conversation history for the current session.
293293
This is useful for starting a new conversation without restarting the script.
294294
```
295295

@@ -302,7 +302,7 @@ Get the number of messages in the current session.
302302
-h Show this help and exit.
303303
-v Show version information and exit.
304304
305-
This function returns the current number of messages stored in the 'OLLAMA_LIB_MESSAGES' array.
305+
This function returns the current number of messages stored in the 'OBL_MESSAGES' array.
306306
It can be used to check if a conversation has started or to monitor the length of the conversation history.
307307
```
308308

@@ -315,7 +315,7 @@ Get the number of messages in the current session.
315315
-h Show this help and exit.
316316
-v Show version information and exit.
317317
318-
This function returns the current number of messages stored in the 'OLLAMA_LIB_MESSAGES' array.
318+
This function returns the current number of messages stored in the 'OBL_MESSAGES' array.
319319
It can be used to check if a conversation has started or to monitor the length of the conversation history.
320320
```
321321

@@ -895,7 +895,7 @@ Configure the 'thinking' mode for model responses.
895895
-h Show this help and exit.
896896
-v Show version information and exit.
897897
898-
This function sets the \'OLLAMA_LIB_THINKING\' environment variable, which controls whether the model\'s \'thinking\' process is displayed.
898+
This function sets the \'OBL_THINKING\' environment variable, which controls whether the model\'s \'thinking\' process is displayed.
899899
Modes:
900900
- on: Show thinking output.
901901
- off: Hide thinking output.
@@ -912,7 +912,7 @@ Configure the 'thinking' mode for model responses.
912912
-h Show this help and exit.
913913
-v Show version information and exit.
914914
915-
This function sets the \'OLLAMA_LIB_THINKING\' environment variable, which controls whether the model\'s \'thinking\' process is displayed.
915+
This function sets the \'OBL_THINKING\' environment variable, which controls whether the model\'s \'thinking\' process is displayed.
916916
Modes:
917917
- on: Show thinking output.
918918
- off: Hide thinking output.
@@ -954,7 +954,7 @@ Get the version of the Ollama Bash Lib.
954954
-h Show this help and exit.
955955
-v Show version information and exit.
956956
957-
This function returns the current version number of the library as defined in the 'OLLAMA_LIB_VERSION' variable.
957+
This function returns the current version number of the library as defined in the 'OBL_VERSION' variable.
958958
It is useful for checking the library version for compatibility or debugging purposes.
959959
```
960960

@@ -967,6 +967,6 @@ Get the version of the Ollama Bash Lib.
967967
-h Show this help and exit.
968968
-v Show version information and exit.
969969
970-
This function returns the current version number of the library as defined in the 'OLLAMA_LIB_VERSION' variable.
970+
This function returns the current version number of the library as defined in the 'OBL_VERSION' variable.
971971
It is useful for checking the library version for compatibility or debugging purposes.
972972
```

demos/help.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ startup() {
99
source "$ollama_bash_lib"
1010
#if ! ollama_app_installed; then echo "ERROR: Ollama Not Installed"; fi;
1111
#if ! ollama_api_ping; then echo "ERROR: Ollama API not reachable"; fi
12-
echo; echo "A [demo](../README.md#demos) of [$OLLAMA_LIB_NAME]($OLLAMA_LIB_URL) v$OLLAMA_LIB_VERSION"
12+
echo; echo "A [demo](../README.md#demos) of [$OBL_NAME]($OBL_URL) v$OBL_VERSION"
1313
}
1414

1515
startup

0 commit comments

Comments
 (0)