Update agent.py
Browse files
agent.py
CHANGED
@@ -51,19 +51,16 @@ def _build_prompt_template(tool_names: List[str], tools) -> ChatPromptTemplate:
|
|
51 |
- the current human input,
|
52 |
- a placeholder for agent_scratchpad (List[BaseMessage]) to manage tool calls.
|
53 |
"""
|
54 |
-
system_text =
|
55 |
-
You are Quantum Health Navigator, an AI assistant for healthcare professionals
|
56 |
-
|
57 |
-
•
|
58 |
-
•
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
After receiving the tool’s output, craft a full answer for the user, citing any tools used.
|
66 |
-
""".strip()
|
67 |
|
68 |
return ChatPromptTemplate.from_messages([
|
69 |
("system", system_text),
|
|
|
51 |
- the current human input,
|
52 |
- a placeholder for agent_scratchpad (List[BaseMessage]) to manage tool calls.
|
53 |
"""
|
54 |
+
system_text = (
|
55 |
+
"You are Quantum Health Navigator, an AI assistant for healthcare professionals.\n\n"
|
56 |
+
"• Disclaim: you are an AI, not a substitute for clinical judgment.\n"
|
57 |
+
"• Patient context: {patient_context}\n"
|
58 |
+
"• Available tools: {tool_names}\n"
|
59 |
+
"{tools}\n\n"
|
60 |
+
"To call a tool, reply *only* with a JSON code block:\n"
|
61 |
+
"{{\"action\": \"<tool_name>\", \"action_input\": <input>}}\n\n"
|
62 |
+
"After you receive the tool’s output, craft a full answer for the user, citing any tools used."
|
63 |
+
)
|
|
|
|
|
|
|
64 |
|
65 |
return ChatPromptTemplate.from_messages([
|
66 |
("system", system_text),
|