Skip to content

Conversation

@voodoohop
Copy link

This PR adds support for using custom OpenAI endpoints when the Anthropic API key is not available.

Changes

  1. Fixed OpenAI client to properly stringify function arguments, resolving the error:

    Invalid type for 'messages[].tool_calls[0].function.arguments': expected a string, but got an object instead.
    
  2. Updated the CLI to use the OpenAI client when the Anthropic API key is not set, instead of exiting with an error.

  3. Added support for configuring OpenAI via environment variables and command-line arguments:

    • OPENAI_BASE_URL environment variable for custom endpoints
    • --openai-base-url command-line argument
    • --openai-model command-line argument to specify which model to use

Benefits

  • Allows users to run the agent with OpenAI-compatible endpoints when Anthropic API keys are not available
  • Provides flexibility for users to configure custom OpenAI endpoints
  • Maintains backward compatibility with existing code

These changes make the agent more flexible and accessible to users who may not have Anthropic API keys or who want to use alternative OpenAI-compatible endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant