examples: add DaoXE OpenAI-compatible gateway client#3504
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5816415e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # Or set OPENAI_BASE_URL / OPENAI_API_KEY | ||
| base_url=os.environ.get("DAOXE_BASE_URL", "https://daoxe.com/v1"), | ||
| api_key=os.environ["DAOXE_API_KEY"], |
There was a problem hiding this comment.
Honor the documented OpenAI env vars
When a user follows this comment and sets OPENAI_BASE_URL/OPENAI_API_KEY instead of the DAOXE_* variables, the script still evaluates os.environ["DAOXE_API_KEY"] during client construction and raises KeyError before the client can use OPENAI_API_KEY; it also always passes a base_url, so OPENAI_BASE_URL is ignored. Either remove the comment or fall back to the documented env vars so the example works in that advertised setup.
Useful? React with 👍 / 👎.
Summary
base_url=https://daoxe.com/v1).Disclosure: I am affiliated with DaoXE.