fix qwen-vl blocking mode (#13052)

This commit is contained in:
heyszt 2025-01-27 11:35:23 +08:00 committed by GitHub
parent edc29780ed
commit 6c31ee36cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,8 +219,12 @@ class TongyiLargeLanguageModel(LargeLanguageModel):
if response.status_code not in {200, HTTPStatus.OK}:
raise ServiceUnavailableError(response.message)
# transform assistant message to prompt message
resp_content = response.output.choices[0].message.content
# special for qwen-vl
if isinstance(resp_content, list):
resp_content = resp_content[0]["text"]
assistant_prompt_message = AssistantPromptMessage(
content=response.output.choices[0].message.content,
content=resp_content,
)
# transform usage