This commit is contained in:
LeonOstrez
2023-08-14 14:43:08 +02:00
13 changed files with 121 additions and 54 deletions

View File

@@ -194,9 +194,11 @@ def stream_gpt_completion(data, req_type):
if 'name' in json_line['function_call']:
function_calls['name'] = json_line['function_call']['name']
print(f'Function call: {function_calls["name"]}')
if 'arguments' in json_line['function_call']:
function_calls['arguments'] += json_line['function_call']['arguments']
print(json_line['function_call']['arguments'], end='', flush=True)
if 'content' in json_line:
content = json_line.get('content')
if content: