Skip to content

Commit

Permalink
using single quotes inside f-string
Browse files Browse the repository at this point in the history
  • Loading branch information
interstellarninja committed Mar 27, 2024
1 parent 1ec8264 commit bd02a3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functioncall.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ def recursive_loop(prompt, completion, depth):
try:
function_response = self.execute_function_call(tool_call)
tool_message += f"<tool_response>\n{function_response}\n</tool_response>\n"
inference_logger.info(f"Here's the response from the function call: {tool_call.get("name")}\n{function_response}")
inference_logger.info(f"Here's the response from the function call: {tool_call.get('name')}\n{function_response}")
except Exception as e:
inference_logger.info(f"Could not execute function: {e}")
tool_message += f"<tool_response>\nThere was an error when executing the function: {tool_call.get("name")}\nHere's the error traceback: {e}\nPlease call this function again with correct arguments within XML tags <tool_call></tool_call>\n</tool_response>\n"
tool_message += f"<tool_response>\nThere was an error when executing the function: {tool_call.get('name')}\nHere's the error traceback: {e}\nPlease call this function again with correct arguments within XML tags <tool_call></tool_call>\n</tool_response>\n"
else:
inference_logger.info(message)
tool_message += f"<tool_response>\nThere was an error validating function call against function signature: {tool_call.get("name")}\nHere's the error traceback: {message}\nPlease call this function again with correct arguments within XML tags <tool_call></tool_call>\n</tool_response>\n"
tool_message += f"<tool_response>\nThere was an error validating function call against function signature: {tool_call.get('name')}\nHere's the error traceback: {message}\nPlease call this function again with correct arguments within XML tags <tool_call></tool_call>\n</tool_response>\n"
prompt.append({"role": "tool", "content": tool_message})

depth += 1
Expand Down

0 comments on commit bd02a3a

Please sign in to comment.