mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🐛 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:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user