OpenGVLab / OpenGVLab/Ask-Anything

Langchain uses wrong OpenAI endpoint

Open
#29 9 comments 13 reactions 0 assignees View on GitHub

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:

  1. import OpenAiChat instead of OpenAi from langchain.llms.openai on line 4.
  2. Use self.llm = OpenAIChat(...) instead of self.llm = OpenAI(...) on line 70.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.