vectara-agentic 0.1.27__tar.gz → 0.1.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of vectara-agentic might be problematic. Click here for more details.
- {vectara_agentic-0.1.27/vectara_agentic.egg-info → vectara_agentic-0.1.28}/PKG-INFO +1 -1
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/_version.py +1 -1
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/tools.py +21 -7
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28/vectara_agentic.egg-info}/PKG-INFO +1 -1
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/LICENSE +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/MANIFEST.in +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/README.md +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/requirements.txt +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/setup.cfg +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/setup.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/tests/__init__.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/tests/test_agent.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/tests/test_tools.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/__init__.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/_callback.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/_observability.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/_prompts.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/agent.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/agent_config.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/agent_endpoint.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/db_tools.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/tools_catalog.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/types.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic/utils.py +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/SOURCES.txt +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/dependency_links.txt +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/requires.txt +0 -0
- {vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/top_level.txt +0 -0
|
@@ -127,7 +127,7 @@ class VectaraTool(FunctionTool):
|
|
|
127
127
|
break
|
|
128
128
|
return is_equal
|
|
129
129
|
|
|
130
|
-
def _build_filter_string(kwargs: Dict[str, Any], tool_args_type: Dict[str,
|
|
130
|
+
def _build_filter_string(kwargs: Dict[str, Any], tool_args_type: Dict[str, dict], fixed_filter: str) -> str:
|
|
131
131
|
"""
|
|
132
132
|
Build filter string for Vectara from kwargs
|
|
133
133
|
"""
|
|
@@ -141,7 +141,9 @@ def _build_filter_string(kwargs: Dict[str, Any], tool_args_type: Dict[str, str],
|
|
|
141
141
|
|
|
142
142
|
# Determine the prefix for the key. Valid values are "doc" or "part"
|
|
143
143
|
# default to 'doc' if not specified
|
|
144
|
-
|
|
144
|
+
tool_args_dict = tool_args_type.get(key, {'type': 'doc', 'is_list': False})
|
|
145
|
+
prefix = tool_args_dict.get(key, "doc")
|
|
146
|
+
is_list = tool_args_dict.get('is_list', False)
|
|
145
147
|
|
|
146
148
|
if prefix not in ["doc", "part"]:
|
|
147
149
|
raise ValueError(
|
|
@@ -231,14 +233,23 @@ def _build_filter_string(kwargs: Dict[str, Any], tool_args_type: Dict[str, str],
|
|
|
231
233
|
filter_parts.append(f"{prefix}.{key}{matched_operator}'{rhs}'")
|
|
232
234
|
else:
|
|
233
235
|
if val_str.isdigit() or is_float(val_str):
|
|
234
|
-
|
|
236
|
+
if is_list:
|
|
237
|
+
filter_parts.append(f"({val_str} IN {prefix}.{key})")
|
|
238
|
+
else:
|
|
239
|
+
filter_parts.append(f"{prefix}.{key}={val_str}")
|
|
235
240
|
elif val_str.lower() in ["true", "false"]:
|
|
236
241
|
# This is to handle boolean values.
|
|
237
242
|
# This is not complete solution - the best solution would be to test if the field is boolean
|
|
238
243
|
# That can be done after we move to APIv2
|
|
239
|
-
|
|
244
|
+
if is_list:
|
|
245
|
+
filter_parts.append(f"({val_str.lower()} IN {prefix}.{key})")
|
|
246
|
+
else:
|
|
247
|
+
filter_parts.append(f"{prefix}.{key}={val_str.lower()}")
|
|
240
248
|
else:
|
|
241
|
-
|
|
249
|
+
if is_list:
|
|
250
|
+
filter_parts.append(f"('{val_str}' IN {prefix}.{key})")
|
|
251
|
+
else:
|
|
252
|
+
filter_parts.append(f"{prefix}.{key}='{val_str}'")
|
|
242
253
|
|
|
243
254
|
filter_str = " AND ".join(filter_parts)
|
|
244
255
|
return f"({fixed_filter}) AND ({filter_str})" if fixed_filter else filter_str
|
|
@@ -415,7 +426,7 @@ class VectaraToolFactory:
|
|
|
415
426
|
tool_name: str,
|
|
416
427
|
tool_description: str,
|
|
417
428
|
tool_args_schema: type[BaseModel],
|
|
418
|
-
tool_args_type: Dict[str,
|
|
429
|
+
tool_args_type: Dict[str, dict] = {},
|
|
419
430
|
fixed_filter: str = "",
|
|
420
431
|
vectara_summarizer: str = "vectara-summary-ext-24-05-sml",
|
|
421
432
|
vectara_prompt_text: str = None,
|
|
@@ -440,7 +451,10 @@ class VectaraToolFactory:
|
|
|
440
451
|
tool_name (str): The name of the tool.
|
|
441
452
|
tool_description (str): The description of the tool.
|
|
442
453
|
tool_args_schema (BaseModel): The schema for the tool arguments.
|
|
443
|
-
tool_args_type (Dict[str,
|
|
454
|
+
tool_args_type (Dict[str, dict], optional): attributes for each argument where they key is the field name
|
|
455
|
+
and the value is a dictionary with the following keys:
|
|
456
|
+
- 'type': the type of each filter attribute in Vectara (doc or part).
|
|
457
|
+
- 'is_list': whether the filterable attribute is a list.
|
|
444
458
|
fixed_filter (str, optional): A fixed Vectara filter condition to apply to all queries.
|
|
445
459
|
vectara_summarizer (str, optional): The Vectara summarizer to use.
|
|
446
460
|
vectara_prompt_text (str, optional): The prompt text for the Vectara summarizer.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vectara_agentic-0.1.27 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|