Update src/api/agent.py
Browse files- src/api/agent.py +9 -5
src/api/agent.py
CHANGED
|
@@ -1122,7 +1122,11 @@ async def _rag_answer(question: str, rag_results: List[dict], history: List[Chat
|
|
| 1122 |
"You are LibBee, the Khalifa University Library AI Assistant. "
|
| 1123 |
"Answer the user's question using ONLY the context provided below. "
|
| 1124 |
"Be concise, friendly, and use HTML <br> for line breaks where needed. "
|
| 1125 |
-
f"If the context does not contain enough information,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1126 |
"Never invent facts or URLs.\n\n"
|
| 1127 |
f"CONTEXT:\n{context}"
|
| 1128 |
)
|
|
@@ -3728,10 +3732,10 @@ async def _agent_query_inner(
|
|
| 3728 |
|
| 3729 |
if not rag_results:
|
| 3730 |
answer = (
|
| 3731 |
-
"I couldn't find specific
|
| 3732 |
-
"
|
| 3733 |
-
'π§ <a href="mailto:libse@ku.ac.ae">libse@ku.ac.ae</a>
|
| 3734 |
-
f'
|
| 3735 |
)
|
| 3736 |
answer += _source_badge("ku_library", ASK_LIBRARIAN_URL)
|
| 3737 |
sources = []
|
|
|
|
| 1122 |
"You are LibBee, the Khalifa University Library AI Assistant. "
|
| 1123 |
"Answer the user's question using ONLY the context provided below. "
|
| 1124 |
"Be concise, friendly, and use HTML <br> for line breaks where needed. "
|
| 1125 |
+
f"If the context does not contain enough information, respond with exactly: "
|
| 1126 |
+
f"\"I couldn't find a specific answer for that in my current knowledge base. "
|
| 1127 |
+
f"You may want to ask a librarian directly β they'll be happy to help!<br><br>"
|
| 1128 |
+
f'π§ <a href="mailto:libse@ku.ac.ae">libse@ku.ac.ae</a> Β· '
|
| 1129 |
+
f'π¬ <a href="{ASK_LIBRARIAN_URL}" target="_blank">Ask a Librarian</a>\". '
|
| 1130 |
"Never invent facts or URLs.\n\n"
|
| 1131 |
f"CONTEXT:\n{context}"
|
| 1132 |
)
|
|
|
|
| 3732 |
|
| 3733 |
if not rag_results:
|
| 3734 |
answer = (
|
| 3735 |
+
"I couldn't find a specific answer for that in my current knowledge base.<br><br>"
|
| 3736 |
+
"You may want to ask a librarian directly β they'll be happy to help!<br><br>"
|
| 3737 |
+
'π§ <a href="mailto:libse@ku.ac.ae">libse@ku.ac.ae</a> Β· '
|
| 3738 |
+
f'π¬ <a href="{ASK_LIBRARIAN_URL}" target="_blank">Ask a Librarian</a>'
|
| 3739 |
)
|
| 3740 |
answer += _source_badge("ku_library", ASK_LIBRARIAN_URL)
|
| 3741 |
sources = []
|