Skip to content

How do you add an Azure ChatGPT deployment as the OPENAI_API_BASE? #191

@dnhkng

Description

@dnhkng

Hi,

I have access to ChatGPT via Azure, and I can access it with curl:

curl "https://my_deployment.openai.azure.com/openai/deployments/my_gpt35turbo/completions?api-version=2023-05-15"\
  -H "Content-Type: application/json" \
  -H "api-key: my_secret_key" \
  -d "{
  \"prompt\": \"Once upon a time\",
  \"max_tokens\": 50
}"   

How do I use this with Chatdev? I've tried multiple ways, like this:

OPENAI_API_BASE="https://my_deployment.openai.azure.com/openai/deployments/my_gpt35turbo?api-version=2023-05-15" OPENAI_API_KEY=my_secret_key python3 run.py --task "Snake game in pure html" --name "WebSnake"

But I always see this in the logs:
[2023-17-10 09:03:10 INFO] error_code=404 error_message='Resource not found' error_param=None error_type=None message='OpenAI API error received' stream_error=False

Any tips on how to correctly set the OPENAI_API_BASE for Azure users? Does the deployment name have to match? ie it must be set as 'GPT_3_5_TURBO' on Azure? Or can I modify that in the ChatDev code?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions