vectara-agentic 0.1.9__tar.gz → 0.1.10__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 (22) hide show
  1. {vectara_agentic-0.1.9/vectara_agentic.egg-info → vectara_agentic-0.1.10}/PKG-INFO +9 -2
  2. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/README.md +6 -0
  3. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/requirements.txt +2 -1
  4. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/setup.py +1 -1
  5. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/tests/test_agent.py +14 -0
  6. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/tests/test_tools.py +20 -0
  7. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/__init__.py +1 -1
  8. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/agent.py +171 -9
  9. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/tools.py +26 -6
  10. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10/vectara_agentic.egg-info}/PKG-INFO +9 -2
  11. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic.egg-info/requires.txt +2 -1
  12. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/LICENSE +0 -0
  13. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/MANIFEST.in +0 -0
  14. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/setup.cfg +0 -0
  15. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/_callback.py +0 -0
  16. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/_prompts.py +0 -0
  17. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/tools_catalog.py +0 -0
  18. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/types.py +0 -0
  19. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic/utils.py +0 -0
  20. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic.egg-info/SOURCES.txt +0 -0
  21. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic.egg-info/dependency_links.txt +0 -0
  22. {vectara_agentic-0.1.9 → vectara_agentic-0.1.10}/vectara_agentic.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectara_agentic
3
- Version: 0.1.9
3
+ Version: 0.1.10
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
@@ -34,9 +34,10 @@ Requires-Dist: llama-index-tools-tavily_research==0.2.0
34
34
  Requires-Dist: llama-index-callbacks-arize-phoenix==0.2.1
35
35
  Requires-Dist: pydantic==2.8.2
36
36
  Requires-Dist: retrying==1.3.4
37
- Requires-Dist: pymongo==4.6.1
37
+ Requires-Dist: pymongo==4.6.3
38
38
  Requires-Dist: python-dotenv==1.0.1
39
39
  Requires-Dist: tiktoken==0.7.0
40
+ Requires-Dist: dill==0.3.8
40
41
 
41
42
  # vectara-agentic
42
43
 
@@ -98,6 +99,8 @@ query_financial_reports = vec_factory.create_rag_tool(
98
99
  )
99
100
  ```
100
101
 
102
+ Note that `VECTARA_CORPUS_ID` can be a single ID or a comma-separated list of IDs.
103
+
101
104
  2. **Create other tools (optional)**
102
105
 
103
106
  In addition to RAG tools, you can generate a lot of other types of tools the agent can use. These could be mathematical tools, tools
@@ -182,6 +185,10 @@ The `Agent` class defines a few helpful methods to help you understand the inter
182
185
  * The `report()` method prints out the agent object’s type, the tools, and the LLMs used for the main agent and tool calling.
183
186
  * The `token_counts()` method tells you how many tokens you have used in the current session for both the main agent and tool calling LLMs. This can be helpful if you want to track spend by token.
184
187
 
188
+ ## Serialization
189
+
190
+ The `Agent` class supports serialization. Use the `dumps()` to serialize and `loads()` to read back from a serialized stream.
191
+
185
192
  ## Observability
186
193
 
187
194
  vectara-agentic supports observability via the existing integration of LlamaIndex and Arize Phoenix.
@@ -58,6 +58,8 @@ query_financial_reports = vec_factory.create_rag_tool(
58
58
  )
59
59
  ```
60
60
 
61
+ Note that `VECTARA_CORPUS_ID` can be a single ID or a comma-separated list of IDs.
62
+
61
63
  2. **Create other tools (optional)**
62
64
 
63
65
  In addition to RAG tools, you can generate a lot of other types of tools the agent can use. These could be mathematical tools, tools
@@ -142,6 +144,10 @@ The `Agent` class defines a few helpful methods to help you understand the inter
142
144
  * The `report()` method prints out the agent object’s type, the tools, and the LLMs used for the main agent and tool calling.
143
145
  * The `token_counts()` method tells you how many tokens you have used in the current session for both the main agent and tool calling LLMs. This can be helpful if you want to track spend by token.
144
146
 
147
+ ## Serialization
148
+
149
+ The `Agent` class supports serialization. Use the `dumps()` to serialize and `loads()` to read back from a serialized stream.
150
+
145
151
  ## Observability
146
152
 
