fix: 🐛 fix azure openai bug for 07 version
This commit is contained in:
parent
a95d465c2f
commit
a8e69a02e6
1 changed files with 3 additions and 2 deletions
|
|
@ -118,11 +118,12 @@ class OpenAI(LLM):
|
|||
messages=[{"role": "user", "content": prompt}],
|
||||
**args,
|
||||
):
|
||||
if "content" in chunk.choices[0].delta:
|
||||
if len(chunk.choices) > 0 and "content" in chunk.choices[0].delta:
|
||||
yield chunk.choices[0].delta.content
|
||||
else:
|
||||
async for chunk in await openai.Completion.acreate(prompt=prompt, **args):
|
||||
yield chunk.choices[0].text
|
||||
if len(chunk.choices) > 0:
|
||||
yield chunk.choices[0].text
|
||||
|
||||
async def _stream_chat(self, messages: List[ChatMessage], options):
|
||||
args = self.collect_args(options)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue