Spaces:
Sleeping
Sleeping
Load MODEL_NAME from env via HF_MODEL, translate TOOLS descriptions to English
Browse files- ai_service.py +4 -4
ai_service.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
import re
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
-
from config import pc, index, EMBED_MODEL, hf_client, PROMPT
|
| 5 |
from database import db_manager
|
| 6 |
|
| 7 |
|
| 8 |
-
MODEL_NAME =
|
| 9 |
|
| 10 |
def clean_ai_response(text: str):
|
| 11 |
if not text: return ""
|
|
@@ -32,13 +32,13 @@ TOOLS = [
|
|
| 32 |
"type": "function",
|
| 33 |
"function": {
|
| 34 |
"name": "search_bank_knowledge",
|
| 35 |
-
"description": "
|
| 36 |
"parameters": {
|
| 37 |
"type": "object",
|
| 38 |
"properties": {
|
| 39 |
"query": {
|
| 40 |
"type": "string",
|
| 41 |
-
"description": "
|
| 42 |
}
|
| 43 |
},
|
| 44 |
"required": ["query"]
|
|
|
|
| 1 |
import re
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
+
from config import pc, index, EMBED_MODEL, hf_client, PROMPT, HF_MODEL
|
| 5 |
from database import db_manager
|
| 6 |
|
| 7 |
|
| 8 |
+
MODEL_NAME = HF_MODEL
|
| 9 |
|
| 10 |
def clean_ai_response(text: str):
|
| 11 |
if not text: return ""
|
|
|
|
| 32 |
"type": "function",
|
| 33 |
"function": {
|
| 34 |
"name": "search_bank_knowledge",
|
| 35 |
+
"description": "Use this tool to search the official Hadhramout Bank profile for accurate information about services, organizational structure, capital, and policies.",
|
| 36 |
"parameters": {
|
| 37 |
"type": "object",
|
| 38 |
"properties": {
|
| 39 |
"query": {
|
| 40 |
"type": "string",
|
| 41 |
+
"description": "The search query (e.g., 'What is Hadhramout Bank capital?' or 'individual services')."
|
| 42 |
}
|
| 43 |
},
|
| 44 |
"required": ["query"]
|