147
153
  vectara-agentic supports observability via the existing integration of LlamaIndex and Arize Phoenix.
@@ -16,6 +16,7 @@ llama-index-tools-tavily_research==0.2.0
16
16
  llama-index-callbacks-arize-phoenix==0.2.1
17
17
  pydantic==2.8.2
18
18
  retrying==1.3.4
19
- pymongo==4.6.1
19
+ pymongo==4.6.3
20
20
  python-dotenv==1.0.1
21
21
  tiktoken==0.7.0
22
+ dill==0.3.8
@@ -8,7 +8,7 @@ def read_requirements():
8
8
 
9
9
  setup(
10
10
  name="vectara_agentic",
11
- version="0.1.9",
11
+ version="0.1.10",
12
12
  author="Ofer Mendelevitch",
13
13
  author_email="ofer@vectara.com",
14
14
  description="A Python package for creating AI Assistants and AI Agents with Vectara",
@@ -56,6 +56,20 @@ class TestAgentPackage(unittest.TestCase):
56
56
  self.assertIsInstance(agent, Agent)
57
57
  self.assertEqual(agent._topic, "question answering")
58
58
 
59
+ def test_serialization(self):
60
+ agent = Agent.from_corpus(
61
+ tool_name="RAG Tool",
62
+ vectara_customer_id="4584783",
63
+ vectara_corpus_id="4",
64
+ vectara_api_key="api_key",
65
+ data_description="information",
66
+ assistant_specialty="question answering",
67
+ )
68
+
69
+ agent_reloaded = agent.loads(agent.dumps())
70
+ self.assertIsInstance(agent_reloaded, Agent)
71
+ self.assertEqual(agent, agent_reloaded)
72
+
59
73
 
60
74
  if __name__ == "__main__":
61
75
  unittest.main()
@@ -1,6 +1,7 @@
1
1
  import unittest
2
2
 
3
3
  from vectara_agentic.tools import VectaraTool, VectaraToolFactory, ToolsFactory, ToolType
4
+ from vectara_agentic.agent import Agent
4
5
  from pydantic import Field, BaseModel
5
6
  from llama_index.core.tools import FunctionTool
6
7
 
@@ -57,6 +58,25 @@ class TestToolsPackage(unittest.TestCase):
57
58
  self.assertIsInstance(arxiv_tool, FunctionTool)
58
59
  self.assertEqual(arxiv_tool.tool_type, ToolType.QUERY)
59
60
 
61
+ def test_public_repo(self):
62
+ vectara_customer_id = "1366999410"
63
+ vectara_corpus_id = "1"
64
+ vectara_api_key = "zqt_UXrBcnI2UXINZkrv4g1tQPhzj02vfdtqYJIDiA"
65
+
66
+ class QueryToolArgs(BaseModel):
67
+ query: str = Field(description="The user query")
68
+
69
+ agent = Agent.from_corpus(
70
+ vectara_customer_id=vectara_customer_id,
71
+ vectara_corpus_id=vectara_corpus_id,
72
+ vectara_api_key=vectara_api_key,
73
+ tool_name="ask_vectara",
74
+ data_description="data from Vectara website",
75
+ assistant_specialty="RAG as a service",
76
+ vectara_summarizer="mockingbird-1.0-2024-07-16"
77
+ )
78
+
79
+ self.assertContains(agent.chat("What is Vectara?"), "Vectara is an end-to-end platform")
60
80
 
61
81
  if __name__ == "__main__":
62
82
  unittest.main()
@@ -3,7 +3,7 @@ vectara_agentic package.
3
3
  """
4
4
 
5
5
  # Define the package version
6
- __version__ = "0.1.9"
6
+ __version__ = "0.1.10"
7
7
 
8
8
  # Import classes and functions from modules
9
9
  # from .module1 import Class1, function1
@@ -1,10 +1,12 @@
1
1
  """
2
2
  This module contains the Agent class for handling different types of agents and their interactions.
3
3
  """
4
- from typing import List, Callable, Optional
4
+ from typing import List, Callable, Optional, Dict, Any
5
5
  import os
6
6
  from datetime import date
7
7
  import time
8
+ import json
9
+ import dill
8
10
 
9
11
  import logging
10
12
  logger = logging.getLogger('opentelemetry.exporter.otlp.proto.http.trace_exporter')
@@ -22,16 +24,18 @@ from llama_index.core.callbacks.base_handler import BaseCallbackHandler
22
24
  from llama_index.agent.openai import OpenAIAgent
23
25
  from llama_index.core.memory import ChatMemoryBuffer
24
26
  from llama_index.core import set_global_handler
27
+ from llama_index.core.tools.types import ToolMetadata
25
28
 
26
29
  import phoenix as px
27
30
 
28
31
  from dotenv import load_dotenv
29
32
 
30
- from .types import AgentType, AgentStatusType, LLMRole, ObserverType
33
+ from .types import AgentType, AgentStatusType, LLMRole, ObserverType, ToolType
31
34
  from .utils import get_llm, get_tokenizer_for_model
32
35
  from ._prompts import REACT_PROMPT_TEMPLATE, GENERAL_PROMPT_TEMPLATE
33
36
  from ._callback import AgentCallbackHandler
34
- from .tools import VectaraToolFactory
37
+ from .tools import VectaraToolFactory, VectaraTool
38
+
35
39
 
36
40
  load_dotenv(override=True)
37
41
 
@@ -67,7 +71,6 @@ class Agent:
67
71
  """
68
72
  Agent class for handling different types of agents and their interactions.
69
73
  """
70
-
71
74
  def __init__(
72
75
  self,
73
76
  tools: list[FunctionTool],
@@ -75,6 +78,7 @@ class Agent:
75
78
  custom_instructions: str = "",
76
79
  verbose: bool = True,
77
80
  update_func: Optional[Callable[[AgentStatusType, str], None]] = None,
81
+ agent_type: AgentType = AgentType(os.getenv("VECTARA_AGENTIC_AGENT_TYPE", "OPENAI")),
78
82
  ) -> None:
79
83
  """
80
84
  Initialize the agent with the specified type, tools, topic, and system message.
@@ -87,7 +91,7 @@ class Agent:
87
91
  verbose (bool, optional): Whether the agent should print its steps. Defaults to True.
88
92
  update_func (Callable): A callback function the code calls on any agent updates.
89
93
  """
90
- self.agent_type = AgentType(os.getenv("VECTARA_AGENTIC_AGENT_TYPE", "OPENAI"))
94
+ self.agent_type = agent_type
91
95
  self.tools = tools
92
96
  self.llm = get_llm(LLMRole.MAIN)
93
97
  self._custom_instructions = custom_instructions
@@ -152,6 +156,45 @@ class Agent:
152
156
  else:
153
157
  print("No observer set.")
154
158
 
159
+ def __eq__(self, other):
160
+ if not isinstance(other, Agent):
161
+ print(f"Comparison failed: other is not an instance of Agent. (self: {type(self)}, other: {type(other)})")
162
+ return False
163
+
164
+ # Compare agent_type
165
+ if self.agent_type != other.agent_type:
166
+ print(f"Comparison failed: agent_type differs. (self.agent_type: {self.agent_type}, other.agent_type: {other.agent_type})")
167
+ return False
168
+
169
+ # Compare tools
170
+ if self.tools != other.tools:
171
+ print(f"Comparison failed: tools differ. (self.tools: {self.tools}, other.tools: {other.tools})")
172
+ return False
173
+
174
+ # Compare topic
175
+ if self._topic != other._topic:
176
+ print(f"Comparison failed: topic differs. (self.topic: {self._topic}, other.topic: {other._topic})")
177
+ return False
178
+
179
+ # Compare custom_instructions
180
+ if self._custom_instructions != other._custom_instructions:
181
+ print(f"Comparison failed: custom_instructions differ. (self.custom_instructions: {self._custom_instructions}, other.custom_instructions: {other._custom_instructions})")
182
+ return False
183
+
184
+ # Compare verbose
185
+ if self.verbose != other.verbose:
186
+ print(f"Comparison failed: verbose differs. (self.verbose: {self.verbose}, other.verbose: {other.verbose})")
187
+ return False
188
+
189
+ # Compare agent
190
+ if self.agent.memory.chat_store != other.agent.memory.chat_store:
191
+ print(f"Comparison failed: agent memory differs. (self.agent: {repr(self.agent.memory.chat_store)}, other.agent: {repr(other.agent.memory.chat_store)})")
192
+ return False
193
+
194
+ # If all comparisons pass
195
+ print("All comparisons passed. Objects are equal.")
196
+ return True
197
+
155
198
  @classmethod
156
199
  def from_tools(
157
200
  cls,
@@ -203,12 +246,12 @@ class Agent:
203
246
  Args:
204
247
  tool_name (str): The name of Vectara tool used by the agent
205
248
  vectara_customer_id (str): The Vectara customer ID.
206
- vectara_corpus_id (str): The Vectara corpus ID.
249
+ vectara_corpus_id (str): The Vectara corpus ID (or comma separated list of IDs).
207
250
  vectara_api_key (str): The Vectara API key.
208
251
  data_description (str): The description of the data.
209
252
  assistant_specialty (str): The specialty of the assistant.
210
253
  verbose (bool, optional): Whether to print verbose output.
211
- vectara_filter_fields (List[dict], optional): The filterable attributes (each dict includes name, type, and description).
254
+ vectara_filter_fields (List[dict], optional): The filterable attributes (each dict maps field name to Tuple[type, description]).
212
255
  vectara_lambda_val (float, optional): The lambda value for Vectara hybrid search.
213
256
  vectara_reranker (str, optional): The Vectara reranker name (default "mmr")
214
257
  vectara_rerank_k (int, optional): The number of results to use with reranking.
@@ -224,9 +267,10 @@ class Agent:
224
267
  vectara_customer_id=vectara_customer_id,
225
268
  vectara_corpus_id=vectara_corpus_id)
226
269
  field_definitions = {}
227
- field_definitions['query'] = (str, Field(description="The user query"))
270
+ field_definitions['query'] = (str, Field(description="The user query")) # type: ignore
228
271
  for field in vectara_filter_fields:
229
- field_definitions[field['name']] = (eval(field['type']), Field(description=field['description'], default=None)) # type: ignore
272
+ field_definitions[field['name']] = (eval(field['type']),
273
+ Field(description=field['description'])) # type: ignore
230
274
  QueryArgs = create_model( # type: ignore
231
275
  "QueryArgs",
232
276
  **field_definitions
@@ -315,3 +359,121 @@ class Agent:
315
359
  except Exception as e:
316
360
  import traceback
317
361
  return f"Vectara Agentic: encountered an exception ({e}) at ({traceback.format_exc()}), and can't respond."
362
+
363
+ # Serialization methods
364
+
365
+ def to_dict(self) -> Dict[str, Any]:
366
+ """Serialize the Agent instance to a dictionary."""
367
+ tool_info = []
368
+
369
+ for tool in self.tools:
370
+ tool_dict = {
371
+ "tool_type": tool.tool_type.value,
372
+ "name": tool._metadata.name,
373
+ "description": tool._metadata.description,
374
+ "fn": dill.dumps(tool.fn).decode('latin-1') if tool.fn else None, # Serialize fn
375
+ "async_fn": dill.dumps(tool.async_fn).decode('latin-1') if tool.async_fn else None, # Serialize async_fn
376
+ }
377
+ tool_info.append(tool_dict)
378
+
379
+ return {
380
+ "agent_type": self.agent_type.value,
381
+ "tools": tool_info,
382
+ "topic": self._topic,
383
+ "custom_instructions": self._custom_instructions,
384
+ "verbose": self.verbose,
385
+ }
386
+
387
+
388
+ def dumps(self) -> str:
389
+ """Serialize the Agent instance to a JSON string."""
390
+ return json.dumps(self.to_dict())
391
+
392
+ @classmethod
393
+ def loads(cls, data: str) -> "Agent":
394
+ """Create an Agent instance from a JSON string."""
395
+ return cls.from_dict(json.loads(data))
396
+
397
+
398
+ def to_dict(self) -> Dict[str, Any]:
399
+ """Serialize the Agent instance to a dictionary."""
400
+ tool_info = []
401
+
402
+ for tool in self.tools:
403
+ # Serialize each tool's metadata, function, and dynamic model schema (QueryArgs)
404
+ tool_dict = {
405
+ "tool_type": tool.tool_type.value,
406
+ "name": tool._metadata.name,
407
+ "description": tool._metadata.description,
408
+ "fn": dill.dumps(tool.fn).decode('latin-1') if tool.fn else None, # Serialize fn
409
+ "async_fn": dill.dumps(tool.async_fn).decode('latin-1') if tool.async_fn else None, # Serialize async_fn
410
+ "fn_schema": tool._metadata.fn_schema.model_json_schema() if hasattr(tool._metadata, 'fn_schema') else None, # Serialize schema if available
411
+ }
412
+ tool_info.append(tool_dict)
413
+
414
+ return {
415
+ "agent_type": self.agent_type.value,
416
+ "memory": dill.dumps(self.agent.memory).decode('latin-1'),
417
+ "tools": tool_info,
418
+ "topic": self._topic,
419
+ "custom_instructions": self._custom_instructions,
420
+ "verbose": self.verbose,
421
+ }
422
+
423
+ @classmethod
424
+ def from_dict(cls, data: Dict[str, Any]) -> "Agent":
425
+ """Create an Agent instance from a dictionary."""
426
+ agent_type = AgentType(data["agent_type"])
427
+ tools = []
428
+
429
+ JSON_TYPE_TO_PYTHON = {
430
+ "string": "str",
431
+ "integer": "int",
432
+ "boolean": "bool",
433
+ "array": "list",
434
+ "object": "dict",
435
+ "number": "float",
436
+ }
437
+
438
+ for tool_data in data["tools"]:
439
+ # Recreate the dynamic model using the schema info
440
+ if tool_data.get("fn_schema"):
441
+ field_definitions = {}
442
+ for field,values in tool_data["fn_schema"]["properties"].items():
443
+ if 'default' in values:
444
+ field_definitions[field] = (eval(JSON_TYPE_TO_PYTHON.get(values['type'], values['type'])),
445
+ Field(description=values['description'], default=values['default'])) # type: ignore
446
+ else:
447
+ field_definitions[field] = (eval(JSON_TYPE_TO_PYTHON.get(values['type'], values['type'])),
448
+ Field(description=values['description'])) # type: ignore
449
+ query_args_model = create_model( # type: ignore
450
+ "QueryArgs",
451
+ **field_definitions
452
+ )
453
+ else:
454
+ query_args_model = create_model("QueryArgs")
455
+
456
+ fn = dill.loads(tool_data["fn"].encode('latin-1')) if tool_data["fn"] else None
457
+ async_fn = dill.loads(tool_data["async_fn"].encode('latin-1')) if tool_data["async_fn"] else None
458
+
459
+ tool = VectaraTool.from_defaults(
460
+ tool_type=ToolType(tool_data["tool_type"]),
461
+ name=tool_data["name"],
462
+ description=tool_data["description"],
463
+ fn=fn,
464
+ async_fn=async_fn,
465
+ fn_schema=query_args_model # Re-assign the recreated dynamic model
466
+ )
467
+ tools.append(tool)
468
+
469
+ agent = cls(
470
+ tools=tools,
471
+ agent_type=agent_type,
472
+ topic=data["topic"],
473
+ custom_instructions=data["custom_instructions"],
474
+ verbose=data["verbose"],
475
+ )
476
+ memory = dill.loads(data["memory"].encode('latin-1')) if data.get("memory") else None
477
+ if memory:
478
+ agent.agent.memory = memory
479
+ return agent
@@ -81,12 +81,31 @@ class VectaraTool(FunctionTool):
81
81
  tool = FunctionTool.from_defaults(fn, name, description, return_direct, fn_schema, async_fn, tool_metadata)
82
82
  vectara_tool = cls(
83
83
  tool_type=tool_type,
84
- fn=tool.fn,
85
- metadata=tool.metadata,
86
- async_fn=tool.async_fn
84
+ fn=tool._fn,
85
+ metadata=tool._metadata,
86
+ async_fn=tool._async_fn
87
87
  )
88
88
  return vectara_tool
89
89
 
90
+ def __eq__(self, other):
91
+ if self.tool_type != other.tool_type:
92
+ return False
93
+
94
+ # Check if fn_schema is an instance of a BaseModel or a class itself (metaclass)
95
+ self_schema_dict = self.metadata.fn_schema.model_fields
96
+ other_schema_dict = other.metadata.fn_schema.model_fields
97
+ is_equal = True
98
+ for key in self_schema_dict.keys():
99
+ if key not in other_schema_dict:
100
+ is_equal = False
101
+ break
102
+ if (self_schema_dict[key].annotation != other_schema_dict[key].annotation or
103
+ self_schema_dict[key].description != other_schema_dict[key].description or
104
+ self_schema_dict[key].is_required() != other_schema_dict[key].is_required()):
105
+ is_equal = False
106
+ break
107
+ return is_equal
108
+
90
109
 
91
110
  class VectaraToolFactory:
92
111
  """
@@ -103,12 +122,13 @@ class VectaraToolFactory:
103
122
  Initialize the VectaraToolFactory
104
123
  Args:
105
124
  vectara_customer_id (str): The Vectara customer ID.
106
- vectara_corpus_id (str): The Vectara corpus ID.
125
+ vectara_corpus_id (str): The Vectara corpus ID (or comma separated list of IDs).
107
126
  vectara_api_key (str): The Vectara API key.
108
127
  """
109
128
  self.vectara_customer_id = vectara_customer_id
110
129
  self.vectara_corpus_id = vectara_corpus_id
111
130
  self.vectara_api_key = vectara_api_key
131
+ self.num_corpora = len(vectara_corpus_id.split(","))
112
132
 
113
133
  def create_rag_tool(
114
134
  self,
@@ -188,7 +208,7 @@ class VectaraToolFactory:
188
208
  summary_response_lang=summary_response_lang,
189
209
  summary_prompt_name=vectara_summarizer,
190
210
  reranker=reranker,
191
- rerank_k=rerank_k,
211
+ rerank_k=rerank_k if rerank_k*self.num_corpora<=100 else int(100/self.num_corpora),
192
212
  mmr_diversity_bias=mmr_diversity_bias,
193
213
  n_sentence_before=n_sentences_before,
194
214
  n_sentence_after=n_sentences_after,
@@ -255,7 +275,7 @@ class VectaraToolFactory:
255
275
  )
256
276
  return out
257
277
 
258
- fields = tool_args_schema.__fields__
278
+ fields = tool_args_schema.model_fields
259
279
  params = [
260
280
  inspect.Parameter(
261
281
  name=field_name,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectara_agentic
3
- Version: 0.1.9
3
+ Version: 0.1.10
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
@@ -34,9 +34,10 @@ Requires-Dist: llama-index-tools-tavily_research==0.2.0
34
34
  Requires-Dist: llama-index-callbacks-arize-phoenix==0.2.1
35
35
  Requires-Dist: pydantic==2.8.2
36
36
  Requires-Dist: retrying==1.3.4
37
- Requires-Dist: pymongo==4.6.1
37
+ Requires-Dist: pymongo==4.6.3
38
38
  Requires-Dist: python-dotenv==1.0.1
39
39
  Requires-Dist: tiktoken==0.7.0
40
+ Requires-Dist: dill==0.3.8
40
41
 
41
42
  # vectara-agentic
42
43
 
@@ -98,6 +99,8 @@ query_financial_reports = vec_factory.create_rag_tool(
98
99
  )
99
100
  ```
100
101
 
102
+ Note that `VECTARA_CORPUS_ID` can be a single ID or a comma-separated list of IDs.
103
+
101
104
  2. **Create other tools (optional)**
102
105
 
103
106
  In addition to RAG tools, you can generate a lot of other types of tools the agent can use. These could be mathematical tools, tools
@@ -182,6 +185,10 @@ The `Agent` class defines a few helpful methods to help you understand the inter
182
185
  * The `report()` method prints out the agent object’s type, the tools, and the LLMs used for the main agent and tool calling.
183
186
  * The `token_counts()` method tells you how many tokens you have used in the current session for both the main agent and tool calling LLMs. This can be helpful if you want to track spend by token.
184
187
 
188
+ ## Serialization
189
+
190
+ The `Agent` class supports serialization. Use the `dumps()` to serialize and `loads()` to read back from a serialized stream.
191
+
185
192
  ## Observability
186
193
 
187
194
  vectara-agentic supports observability via the existing integration of LlamaIndex and Arize Phoenix.
@@ -16,6 +16,7 @@ llama-index-tools-tavily_research==0.2.0
16
16
  llama-index-callbacks-arize-phoenix==0.2.1
17
17
  pydantic==2.8.2
18
18
  retrying==1.3.4
19
- pymongo==4.6.1
19
+ pymongo==4.6.3
20
20
  python-dotenv==1.0.1
21
21
  tiktoken==0.7.0
22
+ dill==0.3.8