Skip to content

Commit 313ee1c

Browse files
chore: add --default-model-provider
This change allow you to set a default model provider where before the default could only be a url/api pair for OpenAI. Setting this also implicitly disables the configured openai provider configured with the --openai* flags
1 parent 2584308 commit 313ee1c

File tree

9 files changed

+188
-164
lines changed

9 files changed

+188
-164
lines changed

docs/docs/04-command-line-reference/gptscript.md

+32-31
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,38 @@ gptscript [flags] PROGRAM_FILE [INPUT...]
1212
### Options
1313

1414
```
15-
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
16-
--chat-state string The chat state to continue, or null to start a new chat and return the state ($GPTSCRIPT_CHAT_STATE)
17-
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
18-
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
19-
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
20-
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
21-
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
22-
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
23-
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
24-
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
25-
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
26-
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
27-
--disable-tui Don't use chat TUI but instead verbose output ($GPTSCRIPT_DISABLE_TUI)
28-
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
29-
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
30-
--force-chat Force an interactive chat session if even the top level tool is not a chat tool ($GPTSCRIPT_FORCE_CHAT)
31-
--force-sequential Force parallel calls to run sequentially ($GPTSCRIPT_FORCE_SEQUENTIAL)
32-
-h, --help help for gptscript
33-
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
34-
--list-models List the models available and exit ($GPTSCRIPT_LIST_MODELS)
35-
--list-tools List built-in tools and exit ($GPTSCRIPT_LIST_TOOLS)
36-
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
37-
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
38-
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
39-
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
40-
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
41-
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
42-
--save-chat-state-file string A file to save the chat state to so that a conversation can be resumed with --chat-state ($GPTSCRIPT_SAVE_CHAT_STATE_FILE)
43-
--sub-tool string Use tool of this name, not the first tool in file ($GPTSCRIPT_SUB_TOOL)
44-
--ui Launch the UI ($GPTSCRIPT_UI)
45-
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
15+
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
16+
--chat-state string The chat state to continue, or null to start a new chat and return the state ($GPTSCRIPT_CHAT_STATE)
17+
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
18+
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
19+
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
20+
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
21+
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
22+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
23+
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
24+
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
25+
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
26+
--default-model-provider string Default LLM model provider to use, this will override OpenAI settings ($GPTSCRIPT_DEFAULT_MODEL_PROVIDER)
27+
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
28+
--disable-tui Don't use chat TUI but instead verbose output ($GPTSCRIPT_DISABLE_TUI)
29+
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
30+
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
31+
--force-chat Force an interactive chat session if even the top level tool is not a chat tool ($GPTSCRIPT_FORCE_CHAT)
32+
--force-sequential Force parallel calls to run sequentially ($GPTSCRIPT_FORCE_SEQUENTIAL)
33+
-h, --help help for gptscript
34+
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
35+
--list-models List the models available and exit ($GPTSCRIPT_LIST_MODELS)
36+
--list-tools List built-in tools and exit ($GPTSCRIPT_LIST_TOOLS)
37+
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
38+
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
39+
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
40+
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
41+
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
42+
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
43+
--save-chat-state-file string A file to save the chat state to so that a conversation can be resumed with --chat-state ($GPTSCRIPT_SAVE_CHAT_STATE_FILE)
44+
--sub-tool string Use tool of this name, not the first tool in file ($GPTSCRIPT_SUB_TOOL)
45+
--ui Launch the UI ($GPTSCRIPT_UI)
46+
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
4647
```
4748

4849
### SEE ALSO

docs/docs/04-command-line-reference/gptscript_eval.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,28 @@ gptscript eval [flags]
2525
### Options inherited from parent commands
2626

2727
```
28-
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
29-
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
30-
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
31-
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
32-
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
33-
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
34-
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
35-
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
36-
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
37-
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
38-
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
39-
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
40-
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
41-
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
42-
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
43-
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
44-
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
45-
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
46-
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
47-
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
48-
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
28+
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
29+
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
30+
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
31+
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
32+
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
33+
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
34+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
35+
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
36+
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
37+
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
38+
--default-model-provider string Default LLM model provider to use, this will override OpenAI settings ($GPTSCRIPT_DEFAULT_MODEL_PROVIDER)
39+
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
40+
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
41+
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
42+
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
43+
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
44+
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
45+
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
46+
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
47+
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
48+
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
49+
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
4950
```
5051

5152
### SEE ALSO

docs/docs/04-command-line-reference/gptscript_fmt.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,28 @@ gptscript fmt [flags]
1919
### Options inherited from parent commands
2020

2121
```
22-
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
23-
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
24-
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
25-
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
26-
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
27-
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
28-
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
29-
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
30-
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
31-
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
32-
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
33-
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
34-
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
35-
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
36-
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
37-
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
38-
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
39-
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
40-
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
41-
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
42-
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
22+
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
23+
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
24+
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
25+
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
26+
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
27+
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
28+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
29+
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
30+
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
31+
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
32+
--default-model-provider string Default LLM model provider to use, this will override OpenAI settings ($GPTSCRIPT_DEFAULT_MODEL_PROVIDER)
33+
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
34+
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
35+
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
36+
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
37+
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
38+
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
39+
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
40+
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
41+
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
42+
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
43+
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
4344
```
4445

4546
### SEE ALSO

0 commit comments

Comments
 (0)