DjangoPeng / DjangoPeng/ChatPPT
Add to env BASE_URL
- Dominant language
- Jupyter Notebook
- Stars
- 179
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
First off, I’d like to say how much I enjoy using ChatPPT—it’s such a cool tool for generating presentations! I’ve been experimenting with it and had an idea that might make it even more versatile.
Would it be possible to add support for an OPENAI_API_BASE environment variable? This would allow users to easily point ChatPPT to any OpenAI-compatible API (like Qwen, Grok, or local setups with Ollama) by setting a custom base URL, alongside the existing OPENAI_API_KEY. I think it’d be a fantastic way to give users more flexibility without changing too much of the codebase—since ChatOpenAI from LangChain already supports this parameter.
For example, something like this in chatbot.py:
`self.chatbot = system_prompt | ChatOpenAI(
model="qwen-plus",
temperature=0.5,
max_tokens=4096,
openai_api_key=os.getenv("OPENAI_API_KEY"),
openai_api_base=os.getenv("OPENAI_API_BASE", "https://dashscope-intl.aliyuncs.com/compatible-mode/v1")
)`
I’d love to hear your thoughts on this! It could open up ChatPPT to a wider range of models and use cases. Thanks so much for your amazing work on this project—I’m excited to see where it goes next!
Best regards,
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.