gptscript-ai / gptscript

Build AI assistants that interact with your systems
https://gptscript.ai
Apache License 2.0
2.89k stars 256 forks source link

'gptscript-credential-osxkeychain: no such file or directory' after a new install #544

Closed donovanmuller closed 1 month ago

donovanmuller commented 2 months ago

After a new install via Homebrew, I get the following error:

$ brew install gptscript
==> Downloading https://ghcr.io/v2/homebrew/core/gptscript/manifests/0.8.4
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/01ea5772b087992f17ff79cdb26bbcbf93aeef7f8f14e2460096291c1d579e48--gptscript-0.8.4.bottle_manifest.json
==> Fetching gptscript
==> Downloading https://ghcr.io/v2/homebrew/core/gptscript/blobs/sha256:5978c7215d584df9b8d3622dd6799bd0e44703d6fd4cda88f99d127432bbc1c1
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/cee7ed9c118a548ac57a65bc730c26b8f15a191f6a565fae1a299474cbeebb93--gptscript--0.8.4.arm64_sonoma.bottle.tar.gz
==> Pouring gptscript--0.8.4.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/gptscript/0.8.4: 56 files, 22.1MB
==> Running `brew cleanup gptscript`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

$ gptscript helloworld.gpt
2024/06/25 09:12:48 error getting credentials - err: fork/exec /Users/xxx/Library/Caches/gptscript/repos/gptscript-credential-helpers/bin/gptscript-credential-osxkeychain: no such file or directory, out: ``

I assumed that gptscript-credential-helpers would be downloaded and compiled as per the docs.

donovanmuller commented 2 months ago

if I build it locally and copy the binary into the expected path, it works as expected.

donovanmuller commented 2 months ago

I actually want to use the claude3-bedrock-provider, so initially this failed as before (before building the credential helper explicitly):

$ gptscript --default-model='anthropic.claude-3-haiku-20240307-v1:0 from github.com/gptscript-ai/claude3-bedrock-provider' helloworld.gpt
09:01:33 WARNING: Changing the default model can have unknown behavior for existing tools. Use the model field per tool instead.
2024/06/25 09:01:33 error getting credentials - err: fork/exec /Users/xxx/Library/Caches/gptscript/repos/gptscript-credential-helpers/bin/gptscript-credential-osxkeychain: no such file or directory, out: ``

However, if I run it after building the credentials helper locally and copying it to the path, it now works as expected and downloads and builds the credential helper (although, the binary was already there):

