Spaces:
Running
Running
updates
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ languages = {'English': 'en', 'Spanish': 'es', 'French': 'fr', 'German': 'de', '
|
|
20 |
'Hebrew': 'he', 'Hindi': 'hi', 'Italian': 'it', 'Japanese': 'ja', 'Korean': 'ko', 'Portuguese': 'pt'}
|
21 |
initial_prompt = "How can I help you today?"
|
22 |
|
23 |
-
def
|
24 |
|
25 |
def adjust_response_to_student(
|
26 |
text: str = Field(description='the text to adjust. may include citations in markdown format.'),
|
@@ -70,11 +70,12 @@ def create_tools(cfg):
|
|
70 |
include_citations = True,
|
71 |
)
|
72 |
|
73 |
-
return (
|
|
|
74 |
[
|
75 |
adjust_response_to_student,
|
76 |
]
|
77 |
-
|
78 |
tools_factory.standard_tools() +
|
79 |
tools_factory.guardrail_tools() +
|
80 |
[query_tool]
|
@@ -104,7 +105,7 @@ def initialize_agent(_cfg):
|
|
104 |
st.session_state.log_messages.append(output)
|
105 |
|
106 |
agent = Agent(
|
107 |
-
tools=
|
108 |
topic="justice, morality, politics, and philosophy",
|
109 |
custom_instructions=bot_instructions,
|
110 |
update_func=update_func
|
|
|
20 |
'Hebrew': 'he', 'Hindi': 'hi', 'Italian': 'it', 'Japanese': 'ja', 'Korean': 'ko', 'Portuguese': 'pt'}
|
21 |
initial_prompt = "How can I help you today?"
|
22 |
|
23 |
+
def create_assistant_tools(cfg):
|
24 |
|
25 |
def adjust_response_to_student(
|
26 |
text: str = Field(description='the text to adjust. may include citations in markdown format.'),
|
|
|
70 |
include_citations = True,
|
71 |
)
|
72 |
|
73 |
+
return (
|
74 |
+
[tools_factory.create_tool(tool) for tool in
|
75 |
[
|
76 |
adjust_response_to_student,
|
77 |
]
|
78 |
+
] +
|
79 |
tools_factory.standard_tools() +
|
80 |
tools_factory.guardrail_tools() +
|
81 |
[query_tool]
|
|
|
105 |
st.session_state.log_messages.append(output)
|
106 |
|
107 |
agent = Agent(
|
108 |
+
tools=create_assistant_tools(_cfg),
|
109 |
topic="justice, morality, politics, and philosophy",
|
110 |
custom_instructions=bot_instructions,
|
111 |
update_func=update_func
|