check error
parent
23ceef4bb4
commit
e999f3c8f4
|
@ -45,6 +45,9 @@ async def generate_response(prompt, context=[]):
|
||||||
async def buffered_generate_response(prompt, context=[]):
|
async def buffered_generate_response(prompt, context=[]):
|
||||||
buffer = ''
|
buffer = ''
|
||||||
async for part in generate_response(prompt, context):
|
async for part in generate_response(prompt, context):
|
||||||
|
if error := part.get('error'):
|
||||||
|
raise Exception(error)
|
||||||
|
|
||||||
if part['done']:
|
if part['done']:
|
||||||
yield buffer, part
|
yield buffer, part
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue