Spaces:
Running
Running
bug fixes
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ from vectara_agent.tools import ToolsFactory
|
|
13 |
from vectara_agent.tools_catalog import rephrase_text
|
14 |
|
15 |
|
16 |
-
teaching_styles = ['
|
17 |
languages = {'English': 'en', 'Spanish': 'es', 'French': 'fr', 'German': 'de', 'Arabic': 'ar', 'Chinese': 'zh-cn',
|
18 |
'Hebrew': 'he', 'Hindi': 'hi', 'Italian': 'it', 'Japanese': 'ja', 'Korean': 'ko', 'Portuguese': 'pt'}
|
19 |
initial_prompt = "How can I help you today?"
|
@@ -76,7 +76,6 @@ def create_tools(cfg):
|
|
76 |
[query_tool]
|
77 |
)
|
78 |
|
79 |
-
@st.cache_resource
|
80 |
def initialize_agent(agent_type: AgentType, _cfg):
|
81 |
date = datetime.datetime.now().strftime("%Y-%m-%d")
|
82 |
bot_instructions = f"""
|
@@ -84,6 +83,8 @@ def initialize_agent(agent_type: AgentType, _cfg):
|
|
84 |
- Today's date is {date}.
|
85 |
- Response in a concise and clear manner, and provide the most relevant information to the student.
|
86 |
- Use tools when available instead of depending on your own knowledge.
|
|
|
|
|
87 |
"""
|
88 |
|
89 |
def update_func(status_type: AgentStatusType, msg: str):
|
|
|
13 |
from vectara_agent.tools_catalog import rephrase_text
|
14 |
|
15 |
|
16 |
+
teaching_styles = ['Inquiry-based', 'Socratic', 'traditional']
|
17 |
languages = {'English': 'en', 'Spanish': 'es', 'French': 'fr', 'German': 'de', 'Arabic': 'ar', 'Chinese': 'zh-cn',
|
18 |
'Hebrew': 'he', 'Hindi': 'hi', 'Italian': 'it', 'Japanese': 'ja', 'Korean': 'ko', 'Portuguese': 'pt'}
|
19 |
initial_prompt = "How can I help you today?"
|
|
|
76 |
[query_tool]
|
77 |
)
|
78 |
|
|
|
79 |
def initialize_agent(agent_type: AgentType, _cfg):
|
80 |
date = datetime.datetime.now().strftime("%Y-%m-%d")
|
81 |
bot_instructions = f"""
|
|
|
83 |
- Today's date is {date}.
|
84 |
- Response in a concise and clear manner, and provide the most relevant information to the student.
|
85 |
- Use tools when available instead of depending on your own knowledge.
|
86 |
+
- Always use the rephrase tool at the end in order to ensure it fits the student's age of {_cfg.student_age},
|
87 |
+
the {_cfg.style} teaching style and the {_cfg.language} language
|
88 |
"""
|
89 |
|
90 |
def update_func(status_type: AgentStatusType, msg: str):
|