OpenGVLab / OpenGVLab/Ask-Anything
Langchain uses wrong OpenAI endpoint
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.4k
- Forks
- 268
- PR merge metrics
- No merged PRs in 30d
Description
Context:
Using video_chat
Error:
**openai.error.InvalidRequestError: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?**
Work around:
In chatbot.py:
- import
OpenAiChatinstead ofOpenAifromlangchain.llms.openaion line 4. - Use
self.llm = OpenAIChat(...)instead ofself.llm = OpenAI(...)on line 70.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with chatbot.py, especially the import on line 4 and the language-model setup around line 70. Reproduce the issue through video_chat, compare the configured model class with the endpoint named in the error, and verify that the video-chat flow completes without the v1/completions error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100