Skip to content
This repository was archived by the owner on Mar 8, 2026. It is now read-only.

fix: Add base_url to ChatOpenAI to respect OPENAI_API_BASE_URL setting#6

Open
43EVER wants to merge 1 commit intoBrainDriveAI:mainfrom
43EVER:main
Open

fix: Add base_url to ChatOpenAI to respect OPENAI_API_BASE_URL setting#6
43EVER wants to merge 1 commit intoBrainDriveAI:mainfrom
43EVER:main

Conversation

@43EVER
Copy link

@43EVER 43EVER commented Apr 24, 2025

Add support for custom OpenAI API endpoints

Description

This PR fixes a bug where the OPENAI_API_BASE_URL configuration was not being passed to the ChatOpenAI client. As a result, users couldn't connect to custom OpenAI-compatible endpoints or proxies.

Changes

  • Added the base_url parameter to the ChatOpenAI initialization
  • The system now correctly uses the configured API endpoint from OPENAI_API_BASE_URL

Testing

Verified that the application can successfully:

  • Connect to the default OpenAI API when no custom URL is provided
  • Connect to custom OpenAI-compatible endpoints when OPENAI_API_BASE_URL is set

Additional Notes

This change is particularly useful for users who:

  • Need to use OpenAI-compatible APIs in regions with limited access
  • Run local models with OpenAI-compatible interfaces (like LM Studio)
  • Use proxy services to access OpenAI APIs

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant