🐛 fix(functionscalls.py): fix typo in FunctionCallError class name

 feat(functionscalls.py): add error handling for missing arguments in function calls
🐛 fix(makeprompt.py): fix typo in function_call variable name
🔀 chore(gpt-3.5-turbo.txt): update instructions to only use provided functions
This commit is contained in:
2023-08-15 12:38:37 +02:00
parent 68ff639f27
commit 456e147785
3 changed files with 61 additions and 14 deletions

View File

@@ -141,14 +141,16 @@ async def chatgpt_process(
model=model,
messages=msgs,
functions=called_functions,
# function_call="auto",
function_call="auto",
)
print(msgs)
print(f"messages: {msgs}")
response = response["choices"][0]["message"] # type: ignore
print(f"response: {response}")
if response.get("function_call"):
function_call = response.get("function_call")
name = function_call.get("name", "")
arguments = function_call.get("arguments", {})
print(f"arguments: {arguments}")
arguments = json.loads(arguments)
if name == "add_reaction_to_last_message":
if arguments.get("emoji"):