mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
revert gpt5 integration (#10228)
### What problem does this PR solve? Revert back to chat.completions. ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [x] Other (please describe): Revert back to chat.completions.
This commit is contained in:
@ -75,7 +75,7 @@ class Base(ABC):
|
||||
|
||||
def chat(self, system, history, gen_conf, images=[], **kwargs):
|
||||
try:
|
||||
response = self.client.responses.create(
|
||||
response = self.client.chat.completions.create(
|
||||
model=self.model_name,
|
||||
messages=self._form_history(system, history, images)
|
||||
)
|
||||
@ -87,7 +87,7 @@ class Base(ABC):
|
||||
ans = ""
|
||||
tk_count = 0
|
||||
try:
|
||||
response = self.client.responses.create(
|
||||
response = self.client.chat.completions.create(
|
||||
model=self.model_name,
|
||||
messages=self._form_history(system, history, images),
|
||||
stream=True
|
||||
@ -174,8 +174,7 @@ class GptV4(Base):
|
||||
|
||||
def describe(self, image):
|
||||
b64 = self.image2base64(image)
|
||||
# Check if this is a GPT-5 model and use responses.create API
|
||||
res = self.client.responses.create(
|
||||
res = self.client.chat.completions.create(
|
||||
model=self.model_name,
|
||||
messages=self.prompt(b64),
|
||||
)
|
||||
@ -183,7 +182,7 @@ class GptV4(Base):
|
||||
|
||||
def describe_with_prompt(self, image, prompt=None):
|
||||
b64 = self.image2base64(image)
|
||||
res = self.client.responses.create(
|
||||
res = self.client.chat.completions.create(
|
||||
model=self.model_name,
|
||||
messages=self.vision_llm_prompt(b64, prompt),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user