mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix python_api example (#10196)
### What problem does this PR solve? Fix coding example in example ### Type of change - [x] Documentation Update
This commit is contained in:
@ -85,11 +85,11 @@ completion = client.chat.completions.create(
|
||||
)
|
||||
|
||||
if stream:
|
||||
for chunk in completion:
|
||||
print(chunk)
|
||||
if reference and chunk.choices[0].finish_reason == "stop":
|
||||
print(f"Reference:\n{chunk.choices[0].delta.reference}")
|
||||
print(f"Final content:\n{chunk.choices[0].delta.final_content}")
|
||||
for chunk in completion:
|
||||
print(chunk)
|
||||
if reference and chunk.choices[0].finish_reason == "stop":
|
||||
print(f"Reference:\n{chunk.choices[0].delta.reference}")
|
||||
print(f"Final content:\n{chunk.choices[0].delta.final_content}")
|
||||
else:
|
||||
print(completion.choices[0].message.content)
|
||||
if reference:
|
||||
|
||||
Reference in New Issue
Block a user