mirror of
https://github.com/microsoft/graphrag.git
synced 2025-11-25 14:37:12 +00:00
[bug] fix chunk.choices[0].delta NoneType (#509)
* fix chunk.choices[0].delta NoneType * Fix delta none on query calls --------- Co-authored-by: Alonso Guevara <alonsog@microsoft.com>
This commit is contained in:
parent
53fcafd57f
commit
ff7ac0512c
@ -0,0 +1,4 @@
|
||||
{
|
||||
"type": "patch",
|
||||
"description": "Fix delta none on query calls"
|
||||
}
|
||||
@ -146,7 +146,10 @@ class ChatOpenAI(BaseLLM, OpenAILLMImpl):
|
||||
if not chunk or not chunk.choices:
|
||||
continue
|
||||
|
||||
delta = chunk.choices[0].delta.content or "" # type: ignore
|
||||
delta = (
|
||||
chunk.choices[0].delta.content if chunk.choices[0].delta else ""
|
||||
) # type: ignore
|
||||
|
||||
full_response += delta
|
||||
if callbacks:
|
||||
for callback in callbacks:
|
||||
@ -182,7 +185,10 @@ class ChatOpenAI(BaseLLM, OpenAILLMImpl):
|
||||
if not chunk or not chunk.choices:
|
||||
continue
|
||||
|
||||
delta = chunk.choices[0].delta.content or "" # type: ignore
|
||||
delta = (
|
||||
chunk.choices[0].delta.content if chunk.choices[0].delta else ""
|
||||
) # type: ignore
|
||||
|
||||
full_response += delta
|
||||
if callbacks:
|
||||
for callback in callbacks:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user