Spaces:
Running
Running
updates
Browse files- agent.py +2 -2
- requirements.txt +3 -2
- utils.py +4 -1
agent.py
CHANGED
@@ -79,8 +79,8 @@ def create_assistant_tools(cfg):
|
|
79 |
|
80 |
class QueryTranscriptsArgs(BaseModel):
|
81 |
query: str = Field(..., description="The user query, always in the form of a question", examples=["what are the risks reported?", "who are the competitors?"])
|
82 |
-
year: int = Field(..., description=f"The year this query relates to. An integer between {min(years)} and {max(years)}.")
|
83 |
-
ticker: str = Field(..., description=f"The company ticker this query relates to. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
84 |
|
85 |
vec_factory = VectaraToolFactory(vectara_api_key=cfg.api_key,
|
86 |
vectara_customer_id=cfg.customer_id,
|
|
|
79 |
|
80 |
class QueryTranscriptsArgs(BaseModel):
|
81 |
query: str = Field(..., description="The user query, always in the form of a question", examples=["what are the risks reported?", "who are the competitors?"])
|
82 |
+
year: int | str = Field(..., description=f"The year this query relates to. An integer between {min(years)} and {max(years)} or a string specifying a condition on the year (example: '>2020').")
|
83 |
+
ticker: str = Field(..., description=f"The company ticker this query relates to. Must be a valid ticket symbol from the list {list(tickers.keys())}.")
|
84 |
|
85 |
vec_factory = VectaraToolFactory(vectara_api_key=cfg.api_key,
|
86 |
vectara_customer_id=cfg.customer_id,
|
requirements.txt
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
omegaconf==2.3.0
|
2 |
python-dotenv==1.0.1
|
3 |
-
streamlit==1.
|
4 |
streamlit_pills==0.3.0
|
5 |
streamlit_feedback==0.1.3
|
6 |
uuid==1.30
|
7 |
langdetect==1.0.9
|
8 |
langcodes==3.4.0
|
9 |
-
vectara-agentic==0.1.
|
|
|
|
1 |
omegaconf==2.3.0
|
2 |
python-dotenv==1.0.1
|
3 |
+
streamlit==1.41.1
|
4 |
streamlit_pills==0.3.0
|
5 |
streamlit_feedback==0.1.3
|
6 |
uuid==1.30
|
7 |
langdetect==1.0.9
|
8 |
langcodes==3.4.0
|
9 |
+
vectara-agentic==0.1.21
|
10 |
+
anthropic==0.40.0
|
utils.py
CHANGED
@@ -31,8 +31,11 @@ def thumbs_feedback(feedback, **kwargs):
|
|
31 |
|
32 |
def send_amplitude_data(user_query, bot_response, demo_name, feedback=None):
|
33 |
# Send query and response to Amplitude Analytics
|
|
|
|
|
|
|
34 |
data = {
|
35 |
-
"api_key":
|
36 |
"events": [{
|
37 |
"device_id": st.session_state.device_id,
|
38 |
"event_type": "submitted_query",
|
|
|
31 |
|
32 |
def send_amplitude_data(user_query, bot_response, demo_name, feedback=None):
|
33 |
# Send query and response to Amplitude Analytics
|
34 |
+
amplitude_token = os.environ.get('AMPLITUDE_TOKEN', None)
|
35 |
+
if amplitude_token is None:
|
36 |
+
return
|
37 |
data = {
|
38 |
+
"api_key": amplitude_token,
|
39 |
"events": [{
|
40 |
"device_id": st.session_state.device_id,
|
41 |
"event_type": "submitted_query",
|