vectara-agentic 0.1.21__py3-none-any.whl → 0.1.23__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.
- vectara_agentic/__init__.py +1 -1
- vectara_agentic/tools.py +17 -1
- {vectara_agentic-0.1.21.dist-info → vectara_agentic-0.1.23.dist-info}/METADATA +18 -10
- {vectara_agentic-0.1.21.dist-info → vectara_agentic-0.1.23.dist-info}/RECORD +7 -7
- {vectara_agentic-0.1.21.dist-info → vectara_agentic-0.1.23.dist-info}/LICENSE +0 -0
- {vectara_agentic-0.1.21.dist-info → vectara_agentic-0.1.23.dist-info}/WHEEL +0 -0
- {vectara_agentic-0.1.21.dist-info → vectara_agentic-0.1.23.dist-info}/top_level.txt +0 -0
vectara_agentic/__init__.py
CHANGED
vectara_agentic/tools.py
CHANGED
|
@@ -251,12 +251,19 @@ class VectaraToolFactory:
|
|
|
251
251
|
# = and != operators can be numeric or string
|
|
252
252
|
if rhs.isdigit() or is_float(rhs):
|
|
253
253
|
filter_parts.append(f"{prefix}.{key}{matched_operator}{rhs}")
|
|
254
|
+
elif rhs.lower() in ["true", "false"]:
|
|
255
|
+
filter_parts.append(f"{prefix}.{key}{matched_operator}{rhs.lower()}")
|
|
254
256
|
else:
|
|
255
257
|
# For string operands, wrap them in quotes
|
|
256
258
|
filter_parts.append(f"{prefix}.{key}{matched_operator}'{rhs}'")
|
|
257
259
|
else:
|
|
258
260
|
if val_str.isdigit() or is_float(val_str):
|
|
259
261
|
filter_parts.append(f"{prefix}.{key}={val_str}")
|
|
262
|
+
elif val_str.lower() in ["true", "false"]:
|
|
263
|
+
# This is to handle boolean values.
|
|
264
|
+
# This is not complete solution - the best solution would be to test if the field is boolean
|
|
265
|
+
# That can be done after we move to APIv2
|
|
266
|
+
filter_parts.append(f"{prefix}.{key}={val_str.lower()}")
|
|
260
267
|
else:
|
|
261
268
|
filter_parts.append(f"{prefix}.{key}='{val_str}'")
|
|
262
269
|
|
|
@@ -379,11 +386,20 @@ class VectaraToolFactory:
|
|
|
379
386
|
rag_function.__annotations__["return"] = dict[str, Any]
|
|
380
387
|
rag_function.__name__ = "_" + re.sub(r"[^A-Za-z0-9_]", "_", tool_name)
|
|
381
388
|
|
|
389
|
+
# Create the tool function signature string
|
|
390
|
+
fields = []
|
|
391
|
+
for name, field in tool_args_schema.__fields__.items():
|
|
392
|
+
annotation = field.annotation
|
|
393
|
+
type_name = annotation.__name__ if hasattr(annotation, '__name__') else str(annotation)
|
|
394
|
+
fields.append(f"{name}: {type_name}")
|
|
395
|
+
args_str = ", ".join(fields)
|
|
396
|
+
function_str = f"{tool_name}({args_str}) -> str"
|
|
397
|
+
|
|
382
398
|
# Create the tool
|
|
383
399
|
tool = VectaraTool.from_defaults(
|
|
384
400
|
fn=rag_function,
|
|
385
401
|
name=tool_name,
|
|
386
|
-
description=tool_description,
|
|
402
|
+
description=function_str + ". " + tool_description,
|
|
387
403
|
fn_schema=tool_args_schema,
|
|
388
404
|
tool_type=ToolType.QUERY,
|
|
389
405
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vectara_agentic
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.23
|
|
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.
|
|
19
|
+
Requires-Dist: llama-index==0.12.7
|
|
20
20
|
Requires-Dist: llama-index-indices-managed-vectara==0.3.1
|
|
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.
|
|
24
|
-
Requires-Dist: llama-index-llms-openai==0.3.
|
|
25
|
-
Requires-Dist: llama-index-llms-anthropic==0.
|
|
26
|
-
Requires-Dist: llama-index-llms-together==0.3.
|
|
27
|
-
Requires-Dist: llama-index-llms-groq==0.3.
|
|
23
|
+
Requires-Dist: llama-index-agent-openai==0.4.1
|
|
24
|
+
Requires-Dist: llama-index-llms-openai==0.3.12
|
|
25
|
+
Requires-Dist: llama-index-llms-anthropic==0.6.3
|
|
26
|
+
Requires-Dist: llama-index-llms-together==0.3.1
|
|
27
|
+
Requires-Dist: llama-index-llms-groq==0.3.1
|
|
28
28
|
Requires-Dist: llama-index-llms-fireworks==0.3.0
|
|
29
29
|
Requires-Dist: llama-index-llms-cohere==0.4.0
|
|
30
|
-
Requires-Dist: llama-index-llms-gemini==0.4.
|
|
30
|
+
Requires-Dist: llama-index-llms-gemini==0.4.2
|
|
31
31
|
Requires-Dist: llama-index-tools-yahoo-finance==0.3.0
|
|
32
32
|
Requires-Dist: llama-index-tools-arxiv==0.3.0
|
|
33
33
|
Requires-Dist: llama-index-tools-database==0.3.0
|
|
@@ -128,10 +128,18 @@ vec_factory = VectaraToolFactory(
|
|
|
128
128
|
vectara_corpus_id=os.environ['VECTARA_CORPUS_ID']
|
|
129
129
|
)
|
|
130
130
|
|
|
131
|
+
years = list(range(2020, 2024))
|
|
132
|
+
tickers = {
|
|
133
|
+
"AAPL": "Apple Computer",
|
|
134
|
+
"GOOG": "Google",
|
|
135
|
+
"AMZN": "Amazon",
|
|
136
|
+
"SNOW": "Snowflake",
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
class QueryFinancialReportsArgs(BaseModel):
|
|
132
140
|
query: str = Field(..., description="The user query.")
|
|
133
|
-
year: int = Field(..., description="The year. An integer between {min(years)} and {max(years)}.")
|
|
134
|
-
ticker: str = Field(..., description="The company ticker. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
|
141
|
+
year: int | str = Field(..., description=f"The year this query relates to. An integer between {min(years)} and {max(years)} or a string specifying a condition on the year (example: '>2020').")
|
|
142
|
+
ticker: str = Field(..., description=f"The company ticker. Must be a valid ticket symbol from the list {tickers.keys()}.")
|
|
135
143
|
|
|
136
144
|
query_financial_reports_tool = vec_factory.create_rag_tool(
|
|
137
145
|
tool_name="query_financial_reports",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
tests/test_agent.py,sha256=aQYYr_8hKlFiDgyI5Dd39TG5vkmDJe7F_nIzMTCLsTQ,2517
|
|
3
3
|
tests/test_tools.py,sha256=hDAlXkWKuXHnAjeQwMuTLTwNdRsM-xR7muBzFkZRefw,2942
|
|
4
|
-
vectara_agentic/__init__.py,sha256=
|
|
4
|
+
vectara_agentic/__init__.py,sha256=qmbzN20Bl7PTIgDB5Wpn0uBKyqMZxR2744Yn1LlqgcM,508
|
|
5
5
|
vectara_agentic/_callback.py,sha256=OBiHk_OJZTS3iKz_LigfEjnl_p5V90XYsQC0vEYVSPo,8782
|
|
6
6
|
vectara_agentic/_observability.py,sha256=v0xxTk8KI8nVK2rpyGqOVhyva9ymqOmZK5brKqFOwMM,3828
|
|
7
7
|
vectara_agentic/_prompts.py,sha256=N656x-bfy9I5j2Lw51gpaGq_8R6zpPelPQ2-KWHHpTk,6160
|
|
8
8
|
vectara_agentic/agent.py,sha256=Vr8R4sR_ZxJfGI94Jjze4r_rCCWYNvJ9UqsfjlAReWM,22045
|
|
9
9
|
vectara_agentic/agent_endpoint.py,sha256=I3zTEezbAiNeW5I41r0NjIaR8Ucn4oe1XVcALekakaA,1959
|
|
10
10
|
vectara_agentic/db_tools.py,sha256=kCEENzmnorm8i-k4Kpd4KLJt1QWh_ZlAyX1aG-tzET0,3619
|
|
11
|
-
vectara_agentic/tools.py,sha256=
|
|
11
|
+
vectara_agentic/tools.py,sha256=lXkf1cMrK1NNORArhM3urT9_UoibiEa268oOB_3_hGk,25346
|
|
12
12
|
vectara_agentic/tools_catalog.py,sha256=5NlJypdu0IKa7mODxVOwo05lw3PqQJtSl_ZOsUDH_TA,3986
|
|
13
13
|
vectara_agentic/types.py,sha256=siRh9VmFt3jhTu4uJzYpvNlLi60lyIH5_xqYHKpB24Q,1149
|
|
14
14
|
vectara_agentic/utils.py,sha256=XzSo5tKSsQpgd6Kx3q-XREohbyIe7-UqlpUW-9y1KeQ,3998
|
|
15
|
-
vectara_agentic-0.1.
|
|
16
|
-
vectara_agentic-0.1.
|
|
17
|
-
vectara_agentic-0.1.
|
|
18
|
-
vectara_agentic-0.1.
|
|
19
|
-
vectara_agentic-0.1.
|
|
15
|
+
vectara_agentic-0.1.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
16
|
+
vectara_agentic-0.1.23.dist-info/METADATA,sha256=e_sISyt8xk1ip2LtKfaSIvV_3O2w30jwj907I8cgueE,14683
|
|
17
|
+
vectara_agentic-0.1.23.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
18
|
+
vectara_agentic-0.1.23.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
19
|
+
vectara_agentic-0.1.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|