OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: chatting with assistant broke

Open gaord opened this issue 1 year ago • 7 comments

Is there an existing issue for the same bug?

  • [X] I have checked the troubleshooting document at https://docs.all-hands.dev/modules/usage/troubleshooting
  • [X] I have checked the existing issues.

Describe the bug

when chatting with assistant, I always get the following error:

Agent encountered an error while processing the last action. Error: APIError: litellm.APIError: APIError: OpenAIException - 'str' object has no attribute 'model_dump' Please try again.

Current OpenHands version

0.9

Installation and Configuration

as in quick start guide:
export WORKSPACE_BASE=$(pwd)/workspace

docker run -it --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.9-nikolaik \
    -e SANDBOX_USER_ID=$(id -u) \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app-$(date +%Y%m%d%H%M%S) \
    ghcr.io/all-hands-ai/openhands:0.9

Model and Agent

gpt-4 with proxy, codeactagent

Operating System

No response

Reproduction Steps

No response

Logs, Errors, Screenshots, and Additional Context

No response

gaord avatar Sep 15 '24 15:09 gaord

this can go around with base url setting to https://yourhost/v1. As with openai proxy, v1 is needed for base url.

gaord avatar Sep 15 '24 15:09 gaord

Hi gaord! Just want to understand, you are saying if you set the Base URL, it works? Or it still doesn't work?

If you have a proxy setup, the Base URL must be specified.

mamoodi avatar Sep 15 '24 15:09 mamoodi

it works

gaord avatar Sep 18 '24 15:09 gaord

@gaord do you have by any chance any more logs from the container with that error message?

tobitege avatar Sep 18 '24 15:09 tobitege

If you are running a proxy, you must set a base URL. See docs: https://docs.all-hands.dev/modules/usage/llms/openai-llms#using-an-openai-proxy

mamoodi avatar Sep 18 '24 16:09 mamoodi

it would be helpful to update documents on how to set base_url correctly.

gaord avatar Sep 21 '24 14:09 gaord

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Nov 03 '24 02:11 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Nov 14 '24 01:11 github-actions[bot]