vectara-agentic 0.2.15__py3-none-any.whl → 0.2.17__py3-none-any.whl
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.
- tests/test_agent.py +2 -2
- tests/test_agent_planning.py +1 -1
- tests/test_groq.py +3 -1
- tests/test_tools.py +119 -17
- tests/test_workflow.py +67 -0
- vectara_agentic/_observability.py +1 -1
- vectara_agentic/_prompts.py +4 -2
- vectara_agentic/_version.py +1 -1
- vectara_agentic/agent.py +147 -69
- vectara_agentic/db_tools.py +2 -2
- vectara_agentic/llm_utils.py +10 -6
- vectara_agentic/sub_query_workflow.py +5 -2
- vectara_agentic/tool_utils.py +112 -84
- vectara_agentic/tools.py +3 -1
- vectara_agentic/tools_catalog.py +1 -0
- vectara_agentic/utils.py +1 -1
- {vectara_agentic-0.2.15.dist-info → vectara_agentic-0.2.17.dist-info}/METADATA +62 -19
- vectara_agentic-0.2.17.dist-info/RECORD +34 -0
- {vectara_agentic-0.2.15.dist-info → vectara_agentic-0.2.17.dist-info}/WHEEL +1 -1
- vectara_agentic-0.2.15.dist-info/RECORD +0 -34
- {vectara_agentic-0.2.15.dist-info → vectara_agentic-0.2.17.dist-info}/licenses/LICENSE +0 -0
- {vectara_agentic-0.2.15.dist-info → vectara_agentic-0.2.17.dist-info}/top_level.txt +0 -0
vectara_agentic/tool_utils.py
CHANGED
|
@@ -7,7 +7,7 @@ import re
|
|
|
7
7
|
|
|
8
8
|
from typing import (
|
|
9
9
|
Callable, List, Dict, Any, Optional, Union, Type, Tuple,
|
|
10
|
-
Sequence
|
|
10
|
+
Sequence, get_origin, get_args
|
|
11
11
|
)
|
|
12
12
|
from pydantic import BaseModel, create_model
|
|
13
13
|
from pydantic_core import PydanticUndefined
|
|
@@ -112,6 +112,7 @@ class VectaraTool(FunctionTool):
|
|
|
112
112
|
tool_metadata: Optional[ToolMetadata] = None,
|
|
113
113
|
callback: Optional[Callable[[Any], Any]] = None,
|
|
114
114
|
async_callback: Optional[AsyncCallable] = None,
|
|
115
|
+
partial_params: Optional[Dict[str, Any]] = None,
|
|
115
116
|
tool_type: ToolType = ToolType.QUERY,
|
|
116
117
|
) -> "VectaraTool":
|
|
117
118
|
tool = FunctionTool.from_defaults(
|
|
@@ -124,6 +125,7 @@ class VectaraTool(FunctionTool):
|
|
|
124
125
|
tool_metadata,
|
|
125
126
|
callback,
|
|
126
127
|
async_callback,
|
|
128
|
+
partial_params
|
|
127
129
|
)
|
|
128
130
|
vectara_tool = cls(
|
|
129
131
|
tool_type=tool_type,
|
|
@@ -140,37 +142,20 @@ class VectaraTool(FunctionTool):
|
|
|
140
142
|
return str(self)
|
|
141
143
|
|
|
142
144
|
def __eq__(self, other):
|
|
143
|
-
if not isinstance(other, VectaraTool):
|
|
144
|
-
return False
|
|
145
|
-
|
|
146
|
-
if self.metadata.tool_type != other.metadata.tool_type:
|
|
147
|
-
return False
|
|
148
|
-
|
|
149
|
-
if self.metadata.name != other.metadata.name:
|
|
150
|
-
return False
|
|
151
|
-
|
|
152
|
-
# If schema is a dict-like object, compare the dict representation
|
|
153
145
|
try:
|
|
154
146
|
# Try to get schema as dict if possible
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
other_schema = other.metadata.fn_schema.schema
|
|
158
|
-
|
|
159
|
-
# Compare only properties and required fields
|
|
160
|
-
self_props = self_schema.get("properties", {})
|
|
161
|
-
other_props = other_schema.get("properties", {})
|
|
162
|
-
|
|
163
|
-
self_required = self_schema.get("required", [])
|
|
164
|
-
other_required = other_schema.get("required", [])
|
|
165
|
-
|
|
166
|
-
return self_props.keys() == other_props.keys() and set(
|
|
167
|
-
self_required
|
|
168
|
-
) == set(other_required)
|
|
147
|
+
self_schema = self.metadata.fn_schema.model_json_schema()
|
|
148
|
+
other_schema = other.metadata.fn_schema.model_json_schema()
|
|
169
149
|
except Exception:
|
|
170
|
-
|
|
171
|
-
pass
|
|
150
|
+
return False
|
|
172
151
|
|
|
173
|
-
|
|
152
|
+
is_equal = (
|
|
153
|
+
isinstance(other, VectaraTool)
|
|
154
|
+
and self.metadata.tool_type == other.metadata.tool_type
|
|
155
|
+
and self.metadata.name == other.metadata.name
|
|
156
|
+
and self_schema == other_schema
|
|
157
|
+
)
|
|
158
|
+
return is_equal
|
|
174
159
|
|
|
175
160
|
def call(
|
|
176
161
|
self, *args: Any, ctx: Optional[Context] = None, **kwargs: Any
|
|
@@ -185,7 +170,7 @@ class VectaraTool(FunctionTool):
|
|
|
185
170
|
err_output = ToolOutput(
|
|
186
171
|
tool_name=self.metadata.name,
|
|
187
172
|
content=(
|
|
188
|
-
f"Wrong argument used when calling {self.metadata.name}: {str(e)}.
|
|
173
|
+
f"Wrong argument used when calling {self.metadata.name}: {str(e)}."
|
|
189
174
|
f"Valid arguments: {params_str}. please call the tool again with the correct arguments."
|
|
190
175
|
),
|
|
191
176
|
raw_input={"args": args, "kwargs": kwargs},
|
|
@@ -222,9 +207,10 @@ class VectaraTool(FunctionTool):
|
|
|
222
207
|
)
|
|
223
208
|
return err_output
|
|
224
209
|
except Exception as e:
|
|
210
|
+
import traceback
|
|
225
211
|
err_output = ToolOutput(
|
|
226
212
|
tool_name=self.metadata.name,
|
|
227
|
-
content=f"Tool {self.metadata.name} Malfunction: {str(e)}",
|
|
213
|
+
content=f"Tool {self.metadata.name} Malfunction: {str(e)}, traceback: {traceback.format_exc()}",
|
|
228
214
|
raw_input={"args": args, "kwargs": kwargs},
|
|
229
215
|
raw_output={"response": str(e)},
|
|
230
216
|
)
|
|
@@ -234,13 +220,36 @@ class VectaraTool(FunctionTool):
|
|
|
234
220
|
class EmptyBaseModel(BaseModel):
|
|
235
221
|
"""empty base model"""
|
|
236
222
|
|
|
237
|
-
def
|
|
238
|
-
|
|
239
|
-
|
|
223
|
+
def _clean_type_repr(type_repr: str) -> str:
|
|
224
|
+
"""Cleans the string representation of a type."""
|
|
225
|
+
# Replace <class 'somename'> with somename
|
|
226
|
+
match = re.match(r"<class '(\w+)'>", type_repr)
|
|
227
|
+
if match:
|
|
228
|
+
type_repr = match.group(1)
|
|
240
229
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
type_repr = type_repr.replace("typing.", "")
|
|
231
|
+
return type_repr
|
|
232
|
+
|
|
233
|
+
def _format_type(annotation) -> str:
|
|
234
|
+
"""
|
|
235
|
+
Turn things like Union[int, str, NoneType] into 'int | str | None',
|
|
236
|
+
and replace any leftover 'NoneType' → 'None'.
|
|
237
|
+
"""
|
|
238
|
+
origin = get_origin(annotation)
|
|
239
|
+
if origin is Union:
|
|
240
|
+
parts = []
|
|
241
|
+
for arg in get_args(annotation):
|
|
242
|
+
if arg is type(None):
|
|
243
|
+
parts.append("None")
|
|
244
|
+
else:
|
|
245
|
+
# recurse in case of nested unions
|
|
246
|
+
parts.append(_format_type(arg))
|
|
247
|
+
return " | ".join(parts)
|
|
248
|
+
|
|
249
|
+
# Fallback
|
|
250
|
+
type_repr = str(annotation)
|
|
251
|
+
type_repr = _clean_type_repr(type_repr)
|
|
252
|
+
return type_repr.replace("NoneType", "None")
|
|
244
253
|
|
|
245
254
|
def _make_docstring(
|
|
246
255
|
function: Callable[..., ToolOutput],
|
|
@@ -250,46 +259,68 @@ def _make_docstring(
|
|
|
250
259
|
all_params: List[inspect.Parameter],
|
|
251
260
|
compact_docstring: bool,
|
|
252
261
|
) -> str:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
262
|
+
"""
|
|
263
|
+
Generates a docstring for a function based on its signature, description,
|
|
264
|
+
and Pydantic schema, correctly handling complex type annotations.
|
|
265
|
+
|
|
266
|
+
Args:
|
|
267
|
+
function: The function for which to generate the docstring.
|
|
268
|
+
tool_name: The desired name for the tool/function in the docstring.
|
|
269
|
+
tool_description: The main description of the tool/function.
|
|
270
|
+
fn_schema: The Pydantic model representing the function's arguments schema.
|
|
271
|
+
all_params: A list of inspect.Parameter objects for the function signature.
|
|
272
|
+
compact_docstring: If True, omits the signature line in the main description.
|
|
273
|
+
|
|
274
|
+
Returns:
|
|
275
|
+
A formatted docstring string.
|
|
276
|
+
"""
|
|
277
|
+
params_str_parts = []
|
|
278
|
+
for p in all_params:
|
|
279
|
+
type_repr = _format_type(p.annotation)
|
|
280
|
+
params_str_parts.append(f"{p.name}: {type_repr}")
|
|
281
|
+
|
|
282
|
+
params_str = ", ".join(params_str_parts)
|
|
257
283
|
signature_line = f"{tool_name}({params_str}) -> dict[str, Any]"
|
|
284
|
+
|
|
258
285
|
if compact_docstring:
|
|
259
286
|
doc_lines = [tool_description.strip()]
|
|
260
287
|
else:
|
|
261
288
|
doc_lines = [signature_line, "", tool_description.strip()]
|
|
262
|
-
doc_lines += [
|
|
263
|
-
"",
|
|
264
|
-
"Args:",
|
|
265
|
-
]
|
|
266
289
|
|
|
267
290
|
full_schema = fn_schema.model_json_schema()
|
|
268
291
|
props = full_schema.get("properties", {})
|
|
269
|
-
for prop_name, schema_prop in props.items():
|
|
270
|
-
desc = schema_prop.get("description", "")
|
|
271
|
-
|
|
272
|
-
# pick up any examples you declared on the Field or via schema_extra
|
|
273
|
-
examples = schema_prop.get("examples", [])
|
|
274
|
-
default = schema_prop.get("default", PydanticUndefined)
|
|
275
|
-
|
|
276
|
-
# format the type, default, description, examples
|
|
277
|
-
# find the matching inspect.Parameter so you get its annotation
|
|
278
|
-
param = next((p for p in all_params if p.name == prop_name), None)
|
|
279
|
-
if param and hasattr(param.annotation, "__name__"):
|
|
280
|
-
ty = param.annotation.__name__
|
|
281
|
-
else:
|
|
282
|
-
ty = schema_prop.get("type", "")
|
|
283
|
-
|
|
284
|
-
# inline default if present
|
|
285
|
-
default_txt = f", default={default!r}" if default is not PydanticUndefined else ""
|
|
286
|
-
|
|
287
|
-
# inline examples if any
|
|
288
|
-
if examples:
|
|
289
|
-
examples_txt = ", ".join(repr(e) for e in examples)
|
|
290
|
-
desc = f"{desc} (e.g., {examples_txt})"
|
|
291
292
|
|
|
292
|
-
|
|
293
|
+
if props:
|
|
294
|
+
doc_lines.extend(["", "Args:"])
|
|
295
|
+
for prop_name, schema_prop in props.items():
|
|
296
|
+
desc = schema_prop.get("description", "")
|
|
297
|
+
|
|
298
|
+
# pick up any examples you declared on the Field or via schema_extra
|
|
299
|
+
examples = schema_prop.get("examples", [])
|
|
300
|
+
default = schema_prop.get("default", PydanticUndefined)
|
|
301
|
+
|
|
302
|
+
# format the type, default, description, examples
|
|
303
|
+
# find the matching inspect.Parameter so you get its annotation
|
|
304
|
+
param = next((p for p in all_params if p.name == prop_name), None)
|
|
305
|
+
ty_str = ""
|
|
306
|
+
if param:
|
|
307
|
+
ty_str = _format_type(param.annotation)
|
|
308
|
+
elif "type" in schema_prop:
|
|
309
|
+
ty_info = schema_prop["type"]
|
|
310
|
+
if isinstance(ty_info, str):
|
|
311
|
+
ty_str = _clean_type_repr(ty_info)
|
|
312
|
+
elif isinstance(ty_info, list): # Handle JSON schema array type e.g., ["integer", "string"]
|
|
313
|
+
ty_str = " | ".join([_clean_type_repr(t) for t in ty_info])
|
|
314
|
+
|
|
315
|
+
# inline default if present
|
|
316
|
+
default_txt = f", default={default!r}" if default is not PydanticUndefined else ""
|
|
317
|
+
|
|
318
|
+
# inline examples if any
|
|
319
|
+
if examples:
|
|
320
|
+
examples_txt = ", ".join(repr(e) for e in examples)
|
|
321
|
+
desc = f"{desc} (e.g., {examples_txt})"
|
|
322
|
+
|
|
323
|
+
doc_lines.append(f" - {prop_name} ({ty_str}{default_txt}): {desc}")
|
|
293
324
|
|
|
294
325
|
doc_lines.append("")
|
|
295
326
|
doc_lines.append("Returns:")
|
|
@@ -331,36 +362,33 @@ def create_tool_from_dynamic_function(
|
|
|
331
362
|
if not isinstance(tool_args_schema, type) or not issubclass(tool_args_schema, BaseModel):
|
|
332
363
|
raise TypeError("tool_args_schema must be a Pydantic BaseModel subclass")
|
|
333
364
|
|
|
334
|
-
fields = {}
|
|
365
|
+
fields: Dict[str, Any] = {}
|
|
335
366
|
base_params = []
|
|
336
367
|
for field_name, field_info in base_params_model.model_fields.items():
|
|
337
|
-
|
|
338
|
-
default_value = _unwrap_default(field_info.default)
|
|
368
|
+
default = Ellipsis if field_info.default is PydanticUndefined else field_info.default
|
|
339
369
|
param = inspect.Parameter(
|
|
340
370
|
field_name,
|
|
341
371
|
inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
|
342
|
-
default=
|
|
343
|
-
annotation=
|
|
372
|
+
default=default if default is not Ellipsis else inspect.Parameter.empty,
|
|
373
|
+
annotation=field_info.annotation,
|
|
344
374
|
)
|
|
345
375
|
base_params.append(param)
|
|
346
|
-
fields[field_name] = (
|
|
376
|
+
fields[field_name] = (field_info.annotation, field_info)
|
|
347
377
|
|
|
348
378
|
# Add tool_args_schema fields to the fields dict if not already included.
|
|
349
|
-
# Also add them to the function signature by creating new inspect.Parameter objects.
|
|
350
379
|
for field_name, field_info in tool_args_schema.model_fields.items():
|
|
351
380
|
if field_name in fields:
|
|
352
381
|
continue
|
|
353
382
|
|
|
354
|
-
|
|
355
|
-
default_value = _unwrap_default(field_info.default)
|
|
383
|
+
default = Ellipsis if field_info.default is PydanticUndefined else field_info.default
|
|
356
384
|
param = inspect.Parameter(
|
|
357
385
|
field_name,
|
|
358
386
|
inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
|
359
|
-
default=
|
|
360
|
-
annotation=
|
|
387
|
+
default=default if default is not Ellipsis else inspect.Parameter.empty,
|
|
388
|
+
annotation=field_info.annotation,
|
|
361
389
|
)
|
|
362
390
|
base_params.append(param)
|
|
363
|
-
fields[field_name] = (
|
|
391
|
+
fields[field_name] = (field_info.annotation, field_info)
|
|
364
392
|
|
|
365
393
|
# Create the dynamic schema with both base_params_model and tool_args_schema fields.
|
|
366
394
|
fn_schema = create_model(f"{tool_name}_schema", **fields)
|
|
@@ -402,7 +430,7 @@ _PARSE_RANGE_REGEX = re.compile(
|
|
|
402
430
|
)
|
|
403
431
|
|
|
404
432
|
|
|
405
|
-
def _parse_range(val_str: str) -> Tuple[
|
|
433
|
+
def _parse_range(val_str: str) -> Tuple[str, str, bool, bool]:
|
|
406
434
|
"""
|
|
407
435
|
Parses '[1,10)' or '(0.5, 5]' etc.
|
|
408
436
|
Returns (start, end, start_incl, end_incl) or raises ValueError.
|
|
@@ -411,10 +439,10 @@ def _parse_range(val_str: str) -> Tuple[float, float, bool, bool]:
|
|
|
411
439
|
if not m:
|
|
412
440
|
raise ValueError(f"Invalid range syntax: {val_str!r}")
|
|
413
441
|
start_inc = m.group(1) == "["
|
|
414
|
-
end_inc = m.group(
|
|
415
|
-
start =
|
|
416
|
-
end =
|
|
417
|
-
if start > end:
|
|
442
|
+
end_inc = m.group(6) == "]"
|
|
443
|
+
start = m.group(2)
|
|
444
|
+
end = m.group(4)
|
|
445
|
+
if float(start) > float(end):
|
|
418
446
|
raise ValueError(f"Range lower bound greater than upper bound: {val_str!r}")
|
|
419
447
|
return start, end, start_inc, end_inc
|
|
420
448
|
|
vectara_agentic/tools.py
CHANGED
|
@@ -36,6 +36,8 @@ LI_packages = {
|
|
|
36
36
|
"bing_search": ToolType.QUERY,
|
|
37
37
|
"neo4j": ToolType.QUERY,
|
|
38
38
|
"kuzu": ToolType.QUERY,
|
|
39
|
+
"waii": ToolType.QUERY,
|
|
40
|
+
"salesforce": ToolType.QUERY,
|
|
39
41
|
"wikipedia": ToolType.QUERY,
|
|
40
42
|
"google": {
|
|
41
43
|
"GmailToolSpec": {
|
|
@@ -219,7 +221,7 @@ class VectaraToolFactory:
|
|
|
219
221
|
response = vectara_retriever.retrieve(query)
|
|
220
222
|
|
|
221
223
|
if len(response) == 0:
|
|
222
|
-
msg = "Vectara Tool failed to
|
|
224
|
+
msg = "Vectara Tool failed to retrieve any results for the query."
|
|
223
225
|
return ToolOutput(
|
|
224
226
|
tool_name=search_function.__name__,
|
|
225
227
|
content=msg,
|
vectara_agentic/tools_catalog.py
CHANGED
vectara_agentic/utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vectara_agentic
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.17
|
|
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
|
|
@@ -16,18 +16,18 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
16
16
|
Requires-Python: >=3.10
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: llama-index==0.12.
|
|
20
|
-
Requires-Dist: llama-index-indices-managed-vectara==0.4.
|
|
19
|
+
Requires-Dist: llama-index==0.12.35
|
|
20
|
+
Requires-Dist: llama-index-indices-managed-vectara==0.4.5
|
|
21
21
|
Requires-Dist: llama-index-agent-llm-compiler==0.3.0
|
|
22
22
|
Requires-Dist: llama-index-agent-lats==0.3.0
|
|
23
|
-
Requires-Dist: llama-index-agent-openai==0.4.
|
|
23
|
+
Requires-Dist: llama-index-agent-openai==0.4.7
|
|
24
24
|
Requires-Dist: llama-index-llms-openai==0.3.38
|
|
25
25
|
Requires-Dist: llama-index-llms-anthropic==0.6.10
|
|
26
26
|
Requires-Dist: llama-index-llms-together==0.3.1
|
|
27
27
|
Requires-Dist: llama-index-llms-groq==0.3.1
|
|
28
28
|
Requires-Dist: llama-index-llms-fireworks==0.3.2
|
|
29
29
|
Requires-Dist: llama-index-llms-cohere==0.4.1
|
|
30
|
-
Requires-Dist: llama-index-llms-google-genai==0.1.
|
|
30
|
+
Requires-Dist: llama-index-llms-google-genai==0.1.12
|
|
31
31
|
Requires-Dist: llama-index-llms-bedrock==0.3.8
|
|
32
32
|
Requires-Dist: llama-index-tools-yahoo-finance==0.3.0
|
|
33
33
|
Requires-Dist: llama-index-tools-arxiv==0.3.0
|
|
@@ -36,15 +36,17 @@ Requires-Dist: llama-index-tools-google==0.3.0
|
|
|
36
36
|
Requires-Dist: llama-index-tools-tavily_research==0.3.0
|
|
37
37
|
Requires-Dist: llama_index.tools.brave_search==0.3.0
|
|
38
38
|
Requires-Dist: llama-index-tools-neo4j==0.3.0
|
|
39
|
+
Requires-Dist: llama-index-tools-waii==0.3.0
|
|
39
40
|
Requires-Dist: llama-index-graph-stores-kuzu==0.7.0
|
|
41
|
+
Requires-Dist: llama-index-tools-salesforce==0.3.0
|
|
40
42
|
Requires-Dist: llama-index-tools-slack==0.3.0
|
|
41
43
|
Requires-Dist: llama-index-tools-exa==0.3.0
|
|
42
44
|
Requires-Dist: llama-index-tools-wikipedia==0.3.0
|
|
43
45
|
Requires-Dist: llama-index-tools-bing-search==0.3.0
|
|
44
|
-
Requires-Dist: tavily-python==0.
|
|
45
|
-
Requires-Dist: exa-py==1.12.
|
|
46
|
+
Requires-Dist: tavily-python==0.7.2
|
|
47
|
+
Requires-Dist: exa-py==1.12.1
|
|
46
48
|
Requires-Dist: openinference-instrumentation-llama-index==4.2.1
|
|
47
|
-
Requires-Dist: opentelemetry-proto
|
|
49
|
+
Requires-Dist: opentelemetry-proto>=1.31.0
|
|
48
50
|
Requires-Dist: arize-phoenix==8.26.1
|
|
49
51
|
Requires-Dist: arize-phoenix-otel==0.9.2
|
|
50
52
|
Requires-Dist: protobuf==5.29.3
|
|
@@ -365,51 +367,92 @@ vectara-agentic includes various other tools from LlamaIndex ToolSpecs:
|
|
|
365
367
|
* Tavily Search: Real-time web search using [Tavily API](https://tavily.com/)
|
|
366
368
|
```python
|
|
367
369
|
from vectara_agentic.tools_catalog import ToolsCatalog
|
|
368
|
-
|
|
370
|
+
tools_factory = ToolsFactory()
|
|
371
|
+
tavily_tools = tools_factory.get_llama_index_tools(
|
|
372
|
+
tool_package_name="tavily_research",
|
|
373
|
+
tool_spec_name="TavilyToolSpec",
|
|
374
|
+
api_key=str(os.environ["TAVILY_API_KEY"]),
|
|
375
|
+
)
|
|
369
376
|
```
|
|
370
377
|
* EXA.AI: Advanced web search and data extraction
|
|
371
378
|
```python
|
|
372
|
-
|
|
379
|
+
exa_tools = tools_factory.get_llama_index_tools(
|
|
380
|
+
tool_package_name="exa.ai",
|
|
381
|
+
tool_spec_name="ExaToolSpec",
|
|
382
|
+
api_key=str(os.environ["EXA_API_KEY"]),
|
|
383
|
+
)
|
|
373
384
|
```
|
|
374
385
|
* Brave Search: Web search using Brave's search engine
|
|
375
386
|
```python
|
|
376
|
-
|
|
387
|
+
brave_tools = tools_factory.get_llama_index_tools(
|
|
388
|
+
tool_package_name="brave_search",
|
|
389
|
+
tool_spec_name="BraveSearchToolSpec",
|
|
390
|
+
api_key=str(os.environ["BRAVE_API_KEY"]),
|
|
391
|
+
)
|
|
377
392
|
```
|
|
378
393
|
|
|
379
394
|
* **Academic Tools**
|
|
380
395
|
* arXiv: Search and retrieve academic papers
|
|
381
396
|
```python
|
|
382
|
-
|
|
397
|
+
arxiv_tools = tools_factory.get_llama_index_tools(
|
|
398
|
+
tool_package_name="arxiv",
|
|
399
|
+
tool_spec_name="ArxivToolSpec",
|
|
400
|
+
)
|
|
383
401
|
```
|
|
384
402
|
|
|
385
|
-
* **
|
|
403
|
+
* **Database Tools**
|
|
386
404
|
* Neo4j: Graph database integration
|
|
387
405
|
```python
|
|
388
|
-
|
|
406
|
+
neo4j_tools = tools_factory.get_llama_index_tools(
|
|
407
|
+
tool_package_name="neo4j",
|
|
408
|
+
tool_spec_name="Neo4jQueryToolSpec",
|
|
409
|
+
)
|
|
389
410
|
```
|
|
390
411
|
* Kuzu: Lightweight graph database
|
|
391
412
|
```python
|
|
392
|
-
|
|
413
|
+
kuzu_tools = tools_factory.get_llama_index_tools(
|
|
414
|
+
tool_package_name="kuzu",
|
|
415
|
+
tool_spec_name="KuzuGraphStore",
|
|
416
|
+
)
|
|
417
|
+
```
|
|
418
|
+
* Waii: tools for natural langauge query of a relational database
|
|
419
|
+
```python
|
|
420
|
+
waii_tools = tools_factory.get_llama_index_tools(
|
|
421
|
+
tool_package_name="waii",
|
|
422
|
+
tool_spec_name="WaiiToolSpec",
|
|
423
|
+
)
|
|
393
424
|
```
|
|
394
425
|
|
|
395
426
|
* **Google Tools**
|
|
396
427
|
* Gmail: Read and send emails
|
|
397
428
|
```python
|
|
398
|
-
|
|
429
|
+
gmail_tools = tools_factory.get_llama_index_tools(
|
|
430
|
+
tool_package_name="google",
|
|
431
|
+
tool_spec_name="GmailToolSpec",
|
|
432
|
+
)
|
|
399
433
|
```
|
|
400
434
|
* Calendar: Manage calendar events
|
|
401
435
|
```python
|
|
402
|
-
|
|
436
|
+
calendar_tools = tools_factory.get_llama_index_tools(
|
|
437
|
+
tool_package_name="google",
|
|
438
|
+
tool_spec_name="GoogleCalendarToolSpec",
|
|
439
|
+
)
|
|
403
440
|
```
|
|
404
441
|
* Search: Google search integration
|
|
405
442
|
```python
|
|
406
|
-
|
|
443
|
+
search_tools = tools_factory.get_llama_index_tools(
|
|
444
|
+
tool_package_name="google",
|
|
445
|
+
tool_spec_name="GoogleSearchToolSpec",
|
|
446
|
+
)
|
|
407
447
|
```
|
|
408
448
|
|
|
409
449
|
* **Communication Tools**
|
|
410
450
|
* Slack: Send messages and interact with Slack
|
|
411
451
|
```python
|
|
412
|
-
|
|
452
|
+
slack_tools = tools_factory.get_llama_index_tools(
|
|
453
|
+
tool_package_name="slack",
|
|
454
|
+
tool_spec_name="SlackToolSpec",
|
|
455
|
+
)
|
|
413
456
|
```
|
|
414
457
|
|
|
415
458
|
For detailed setup instructions and API key requirements, please refer the instructions on [LlamaIndex hub](https://llamahub.ai/?tab=tools) for the specific tool.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
tests/endpoint.py,sha256=frnpdZQpnuQNNKNYgAn2rFTarNG8MCJaNA77Bw_W22A,1420
|
|
3
|
+
tests/test_agent.py,sha256=o5U3K1AJllsSDvucrgFJPQRdAmHPq3LCuFpsnECUTFk,5483
|
|
4
|
+
tests/test_agent_planning.py,sha256=JwEebGooROAvsQ9JZoaH6KEcrSyv1F0lL4TD4FjP8a8,2213
|
|
5
|
+
tests/test_agent_type.py,sha256=mWo-pTQNDj4fWFPETm5jnb7Y5N48aW35keTVvxdIaCc,7173
|
|
6
|
+
tests/test_fallback.py,sha256=M5YD7NHZ0joVU1frYIr9_OiRAIje5mrXrYVcekzlyGs,2829
|
|
7
|
+
tests/test_groq.py,sha256=Knsz-xEBY-eoq8T0DzAC09UJWZqwtLmcjbx6QY37rJg,4235
|
|
8
|
+
tests/test_private_llm.py,sha256=CY-_rCpxGUuxnZ3ypkodw5Jj-sJCNdh6rLbCvULwuJI,2247
|
|
9
|
+
tests/test_return_direct.py,sha256=Y_K_v88eS_kJfxE6A0Yghma0nUT8u6COitj0SNnZGNs,1523
|
|
10
|
+
tests/test_serialization.py,sha256=Ed23GN2zhSJNdPFrVK4aqLkOhJKviczR_o0t-r9TuRI,4762
|
|
11
|
+
tests/test_tools.py,sha256=MWExM3n1oKmVpLmayIgHXqF6_hOPq44KPkRphitBKik,15709
|
|
12
|
+
tests/test_vectara_llms.py,sha256=m-fDAamJR1I5IdV0IpXuTegerTUNCVRm27lsHd4wQjg,2367
|
|
13
|
+
tests/test_workflow.py,sha256=06NvgUQMzPb2b2mrxtVo7xribZEDQM1LdcXNJdiOfPc,4391
|
|
14
|
+
vectara_agentic/__init__.py,sha256=2GLDS3U6KckK-dBRl9v_x1kSV507gEhjOfuMmmu0Qxg,850
|
|
15
|
+
vectara_agentic/_callback.py,sha256=ron49t1t-ox-736WaXzrZ99vhN4NI9bMiHFyj0iIPqg,13062
|
|
16
|
+
vectara_agentic/_observability.py,sha256=UbJxiOJFOdLq3b1t0-Y7swMC3BzJu3IOlTUM-c1oUk8,4328
|
|
17
|
+
vectara_agentic/_prompts.py,sha256=vAb02oahA7GKRgLOsDGqgKl-BLBop2AjOlCTgLrf3M4,9694
|
|
18
|
+
vectara_agentic/_version.py,sha256=o3KLIOSUALmaTPqzIK1UP5BKpJQc99yysN5Rcv3m8Qk,66
|
|
19
|
+
vectara_agentic/agent.py,sha256=zJ7ucFf8jc0VO4mTFqujfwREz2B-rJCpIgCJKAtNlEk,54884
|
|
20
|
+
vectara_agentic/agent_config.py,sha256=E-rtYMcpoGxnEAyy8231bizo2n0uGQ2qWxuSgTEfwdQ,4327
|
|
21
|
+
vectara_agentic/agent_endpoint.py,sha256=QIMejCLlpW2qzXxeDAxv3anF46XMDdVMdKGWhJh3azY,1996
|
|
22
|
+
vectara_agentic/db_tools.py,sha256=Kfz6n-rSj5TQEbAiJnWGmqWtcwB0A5GpxD7d1UwGzlc,11194
|
|
23
|
+
vectara_agentic/llm_utils.py,sha256=FOQG6if6D7l1eVRx_r-HSUhh5wBguIaxsYMKrZl2fJo,6302
|
|
24
|
+
vectara_agentic/sub_query_workflow.py,sha256=cPeossVPFajpSAwy45fSXhTXbQOfzv_l66pxSa4molM,12366
|
|
25
|
+
vectara_agentic/tool_utils.py,sha256=fQFjbWc-ucHRiQ06vTbvNma7gwxYLKMAL41KZm4_MLs,20506
|
|
26
|
+
vectara_agentic/tools.py,sha256=2_9YBqszFqYDpvlTIZfdfplRKffe660jQRxp0akM-cE,32918
|
|
27
|
+
vectara_agentic/tools_catalog.py,sha256=cAN_kDOWZUoW4GNFwY5GdS6ImMUQNnF2sggx9OGK9Cg,4906
|
|
28
|
+
vectara_agentic/types.py,sha256=HcS7vR8P2v2xQTlOc6ZFV2vvlr3OpzSNWhtcLMxqUZc,1792
|
|
29
|
+
vectara_agentic/utils.py,sha256=R9HitEG5K3Q_p2M_teosT181OUxkhs1-hnj98qDYGbE,2545
|
|
30
|
+
vectara_agentic-0.2.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
31
|
+
vectara_agentic-0.2.17.dist-info/METADATA,sha256=uqgVpTya69UeykCim5Ur-V-r3tFSqJPMMYLDnKZHagk,29895
|
|
32
|
+
vectara_agentic-0.2.17.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
33
|
+
vectara_agentic-0.2.17.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
34
|
+
vectara_agentic-0.2.17.dist-info/RECORD,,
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
tests/endpoint.py,sha256=frnpdZQpnuQNNKNYgAn2rFTarNG8MCJaNA77Bw_W22A,1420
|
|
3
|
-
tests/test_agent.py,sha256=nkg3SefST9Q-38Ys9yLJZr2RN6FxeXonMGj7uRCsta8,5482
|
|
4
|
-
tests/test_agent_planning.py,sha256=r_Qk63aK6gAzIluv3X6CLCNIbE1ExWJEUIkvoI6U7RE,2213
|
|
5
|
-
tests/test_agent_type.py,sha256=mWo-pTQNDj4fWFPETm5jnb7Y5N48aW35keTVvxdIaCc,7173
|
|
6
|
-
tests/test_fallback.py,sha256=M5YD7NHZ0joVU1frYIr9_OiRAIje5mrXrYVcekzlyGs,2829
|
|
7
|
-
tests/test_groq.py,sha256=0FFnQ91o9UjOIAIe_JMxyBl4dz_38RRbl00j9dFudMs,4170
|
|
8
|
-
tests/test_private_llm.py,sha256=CY-_rCpxGUuxnZ3ypkodw5Jj-sJCNdh6rLbCvULwuJI,2247
|
|
9
|
-
tests/test_return_direct.py,sha256=Y_K_v88eS_kJfxE6A0Yghma0nUT8u6COitj0SNnZGNs,1523
|
|
10
|
-
tests/test_serialization.py,sha256=Ed23GN2zhSJNdPFrVK4aqLkOhJKviczR_o0t-r9TuRI,4762
|
|
11
|
-
tests/test_tools.py,sha256=EgrEU33ikLv7NmLarB8sYG_E6Sr42gQJ03VQBaZWhLw,11942
|
|
12
|
-
tests/test_vectara_llms.py,sha256=m-fDAamJR1I5IdV0IpXuTegerTUNCVRm27lsHd4wQjg,2367
|
|
13
|
-
tests/test_workflow.py,sha256=lVyrVHdRO5leYNbYtHTmKqMX0c8_xehCpUA7cXQKVsc,2175
|
|
14
|
-
vectara_agentic/__init__.py,sha256=2GLDS3U6KckK-dBRl9v_x1kSV507gEhjOfuMmmu0Qxg,850
|
|
15
|
-
vectara_agentic/_callback.py,sha256=ron49t1t-ox-736WaXzrZ99vhN4NI9bMiHFyj0iIPqg,13062
|
|
16
|
-
vectara_agentic/_observability.py,sha256=V4D8Y16kJJ9t-1WA47pnVjM61SuEd5Nh4mTepjZXVAE,4327
|
|
17
|
-
vectara_agentic/_prompts.py,sha256=TYBfw95fCfnzi9ERCTdvDIfbkaJ-PYEajc7inXdSRl4,9523
|
|
18
|
-
vectara_agentic/_version.py,sha256=sxV-EHkA7i4FI2mIRwjs9AxNcBpyuZetohHW1FBAseQ,66
|
|
19
|
-
vectara_agentic/agent.py,sha256=jfPGJ4Y2xCjQatfwdSBvxfx4VJ7HWqTDvLJ4gJtGoQc,50728
|
|
20
|
-
vectara_agentic/agent_config.py,sha256=E-rtYMcpoGxnEAyy8231bizo2n0uGQ2qWxuSgTEfwdQ,4327
|
|
21
|
-
vectara_agentic/agent_endpoint.py,sha256=QIMejCLlpW2qzXxeDAxv3anF46XMDdVMdKGWhJh3azY,1996
|
|
22
|
-
vectara_agentic/db_tools.py,sha256=bAgqQMrpmu7KBaiAjJ4tpH8JwsFGEDk8iru5Deu0SEk,11179
|
|
23
|
-
vectara_agentic/llm_utils.py,sha256=Isf1d9K4Jpn-IwMZn-liPUTEF-bpiqp0XIiNRohtwTQ,6152
|
|
24
|
-
vectara_agentic/sub_query_workflow.py,sha256=xjySd2qjLAKwK6XuS0R0PTyk2uXraHCgCbDP1xDoFVI,12175
|
|
25
|
-
vectara_agentic/tool_utils.py,sha256=CG30jWeDi-mmetI0jIK2LcsCsyYSckoROrWRXYRCQm4,19226
|
|
26
|
-
vectara_agentic/tools.py,sha256=mPRPbQe8ffQYF6pHCRQ6JUUcdevuMDu-J7pVAgKU1cQ,32856
|
|
27
|
-
vectara_agentic/tools_catalog.py,sha256=hDXfxn3CW5RrM29I7Zh10wj_MrY91zjublyjGSwiCEw,4825
|
|
28
|
-
vectara_agentic/types.py,sha256=HcS7vR8P2v2xQTlOc6ZFV2vvlr3OpzSNWhtcLMxqUZc,1792
|
|
29
|
-
vectara_agentic/utils.py,sha256=q14S8nm3UFFI3ksk-xszd9xgFrtXdIt_tdRiBMFjaa0,2529
|
|
30
|
-
vectara_agentic-0.2.15.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
31
|
-
vectara_agentic-0.2.15.dist-info/METADATA,sha256=Ao2j0EaxBZiVhTT_-GcdrXD9FV4WRYK0yiVcDQjEl9M,28114
|
|
32
|
-
vectara_agentic-0.2.15.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
|
33
|
-
vectara_agentic-0.2.15.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
34
|
-
vectara_agentic-0.2.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|