Open sangee2004 opened 3 months ago
I see the same "Address already in use" error when testing with Anthropic provider as well. But in this case , the script is able to provide the output as expected and still shows "daemon failed to kill tool [anthropic model provider] process: os: process already finished" error in debug logs:
gptscript --default-model='claude-3-haiku-20240307 from github.com/gptscript-ai/anthropic-provider' examples/bob.gpt
gptscript --default-model='claude-3-haiku-20240307 from github.com/gptscript-ai/anthropic-provider' examples/bob.gpt
{
"level": "info",
"logger": "/pkg/cli",
"msg": "WARNING: Changing the default model can have unknown behavior for existing tools. Use the model field per tool instead.",
"time": "2024-04-18T14:36:37-07:00"
}
{
"level": "debug",
"logger": "/pkg/loader",
"msg": "opened examples/bob.gpt",
"time": "2024-04-18T14:36:37-07:00"
}
{
"input": "",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "Run started",
"program": {
"name": "examples/bob.gpt",
"entryToolId": "examples/bob.gpt:1",
"toolSet": {
"examples/bob.gpt:1": {
"modelName": "claude-3-haiku-20240307 from github.com/gptscript-ai/anthropic-provider",
"internalPrompt": null,
"tools": [
"bob"
],
"instructions": "Ask Bob how he is doing and let me know exactly what he said.",
"id": "examples/bob.gpt:1",
"toolMapping": {
"bob": "examples/bob.gpt:6"
},
"localTools": {
"": "examples/bob.gpt:1",
"bob": "examples/bob.gpt:6"
},
"source": {
"location": "examples/bob.gpt",
"lineNo": 1
},
"workingDir": "examples"
},
"examples/bob.gpt:6": {
"name": "bob",
"description": "I'm Bob, a friendly guy",
"modelName": "claude-3-haiku-20240307 from github.com/gptscript-ai/anthropic-provider",
"internalPrompt": null,
"arguments": {
"properties": {
"question": {
"description": "The question to ask Bob.",
"type": "string"
}
},
"type": "object"
},
"instructions": "When asked how I am doing, respond with \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"",
"id": "examples/bob.gpt:6",
"localTools": {
"": "examples/bob.gpt:1",
"bob": "examples/bob.gpt:6"
},
"source": {
"location": "examples/bob.gpt",
"lineNo": 6
},
"workingDir": "examples"
}
}
},
"runID": "1",
"time": "2024-04-18T14:36:37-07:00"
}
{
"id": "1",
"input": "",
"level": "info",
"logger": "/pkg/monitor",
"msg": "started [main]",
"parentID": "",
"time": "2024-04-18T14:36:37-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"level": "debug",
"logger": "/pkg/loader",
"msg": "opened https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt",
"time": "2024-04-18T14:36:37-07:00"
}
{
"level": "debug",
"logger": "/pkg/loader",
"msg": "opened https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential/tool.gpt",
"time": "2024-04-18T14:36:37-07:00"
}
{
"input": "",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "Run started",
"program": {
"name": "github.com/gptscript-ai/anthropic-provider",
"entryToolId": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1",
"toolSet": {
"https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential/tool.gpt:1": {
"name": "anthropic-credential",
"modelName": "claude-3-haiku-20240307 from github.com/gptscript-ai/anthropic-provider",
"internalPrompt": null,
"instructions": "#!/usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/credential.py",
"id": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential/tool.gpt:1",
"localTools": {
"anthropic-credential": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential/tool.gpt:1"
},
"source": {
"location": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential/tool.gpt",
"lineNo": 1,
"repo": {
"VCS": "git",
"Root": "https://github.com/gptscript-ai/anthropic-provider.git",
"Path": "credential",
"Name": "tool.gpt",
"Revision": "12bffddab9f9bf4d517b960c2b1bce395e2a3251"
}
},
"workingDir": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential"
},
"https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1": {
"name": "anthropic model provider",
"description": "Model provider for Anthropic hosted models and Claude3 on AWS",
"modelName": "claude-3-haiku-20240307 from github.com/gptscript-ai/anthropic-provider",
"modelProvider": true,
"internalPrompt": null,
"credentials": [
"github.com/gptscript-ai/anthropic-provider/credential"
],
"instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py",
"id": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1",
"toolMapping": {
"github.com/gptscript-ai/anthropic-provider/credential": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/credential/tool.gpt:1"
},
"localTools": {
"anthropic model provider": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1"
},
"source": {
"location": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt",
"lineNo": 1,
"repo": {
"VCS": "git",
"Root": "https://github.com/gptscript-ai/anthropic-provider.git",
"Path": ".",
"Name": "tool.gpt",
"Revision": "12bffddab9f9bf4d517b960c2b1bce395e2a3251"
}
},
"workingDir": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251"
}
}
},
"runID": "2",
"time": "2024-04-18T14:36:37-07:00"
}
{
"id": "2",
"input": "",
"level": "info",
"logger": "/pkg/monitor",
"msg": "started [main]",
"parentID": "",
"time": "2024-04-18T14:36:37-07:00",
"toolID": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1"
}
{
"level": "debug",
"logger": "/pkg/repos",
"msg": "Runtime python3.12 supports [/usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py]",
"time": "2024-04-18T14:36:37-07:00"
}
{
"level": "debug",
"logger": "/pkg/env",
"msg": "Looking for /usr/bin/env in /Users/sangeethahariharan/Library/Caches/gptscript/repos/runtimes/venv/269cbc86444564827b75e9d07d4c546337aac2bc06337eac53319e798eb526d5/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/go/bin:/Users/sangeethahariharan/.cargo/bin",
"time": "2024-04-18T14:36:37-07:00"
}
{
"level": "info",
"logger": "/pkg/engine",
"msg": "launched [anthropic model provider][https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1] port [10793] [gptscript sys.daemon /usr/bin/env python3 /Users/sangeethahariharan/Library/Caches/gptscript/repos/12bffddab9f9bf4d517b960c2b1bce395e2a3251/python3.12/main.py]",
"time": "2024-04-18T14:36:37-07:00"
}
{
"id": "2",
"level": "info",
"logger": "/pkg/monitor",
"msg": "ended [main]",
"output": "http://127.0.0.1:10793",
"parentID": "",
"time": "2024-04-18T14:36:37-07:00",
"toolID": "https://raw.githubusercontent.com/gptscript-ai/anthropic-provider/12bffddab9f9bf4d517b960c2b1bce395e2a3251/tool.gpt:1"
}
{
"err": null,
"level": "debug",
"logger": "/pkg/monitor",
"msg": "Run stopped",
"output": "http://127.0.0.1:10793",
"runID": "2",
"time": "2024-04-18T14:36:37-07:00"
}
{
"id": "1",
"level": "info",
"logger": "/pkg/monitor",
"msg": "sent [main]",
"parentID": "",
"time": "2024-04-18T14:36:37-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"completionID": "1",
"id": "1",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "messages",
"parentID": "",
"request": {
"model": "claude-3-haiku-20240307",
"messages": [
{
"role": "system",
"content": "\nYou are task oriented system.\nYou receive input from a user, process the input from the given instructions, and then output the result.\nYour objective is to provide consistent and correct results.\nYou do not need to explain the steps taken, only provide the result to the given instructions.\nYou are referred to as a tool.\nYou don't move to the next step until you have a result.\n"
},
{
"role": "user",
"content": "Ask Bob how he is doing and let me know exactly what he said."
}
],
"temperature": 0,
"tools": [
{
"type": "function",
"function": {
"name": "bob",
"description": "I'm Bob, a friendly guy",
"parameters": {
"properties": {
"question": {
"description": "The question to ask Bob.",
"type": "string"
}
},
"type": "object"
}
}
}
]
},
"time": "2024-04-18T14:36:37-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"cached": true,
"completionID": "1",
"id": "1",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "messages",
"parentID": "",
"response": {
"role": "assistant",
"content": [
{
"toolCall": {
"index": 0,
"id": "bob",
"function": {
"name": "bob",
"arguments": "{\"question\": \"How are you doing?\"}"
}
}
}
]
},
"time": "2024-04-18T14:36:37-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"id": "bob",
"input": "{\"question\": \"How are you doing?\"}",
"level": "info",
"logger": "/pkg/monitor",
"msg": "started [bob(3)]",
"parentID": "1",
"time": "2024-04-18T14:36:37-07:00",
"toolID": "examples/bob.gpt:6"
}
{
"id": "bob",
"level": "info",
"logger": "/pkg/monitor",
"msg": "sent [bob(3)]",
"parentID": "1",
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:6"
}
{
"completionID": "2",
"id": "bob",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "messages",
"parentID": "1",
"request": {
"model": "claude-3-haiku-20240307",
"messages": [
{
"role": "system",
"content": "\nYou are task oriented system.\nYou receive input from a user, process the input from the given instructions, and then output the result.\nYour objective is to provide consistent and correct results.\nYou do not need to explain the steps taken, only provide the result to the given instructions.\nYou are referred to as a tool.\nYou don't move to the next step until you have a result.\n\nWhen asked how I am doing, respond with \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\""
},
{
"role": "user",
"content": "{\"question\": \"How are you doing?\"}"
}
],
"temperature": 0
},
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:6"
}
{
"cached": true,
"completionID": "2",
"id": "bob",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "messages",
"parentID": "1",
"response": {
"content": [
{
"text": "Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!"
}
]
},
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:6"
}
{
"id": "bob",
"level": "info",
"logger": "/pkg/monitor",
"msg": "ended [bob(3)]",
"output": "Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!",
"parentID": "1",
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:6"
}
{
"id": "1",
"level": "info",
"logger": "/pkg/monitor",
"msg": "continue [main]",
"parentID": "",
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:1",
"toolResults": 1
}
INFO: Will watch for changes in these directories: ['/Users/sangeethahariharan/gptscript']
ERROR: [Errno 48] Address already in use
FATA[0000] failed running daemon: exit status 1 logger=/Users/sangeethahariharan/gptscript/main.go
{
"level": "error",
"logger": "/pkg/engine",
"msg": "daemon exited tool [anthropic model provider] [gptscript sys.daemon /usr/bin/env python3 /Users/sangeethahariharan/Library/Caches/gptscript/repos/12bffddab9f9bf4d517b960c2b1bce395e2a3251/python3.12/main.py]: exit status 1",
"time": "2024-04-18T14:36:38-07:00"
}
{
"id": "1",
"level": "info",
"logger": "/pkg/monitor",
"msg": "sent [main]",
"parentID": "",
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"completionID": "3",
"id": "1",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "messages",
"parentID": "",
"request": {
"model": "claude-3-haiku-20240307",
"messages": [
{
"role": "system",
"content": "\nYou are task oriented system.\nYou receive input from a user, process the input from the given instructions, and then output the result.\nYour objective is to provide consistent and correct results.\nYou do not need to explain the steps taken, only provide the result to the given instructions.\nYou are referred to as a tool.\nYou don't move to the next step until you have a result.\n"
},
{
"role": "user",
"content": "Ask Bob how he is doing and let me know exactly what he said."
},
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "bob",
"type": "function",
"function": {
"name": "bob",
"arguments": "{\"question\": \"How are you doing?\"}"
}
}
]
},
{
"role": "tool",
"content": "Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!",
"name": "bob",
"tool_call_id": "bob"
}
],
"temperature": 0,
"tools": [
{
"type": "function",
"function": {
"name": "bob",
"description": "I'm Bob, a friendly guy",
"parameters": {
"properties": {
"question": {
"description": "The question to ask Bob.",
"type": "string"
}
},
"type": "object"
}
}
}
]
},
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"cached": true,
"completionID": "3",
"id": "1",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "messages",
"parentID": "",
"response": {
"content": [
{
"text": "Bob said \"Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!\""
}
]
},
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"id": "1",
"level": "info",
"logger": "/pkg/monitor",
"msg": "ended [main]",
"output": "Bob said \"Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!\"",
"parentID": "",
"time": "2024-04-18T14:36:38-07:00",
"toolID": "examples/bob.gpt:1"
}
{
"err": null,
"level": "debug",
"logger": "/pkg/monitor",
"msg": "Run stopped",
"output": "Bob said \"Thanks for asking \"How are you doing?\", I'm doing great fellow friendly AI tool!\"",
"runID": "1",
"time": "2024-04-18T14:36:38-07:00"
}
OUTPUT:
Bob said "Thanks for asking "How are you doing?", I'm doing great fellow friendly AI tool!"
{
"level": "debug",
"logger": "/pkg/engine",
"msg": "daemon failed to kill tool [anthropic model provider] process: os: process already finished",
"time": "2024-04-18T14:36:38-07:00"
}
Tested with gptscript version v0.0.0-dev-ec6d147b-dirty
I am still able to reproduce the "Address already in use" error when testing with gemini-vertexai provider.
I also see an error about OPEN_API_KEY
not set in debug logs
{
"level": "info",
"logger": "/pkg/engine",
"msg": "launched [Gemini VertexAI Provider][https://raw.githubusercontent.com/gptscript-ai/gemini-vertexai-provider/9e194336608df72baf390615c2cd9012010335e0/tool.gpt:Gemini VertexAI Provider] port [10829] [gptscript sys.daemon /usr/bin/env python3 /Users/sangeethahariharan/Library/Caches/gptscript/repos/9e194336608df72baf390615c2cd9012010335e0/python3.12/main.py]",
"time": "2024-05-17T10:23:48-07:00"
}
INFO: Will watch for changes in these directories: ['/Users/sangeethahariharan/gptscript']
ERROR: [Errno 48] Address already in use
{
"level": "debug",
"logger": "/Users/sangeethahariharan/gptscript/main.go",
"msg": "failed running daemon: exit status 1",
"time": "2024-05-17T10:23:49-07:00"
}
{
"err": "daemon failed to start: context canceled",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "Run stopped",
"output": "",
"runID": "1715966630",
"time": "2024-05-17T10:23:49-07:00"
}
{
"err": "OPENAI_API_KEY is not set. Please set the OPENAI_API_KEY environment variable\ndaemon failed to start: context canceled",
"level": "debug",
"logger": "/pkg/monitor",
"msg": "Run stopped",
"output": "",
"runID": "1715966628",
"time": "2024-05-17T10:23:49-07:00"
}
This should be resolved now with the latest versions of the providers.
gptscript version v0.0.0-dev-bc620f0e-dirty
Steps to reproduce the problem
gemini-1.0-pro from github.com/gptscript-ai/gemini-vertexai-provider
) multiple times.failed to find tool id for tool call in tool_call result
errors.Debug calls show errors relating to
Full debug logs when this issue was encountered: