vectara-agentic 0.1.26__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.

Files changed (28) hide show
  1. {vectara_agentic-0.1.26/vectara_agentic.egg-info → vectara_agentic-0.1.28}/PKG-INFO +1 -1
  2. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/_version.py +1 -1
  3. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/agent.py +2 -1
  4. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/tools.py +22 -7
  5. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28/vectara_agentic.egg-info}/PKG-INFO +1 -1
  6. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/LICENSE +0 -0
  7. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/MANIFEST.in +0 -0
  8. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/README.md +0 -0
  9. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/requirements.txt +0 -0
  10. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/setup.cfg +0 -0
  11. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/setup.py +0 -0
  12. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/tests/__init__.py +0 -0
  13. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/tests/test_agent.py +0 -0
  14. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/tests/test_tools.py +0 -0
  15. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/__init__.py +0 -0
  16. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/_callback.py +0 -0
  17. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/_observability.py +0 -0
  18. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/_prompts.py +0 -0
  19. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/agent_config.py +0 -0
  20. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/agent_endpoint.py +0 -0
  21. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/db_tools.py +0 -0
  22. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/tools_catalog.py +0 -0
  23. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/types.py +0 -0
  24. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic/utils.py +0 -0
  25. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/SOURCES.txt +0 -0
  26. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/dependency_links.txt +0 -0
  27. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/requires.txt +0 -0
  28. {vectara_agentic-0.1.26 → vectara_agentic-0.1.28}/vectara_agentic.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: vectara_agentic
3
- Version: 0.1.26
3
+ Version: 0.1.28
4
4
  Summary: A Python package for creating AI Assistants and AI Agents with Vectara
5
5
  Home-page: https://github.com/vectara/py-vectara-agentic
6
6
  Author: Ofer Mendelevitch
@@ -1,4 +1,4 @@
1
1
  """
2
2
  Define the version of the package.
3
3
  """
4
- __version__ = "0.1.26"
4
+ __version__ = "0.1.28"
@@ -363,7 +363,8 @@ class Agent:
363
363
  lambda_val=vectara_lambda_val,
364
364
  summary_num_results=vectara_summary_num_results,
365
365
  vectara_summarizer=vectara_summarizer,
366
- include_citations=False,
366
+ include_citations=True,
367
+ verbose=verbose,
367
368
  )
368
369
 
369
370
  assistant_instructions = f"""
@@ -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, str], fixed_filter: str) -> 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
- prefix = tool_args_type.get(key, "doc")
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
- filter_parts.append(f"{prefix}.{key}={val_str}")
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
- filter_parts.append(f"{prefix}.{key}={val_str.lower()}")
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
- filter_parts.append(f"{prefix}.{key}='{val_str}'")
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, 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, str], optional): The type of each argument (doc or part).
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.
@@ -499,6 +513,7 @@ class VectaraToolFactory:
499
513
 
500
514
  vectara_query_engine = vectara.as_query_engine(
501
515
  summary_enabled=True,
516
+ similarity_top_k=summary_num_results,
502
517
  summary_num_results=summary_num_results,
503
518
  summary_response_lang=summary_response_lang,
504
519
  summary_prompt_name=vectara_summarizer,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: vectara_agentic
3
- Version: 0.1.26
3
+ Version: 0.1.28
4
4
  Summary: A Python package for creating AI Assistants and AI Agents with Vectara
5
5
  Home-page: https://github.com/vectara/py-vectara-agentic
6
6
  Author: Ofer Mendelevitch