vlff李飞飞 commited on
Commit
87ba825
·
1 Parent(s): f175aee

update oai

Browse files
Files changed (1) hide show
  1. qwen_agent/llm/qwen_oai.py +1 -1
qwen_agent/llm/qwen_oai.py CHANGED
@@ -452,6 +452,7 @@ class QwenChatAsOAI(BaseChatModel):
452
  response = create_chat_completion(_request)
453
  # TODO: error handling
454
  for chunk in response:
 
455
  if hasattr(chunk.choices[0].delta, 'content'):
456
  yield chunk.choices[0].delta.content
457
 
@@ -505,7 +506,6 @@ class QwenChatAsOAI1(BaseChatModel):
505
  stream=True)
506
  # TODO: error handling
507
  for chunk in response:
508
- chunk = json.loads(chunk)
509
  if hasattr(chunk.choices[0].delta, 'content'):
510
  yield chunk.choices[0].delta.content
511
 
 
452
  response = create_chat_completion(_request)
453
  # TODO: error handling
454
  for chunk in response:
455
+ chunk = json.loads(chunk)
456
  if hasattr(chunk.choices[0].delta, 'content'):
457
  yield chunk.choices[0].delta.content
458
 
 
506
  stream=True)
507
  # TODO: error handling
508
  for chunk in response:
 
509
  if hasattr(chunk.choices[0].delta, 'content'):
510
  yield chunk.choices[0].delta.content
511