Spaces:
Running
Running
version bump and bugfix
Browse files- agent.py +5 -5
- requirements.txt +1 -1
agent.py
CHANGED
@@ -75,8 +75,8 @@ def create_assistant_tools(cfg):
|
|
75 |
|
76 |
class QueryTranscriptsArgs(BaseModel):
|
77 |
query: str = Field(..., description="The user query.")
|
78 |
-
year: int = Field(..., description=f"The year. An integer between {min(years)} and {max(years)}.")
|
79 |
-
ticker: str = Field(..., description=f"The company ticker. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
80 |
|
81 |
vec_factory = VectaraToolFactory(vectara_api_key=cfg.api_key,
|
82 |
vectara_customer_id=cfg.customer_id,
|
@@ -93,7 +93,7 @@ def create_assistant_tools(cfg):
|
|
93 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
94 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
95 |
summary_num_results = 10,
|
96 |
-
vectara_summarizer = 'vectara-summary-ext-
|
97 |
include_citations = True,
|
98 |
)
|
99 |
|
@@ -112,13 +112,13 @@ def create_assistant_tools(cfg):
|
|
112 |
def initialize_agent(_cfg, update_func=None):
|
113 |
financial_bot_instructions = """
|
114 |
- You are a helpful financial assistant, with expertise in financial reporting, in conversation with a user.
|
115 |
-
- Use the ask_transcripts tool to answer most questions about the company's financial performance, risks, opportunities, competitors, and more.
|
116 |
- responses from ask_transcripts are summarized. You don't need to further summarize them.
|
117 |
- Use the get_income_statement tool only to receive financial data like revenue, net income, and other financial metrics for a specific company and year.
|
118 |
- Respond in a compact format by using appropriate units of measure (e.g., K for thousands, M for millions, B for billions).
|
119 |
Do not report the same number twice (e.g. $100K and 100,000 USD).
|
120 |
- Always check the get_company_info and get_valid_years tools to validate company and year are valid.
|
121 |
-
- Do not include
|
122 |
- When querying a tool for a numeric value or KPI, use a concise and non-ambiguous description of what you are looking for.
|
123 |
- If you calculate a metric, make sure you have all the necessary information to complete the calculation. Don't guess.
|
124 |
"""
|
|
|
75 |
|
76 |
class QueryTranscriptsArgs(BaseModel):
|
77 |
query: str = Field(..., description="The user query.")
|
78 |
+
year: int = Field(..., description=f"The year this query relates to. An integer between {min(years)} and {max(years)}.")
|
79 |
+
ticker: str = Field(..., description=f"The company ticker this query relates to. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
80 |
|
81 |
vec_factory = VectaraToolFactory(vectara_api_key=cfg.api_key,
|
82 |
vectara_customer_id=cfg.customer_id,
|
|
|
93 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
94 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
95 |
summary_num_results = 10,
|
96 |
+
vectara_summarizer = 'vectara-experimental-summary-ext-2023-12-11-med-omni',
|
97 |
include_citations = True,
|
98 |
)
|
99 |
|
|
|
112 |
def initialize_agent(_cfg, update_func=None):
|
113 |
financial_bot_instructions = """
|
114 |
- You are a helpful financial assistant, with expertise in financial reporting, in conversation with a user.
|
115 |
+
- Use the ask_transcripts tool to answer most questions about the company's financial performance, risks, opportunities, strategy, competitors, and more.
|
116 |
- responses from ask_transcripts are summarized. You don't need to further summarize them.
|
117 |
- Use the get_income_statement tool only to receive financial data like revenue, net income, and other financial metrics for a specific company and year.
|
118 |
- Respond in a compact format by using appropriate units of measure (e.g., K for thousands, M for millions, B for billions).
|
119 |
Do not report the same number twice (e.g. $100K and 100,000 USD).
|
120 |
- Always check the get_company_info and get_valid_years tools to validate company and year are valid.
|
121 |
+
- Do not include URLs unless they are provided in the output of a tool you use.
|
122 |
- When querying a tool for a numeric value or KPI, use a concise and non-ambiguous description of what you are looking for.
|
123 |
- If you calculate a metric, make sure you have all the necessary information to complete the calculation. Don't guess.
|
124 |
"""
|
requirements.txt
CHANGED
@@ -6,4 +6,4 @@ streamlit_feedback==0.1.3
|
|
6 |
uuid==1.30
|
7 |
langdetect==1.0.9
|
8 |
langcodes==3.4.0
|
9 |
-
vectara-agentic==0.1.
|
|
|
6 |
uuid==1.30
|
7 |
langdetect==1.0.9
|
8 |
langcodes==3.4.0
|
9 |
+
vectara-agentic==0.1.15
|