mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-16 15:46:19 +01:00
If there is only one function call, force GPT to use it and if there are multiple, use 'auto'
This commit is contained in:
@@ -61,7 +61,10 @@ def create_gpt_chat_completion(messages: List[dict], req_type, min_tokens=MIN_TO
|
||||
|
||||
if function_calls is not None:
|
||||
gpt_data['functions'] = function_calls['definitions']
|
||||
gpt_data['function_call'] = { 'name': function_calls['definitions'][0]['name'] }
|
||||
if len(function_calls['definitions']) > 1:
|
||||
gpt_data['function_call'] = 'auto'
|
||||
else:
|
||||
gpt_data['function_call'] = { 'name': function_calls['definitions'][0]['name'] }
|
||||
|
||||
try:
|
||||
response = stream_gpt_completion(gpt_data, req_type)
|
||||
|
||||
Reference in New Issue
Block a user