Spaces:
Running
Running
update
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ load_dotenv(override=True)
|
|
14 |
|
15 |
from pydantic import Field, BaseModel
|
16 |
from vectara_agent.agent import Agent, AgentStatusType
|
17 |
-
from vectara_agent.tools import ToolsFactory
|
18 |
|
19 |
tickers = {
|
20 |
"AAPL": "Apple Computer",
|
@@ -80,10 +80,12 @@ def create_tools(cfg):
|
|
80 |
year: int = Field(..., description=f"The year. An integer between {min(years)} and {max(years)}.")
|
81 |
ticker: str = Field(..., description=f"The company ticker. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
87 |
tool_name = "ask_transcripts",
|
88 |
tool_description = """
|
89 |
Given a company name and year, responds to a user question about the company, based on analyst call transcripts about the company's financial reports for that year.
|
|
|
14 |
|
15 |
from pydantic import Field, BaseModel
|
16 |
from vectara_agent.agent import Agent, AgentStatusType
|
17 |
+
from vectara_agent.tools import ToolsFactory, VectaraToolFactory
|
18 |
|
19 |
tickers = {
|
20 |
"AAPL": "Apple Computer",
|
|
|
80 |
year: int = Field(..., description=f"The year. An integer between {min(years)} and {max(years)}.")
|
81 |
ticker: str = Field(..., description=f"The company ticker. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
82 |
|
83 |
+
vec_factory = VectaraToolFactory(vectara_api_key=cfg.api_key,
|
84 |
+
vectara_customer_id=cfg.customer_id,
|
85 |
+
vectara_corpus_id=cfg.corpus_id)
|
86 |
+
tools_factory = ToolsFactory()
|
87 |
+
|
88 |
+
ask_transcripts = vec_factory.create_rag_tool(
|
89 |
tool_name = "ask_transcripts",
|
90 |
tool_description = """
|
91 |
Given a company name and year, responds to a user question about the company, based on analyst call transcripts about the company's financial reports for that year.
|