Spaces:
Running
Running
david-oplatka
commited on
Commit
·
3c75943
1
Parent(s):
0e395e5
Update vectara-agentic and add chain reranker
Browse files- agent.py +17 -2
- requirements.txt +1 -1
agent.py
CHANGED
@@ -172,13 +172,28 @@ def create_assistant_tools(cfg):
|
|
172 |
vectara_customer_id=cfg.customer_id,
|
173 |
vectara_corpus_id=cfg.corpus_id)
|
174 |
summarizer = 'vectara-experimental-summary-ext-2023-12-11-med-omni'
|
|
|
175 |
ask_caselaw = vec_factory.create_rag_tool(
|
176 |
tool_name = "ask_caselaw",
|
177 |
tool_description = "A tool for asking questions about case law in Alaska.",
|
178 |
tool_args_schema = QueryCaselawArgs,
|
179 |
-
reranker = "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
181 |
-
summary_num_results =
|
182 |
vectara_summarizer = summarizer,
|
183 |
include_citations = False,
|
184 |
)
|
|
|
172 |
vectara_customer_id=cfg.customer_id,
|
173 |
vectara_corpus_id=cfg.corpus_id)
|
174 |
summarizer = 'vectara-experimental-summary-ext-2023-12-11-med-omni'
|
175 |
+
|
176 |
ask_caselaw = vec_factory.create_rag_tool(
|
177 |
tool_name = "ask_caselaw",
|
178 |
tool_description = "A tool for asking questions about case law in Alaska.",
|
179 |
tool_args_schema = QueryCaselawArgs,
|
180 |
+
reranker = "chain", rerank_k = 100,
|
181 |
+
rerank_chain = [
|
182 |
+
{
|
183 |
+
"type": "slingshot",
|
184 |
+
"cutoff": 0.2
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"type": "mmr",
|
188 |
+
"diversity_bias": 0.2
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"type": "udf",
|
192 |
+
"user_function": "max(1000 * get('$.score') - hours(seconds(to_unix_timestamp(now()) - to_unix_timestamp(datetime_parse(get('$.document_metadata.decision_date'), 'yyyy-MM-dd')))) / 24 / 365, 0)"
|
193 |
+
}
|
194 |
+
],
|
195 |
n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
|
196 |
+
summary_num_results = 15,
|
197 |
vectara_summarizer = summarizer,
|
198 |
include_citations = False,
|
199 |
)
|
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.19
|