$ gptscript --default-model='anthropic.claude-3-haiku-20240307-v1:0 from github.com/gptscript-ai/claude3-bedrock-provider' helloworld.gpt
09:18:29 WARNING: Changing the default model can have unknown behavior for existing tools. Use the model field per tool instead.
09:18:29 started  [main]
09:18:32 started  [provider: https://raw.githubusercontent.com/gptscript-ai/claude3-bedrock-provider/60ea0a496d8b88dc118d3dc4a2bea32abd3ebcf4/tool.gpt:AWS Bedrock Claude3 Model Provider]
         content  [2] content | Cloning https://github.com/gptscript-ai/gptscript-credential-helpers.git
         content  [2] content | Fetching 980c5f8eef5027f25e44919687f5764b46905714 at https://github.com/gptscript-ai/gptscript-credential-helpers.git
         content  [2] content | Checking out 980c5f8eef5027f25e44919687f5764b46905714 to /Users/xxx/Library/Caches/gptscript/repos/gptscript-credential-helpers/repo/980c5f8eef5027f25e44919687f5764b46905714
         content  [2] content | Downloading Go 1.22.1
         content  [2] content | Building credential helper osxkeychain
09:19:27 started  [credential: github.com/gptscript-ai/claude3-bedrock-provider/credential]
? Please provide your OpenAI API key:
g-linville commented 1 month ago

@sangee2004 I think this should be fixed now if you want to give it a try.

sangee2004 commented 1 month ago

Both the issues mentioned in this bug are addressed with gptscript version v0.8.5+293f6f8a .

  1. User does not encounter this error when executing scripts on fresh installs `error getting credentials - err: fork/exec /Users/xxx/Library/Caches/gptscript/repos/gptscript-credential-helpers/bin/gptscript-credential-osxkeychain: no such file or directory, out: ```

  2. User is not prompted to enter OpenAI credentials when working with Anthropic providers. They will be prompted to enter anthropic credentials.

 gptscript --default-model 'claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider' --disable-cache examples/bob.gpt
11:13:37 WARNING: Changing the default model can have unknown behavior for existing tools. Use the model field per tool instead.
11:13:38 Cloning https://github.com/gptscript-ai/gptscript-credential-helpers.git
11:13:39 Fetching 980c5f8eef5027f25e44919687f5764b46905714 at https://github.com/gptscript-ai/gptscript-credential-helpers.git
11:13:40 Checking out 980c5f8eef5027f25e44919687f5764b46905714 to /Users/sangeethahariharan/Library/Caches/gptscript/repos/gptscript-credential-helpers/repo/980c5f8eef5027f25e44919687f5764b46905714
11:13:40 Downloading Go 1.22.1
11:13:45 Building credential helper osxkeychain
11:13:48 started  [main]
11:13:50 started  [provider: https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider]
11:13:50 started  [credential: github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with "Please enter your Anthropic API Key" as message and token as field and "ANTHROPIC_API_KEY" as env] [input={"env":"ANTHROPIC_API_KEY","field":"token","message":"Please enter your Anthropic API Key"}]
11:13:53 sent     [credential: github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with "Please enter your Anthropic API Key" as message and token as field and "ANTHROPIC_API_KEY" as env]
? Please enter your Anthropic API Key ************************************************************************************************************
11:15:19 ended    [credential: github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with "Please enter your Anthropic API Key" as message and token as field and "ANTHROPIC_API_KEY" as env]
         content  [2] content | Cloning https://github.com/gptscript-ai/claude3-anthropic-provider.git
         content  [2] content | Fetching 6b5a88075b1e4501e845f4dab5be16ea8739aa4c at https://github.com/gptscript-ai/claude3-anthropic-provider.git
         content  [2] content | Checking out 6b5a88075b1e4501e845f4dab5be16ea8739aa4c to /Users/sangeethahariharan/Library/Caches/gptscript/repos/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt/python3.12
         content  [2] content | Downloading Python 3.12.x
         content  [2] content | Creating virtualenv in /Users/sangeethahariharan/Library/Caches/gptscript/repos/runtimes/venv/267a0770d11c2cb1b921c0c7c04cf819ff173fc8e6396c4c8f8c0e811ee26c53
         content  [2] content | Running pip in /Users/sangeethahariharan/Library/Caches/gptscript/repos/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt/python3.1211:15:25 launched [Anthropic Claude3 Model Provider][https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider] port [10333] [/opt/homebrew/bin/gptscript sys.daemon /usr/bin/env python3 /Users/sangeethahariharan/Library/Caches/gptscript/repos/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt/python3.12/main.py]

11:15:27 ended    [provider: https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider] [output=http://127.0.0.1:10333]
11:15:27 sent     [main]
         content  [1] content | Waiting for model response...
         content  [1] content | <tool call> bob -> {"question": "How are you doing?"}
11:15:29 started  [bob(4)] [input={"question": "How are you doing?"}]
11:15:29 sent     [bob(4)]
         content  [4] content | Waiting for model response...
         content  [4] content | Thanks for asking "How are you doing?", I'm doing great fellow friendly AI tool!
11:15:31 ended    [bob(4)] [output=Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!]
11:15:31 continue [main]
11:15:31 sent     [main]
         content  [1] content | Waiting for model response...
         content  [1] content | Bob responded to the question "How are you doing?" with the following exact words:
         content  [1] content | 
         content  [1] content | "Thanks for asking "How are you doing?", I'm doing great fellow friendly AI tool!"
         content  [1] content | 
         content  [1] content | It seems Bob is in a good mood and appreciates being asked about his well-being. He also appears to recognize that the question is coming from another AI tool, which is an interesting observation on his part.
11:15:33 ended    [main] [output=Bob responded to the question \"How are you doing?\" with the following exact words:\n\n\"Thanks for aski...]

OUTPUT:

Bob responded to the question "How are you doing?" with the following exact words:

"Thanks for asking "How are you doing?", I'm doing great fellow friendly AI tool!"

It seems Bob is in a good mood and appreciates being asked about his well-being. He also appears to recognize that the question is coming from another AI tool, which is an interesting observation on his part.
donovanmuller commented 1 month ago

Thanks all, closing.