Spaces:
Running
Running
version bump
Browse files- agent.py +7 -14
- requirements.txt +1 -1
agent.py
CHANGED
@@ -21,6 +21,8 @@ def create_assistant_tools(cfg):
|
|
21 |
vectara_customer_id=cfg.customer_id,
|
22 |
vectara_corpus_id=cfg.corpus_ids[0])
|
23 |
|
|
|
|
|
24 |
ask_vehicles = vec_factory_1.create_rag_tool(
|
25 |
tool_name = "ask_vehicles",
|
26 |
tool_description = """
|
@@ -30,8 +32,8 @@ def create_assistant_tools(cfg):
|
|
30 |
tool_args_schema = QueryElectricCars,
|
31 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
32 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
33 |
-
summary_num_results =
|
34 |
-
vectara_summarizer =
|
35 |
include_citations = False,
|
36 |
)
|
37 |
|
@@ -60,8 +62,8 @@ def create_assistant_tools(cfg):
|
|
60 |
tool_args_schema = QueryEVLaws,
|
61 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
62 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
63 |
-
summary_num_results =
|
64 |
-
vectara_summarizer =
|
65 |
include_citations = False,
|
66 |
)
|
67 |
|
@@ -73,16 +75,7 @@ def create_assistant_tools(cfg):
|
|
73 |
sql_database = SQLDatabase(create_engine('sqlite:///ev_database.db')),
|
74 |
)
|
75 |
|
76 |
-
|
77 |
-
"""
|
78 |
-
Given a database table name, returns the first 25 rows of the table.
|
79 |
-
"""
|
80 |
-
ev_load_data = [db_tools[i] for i in range(len(db_tools)) if db_tools[i]._metadata.name == 'ev_load_data'][0]
|
81 |
-
return ev_load_data(f"SELECT * FROM {table_name} LIMIT 25")
|
82 |
-
|
83 |
-
|
84 |
-
return ([tools_factory.create_tool(ev_load_sample_data)] +
|
85 |
-
tools_factory.standard_tools() +
|
86 |
tools_factory.guardrail_tools() +
|
87 |
db_tools +
|
88 |
[ask_vehicles, ask_policies]
|
|
|
21 |
vectara_customer_id=cfg.customer_id,
|
22 |
vectara_corpus_id=cfg.corpus_ids[0])
|
23 |
|
24 |
+
summarizer = 'vectara-experimental-summary-ext-2023-12-11-med-omni'
|
25 |
+
|
26 |
ask_vehicles = vec_factory_1.create_rag_tool(
|
27 |
tool_name = "ask_vehicles",
|
28 |
tool_description = """
|
|
|
32 |
tool_args_schema = QueryElectricCars,
|
33 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
34 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
35 |
+
summary_num_results = 5,
|
36 |
+
vectara_summarizer = summarizer,
|
37 |
include_citations = False,
|
38 |
)
|
39 |
|
|
|
62 |
tool_args_schema = QueryEVLaws,
|
63 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
64 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
65 |
+
summary_num_results = 5,
|
66 |
+
vectara_summarizer = summarizer,
|
67 |
include_citations = False,
|
68 |
)
|
69 |
|
|
|
75 |
sql_database = SQLDatabase(create_engine('sqlite:///ev_database.db')),
|
76 |
)
|
77 |
|
78 |
+
return (tools_factory.standard_tools() +
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
tools_factory.guardrail_tools() +
|
80 |
db_tools +
|
81 |
[ask_vehicles, ask_policies]
|
requirements.txt
CHANGED
@@ -7,4 +7,4 @@ langdetect==1.0.9
|
|
7 |
langcodes==3.4.0
|
8 |
datasets==2.19.2
|
9 |
uuid==1.30
|
10 |
-
vectara-agentic==0.1.
|
|
|
7 |
langcodes==3.4.0
|
8 |
datasets==2.19.2
|
9 |
uuid==1.30
|
10 |
+
vectara-agentic==0.1.15
|