Spaces:
Runtime error
Runtime error
Commit ·
e5a4f30
1
Parent(s): 49598cf
update
Browse files
app/services/agentic_prompt.py
CHANGED
|
@@ -86,7 +86,7 @@ def _format_json_guidance(user_data: Dict) -> str:
|
|
| 86 |
else "Set `keywords` to an empty array."
|
| 87 |
)
|
| 88 |
images_instruction = (
|
| 89 |
-
"Include up to 3 image URLs from get_image_search when they help visualize the condition."
|
| 90 |
if user_data.get('include_images', True)
|
| 91 |
else "Set `images` to an empty array."
|
| 92 |
)
|
|
@@ -111,13 +111,13 @@ def _format_json_guidance(user_data: Dict) -> str:
|
|
| 111 |
)
|
| 112 |
|
| 113 |
return (
|
| 114 |
-
"\nYour final response MUST be valid JSON:\n"
|
| 115 |
"{\n"
|
| 116 |
" \"response\": \"Start with `## Response from References` containing evidence-based information with citations [1], [2]. "
|
| 117 |
"Add `## Personalization Recommendation` analyzing how their profile affects this condition. "
|
| 118 |
"Add `## Environmental Condition` explaining environmental impact on their skin.\",\n"
|
| 119 |
-
" \"keywords\": [\"keyword1\", \"keyword2\", ...],\n"
|
| 120 |
" \"references\": [\"ONLY search result URLs/sources, NO file paths\"],\n"
|
|
|
|
| 121 |
" \"images\": [\"image_urls_from_search\"]\n"
|
| 122 |
"}\n\n"
|
| 123 |
f"{references_instruction}\n"
|
|
@@ -138,7 +138,9 @@ def get_web_search_prompt(user_data: Dict) -> str:
|
|
| 138 |
"",
|
| 139 |
"## QUERY ASSESSMENT:",
|
| 140 |
"First determine if the query is medical/dermatological. If not, politely decline.",
|
| 141 |
-
"",
|
|
|
|
|
|
|
| 142 |
"## TOOL EXECUTION ORDER FOR MEDICAL QUERIES:",
|
| 143 |
]
|
| 144 |
|
|
@@ -219,7 +221,9 @@ def get_vector_search_prompt(user_data: Dict) -> str:
|
|
| 219 |
"",
|
| 220 |
"## QUERY ASSESSMENT:",
|
| 221 |
"Determine if medical/dermatological. If not, politely decline.",
|
| 222 |
-
"",
|
|
|
|
|
|
|
| 223 |
"## TOOL EXECUTION ORDER FOR MEDICAL QUERIES:",
|
| 224 |
]
|
| 225 |
|
|
|
|
| 86 |
else "Set `keywords` to an empty array."
|
| 87 |
)
|
| 88 |
images_instruction = (
|
| 89 |
+
"Include up to 3 image URLs from get_image_search when they help visualize the condition. and If needed image url more than one tool calling then do it together not one by one"
|
| 90 |
if user_data.get('include_images', True)
|
| 91 |
else "Set `images` to an empty array."
|
| 92 |
)
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
return (
|
| 114 |
+
"\nYour final response MUST be valid JSON Strictly follow below structure:\n"
|
| 115 |
"{\n"
|
| 116 |
" \"response\": \"Start with `## Response from References` containing evidence-based information with citations [1], [2]. "
|
| 117 |
"Add `## Personalization Recommendation` analyzing how their profile affects this condition. "
|
| 118 |
"Add `## Environmental Condition` explaining environmental impact on their skin.\",\n"
|
|
|
|
| 119 |
" \"references\": [\"ONLY search result URLs/sources, NO file paths\"],\n"
|
| 120 |
+
" \"keywords\": [\"keyword1\", \"keyword2\", ...],\n"
|
| 121 |
" \"images\": [\"image_urls_from_search\"]\n"
|
| 122 |
"}\n\n"
|
| 123 |
f"{references_instruction}\n"
|
|
|
|
| 138 |
"",
|
| 139 |
"## QUERY ASSESSMENT:",
|
| 140 |
"First determine if the query is medical/dermatological. If not, politely decline.",
|
| 141 |
+
"Please invoke each tool one at a time, waiting for the response before invoking the next. If you need to use the same tool multiple times—for example, for different topics—then call that tool multiple times just vector serach adn web search tool, but still one at a time.",
|
| 142 |
+
"if there multiple topics then call web search multiple time for each topic"
|
| 143 |
+
"if the query of user required more than one web search then do it but given answer by combining and use same structure do not strictly give 2 separte json do not make any silly mistake."
|
| 144 |
"## TOOL EXECUTION ORDER FOR MEDICAL QUERIES:",
|
| 145 |
]
|
| 146 |
|
|
|
|
| 221 |
"",
|
| 222 |
"## QUERY ASSESSMENT:",
|
| 223 |
"Determine if medical/dermatological. If not, politely decline.",
|
| 224 |
+
"Please invoke each tool one at a time, waiting for the response before invoking the next. If you need to use the same tool multiple times—for example, for different topics—then call that tool multiple times just vector serach adn web search tool, but still one at a time.",
|
| 225 |
+
"if there multiple topics then call web search multiple time for each topic",
|
| 226 |
+
"if the query of user required more than one vector query search then do it but given answer by combining and use same structure do not strictly give 2 separte json do not make any silly mistake."
|
| 227 |
"## TOOL EXECUTION ORDER FOR MEDICAL QUERIES:",
|
| 228 |
]
|
| 229 |
|