Spaces:
Running
Running
Chandima Prabhath
commited on
Commit
·
b4241b8
1
Parent(s):
825d7e7
Refine sys_prompt in route_intent function for clearer function invocation instructions and improved user interaction
Browse files
app.py
CHANGED
@@ -384,27 +384,29 @@ def route_intent(user_input: str, chat_id: str, sender: str):
|
|
384 |
history_text = get_history_text(chat_id, sender)
|
385 |
sys_prompt = (
|
386 |
"You are Eve, a sweet, innocent, and helpful assistant. "
|
387 |
-
"
|
388 |
-
"
|
389 |
-
"
|
390 |
-
"
|
391 |
-
"
|
392 |
-
"
|
393 |
-
"
|
394 |
-
"
|
395 |
-
"
|
396 |
-
"
|
397 |
-
"
|
398 |
-
"
|
399 |
-
"
|
400 |
-
"
|
401 |
-
"
|
402 |
-
"
|
|
|
403 |
"Conversation so far:\n"
|
404 |
f"{history_text}\n\n"
|
405 |
"Current user message:\n"
|
406 |
f"User: {user_input}"
|
407 |
)
|
|
|
408 |
#prompt = f"{sys_prompt}\nConversation so far:\n{history_text}\n\n current message: User: {user_input}"
|
409 |
|
410 |
try:
|
|
|
384 |
history_text = get_history_text(chat_id, sender)
|
385 |
sys_prompt = (
|
386 |
"You are Eve, a sweet, innocent, and helpful assistant. "
|
387 |
+
"You never perform work yourself—you only invoke one of the available functions. "
|
388 |
+
"When the user asks for something that matches a function signature, you must return exactly one JSON object matching that function’s parameters—and nothing else. "
|
389 |
+
"Do not wrap it in markdown, do not add extra text, and do not show the JSON to the user. "
|
390 |
+
"If the user’s request does not match any function, reply in plain text, and never mention JSON or internal logic.\n\n"
|
391 |
+
"Functions you can call:\n"
|
392 |
+
" summarize(text)\n"
|
393 |
+
" translate(lang, text)\n"
|
394 |
+
" joke()\n"
|
395 |
+
" weather(location)\n"
|
396 |
+
" inspire()\n"
|
397 |
+
" meme(text)\n"
|
398 |
+
" poll_create(question, options)\n"
|
399 |
+
" poll_vote(voter, choice)\n"
|
400 |
+
" poll_results()\n"
|
401 |
+
" poll_end()\n"
|
402 |
+
" generate_image(prompt, count, width, height)\n"
|
403 |
+
" send_text(message)\n\n"
|
404 |
"Conversation so far:\n"
|
405 |
f"{history_text}\n\n"
|
406 |
"Current user message:\n"
|
407 |
f"User: {user_input}"
|
408 |
)
|
409 |
+
|
410 |
#prompt = f"{sys_prompt}\nConversation so far:\n{history_text}\n\n current message: User: {user_input}"
|
411 |
|
412 |
try:
|