This commit is contained in:
Steve Androulakis
2025-01-02 10:29:06 -08:00
parent bdbb27d4a9
commit d1b8e150ba
2 changed files with 5 additions and 2 deletions

View File

@@ -35,7 +35,9 @@ class ToolActivities:
try: try:
data = json.loads(response.message.content) data = json.loads(response.message.content)
except json.JSONDecodeError as e: except json.JSONDecodeError as e:
raise ApplicationError(f"Invalid JSON: {e}") print(f"Invalid JSON: {e}")
print(response.message.content)
raise json.JSONDecodeError
return data return data

View File

@@ -73,7 +73,8 @@ def generate_genai_prompt(
prompt_lines.append( prompt_lines.append(
"6. Use 'next': 'question' if you lack any required arguments based on the history and prompt. " "6. Use 'next': 'question' if you lack any required arguments based on the history and prompt. "
"Use 'next': 'confirm' only if NO arguments are missing. " "Use 'next': 'confirm' only if NO arguments are missing. "
"Use 'next': 'done' if no more tool calls are needed." "Use 'next': 'done' and tool: 'null' if you have successfully completed all tools."
"Don't offer any additional tools beyond the tools listed."
) )
prompt_lines.append( prompt_lines.append(
"7. Keep 'response' user-friendly with no extra commentary. Stick to valid JSON syntax. " "7. Keep 'response' user-friendly with no extra commentary. Stick to valid JSON syntax. "