vectara-agentic 0.2.18__py3-none-any.whl → 0.2.20__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.
- tests/test_agent.py +1 -0
- tests/test_bedrock.py +42 -0
- vectara_agentic/_version.py +1 -1
- vectara_agentic/llm_utils.py +15 -4
- {vectara_agentic-0.2.18.dist-info → vectara_agentic-0.2.20.dist-info}/METADATA +16 -10
- {vectara_agentic-0.2.18.dist-info → vectara_agentic-0.2.20.dist-info}/RECORD +9 -8
- {vectara_agentic-0.2.18.dist-info → vectara_agentic-0.2.20.dist-info}/WHEEL +1 -1
- {vectara_agentic-0.2.18.dist-info → vectara_agentic-0.2.20.dist-info}/licenses/LICENSE +0 -0
- {vectara_agentic-0.2.18.dist-info → vectara_agentic-0.2.20.dist-info}/top_level.txt +0 -0
tests/test_agent.py
CHANGED
tests/test_bedrock.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
from vectara_agentic.agent import Agent, AgentType
|
|
4
|
+
from vectara_agentic.agent_config import AgentConfig
|
|
5
|
+
from vectara_agentic.tools import ToolsFactory
|
|
6
|
+
from vectara_agentic.types import ModelProvider
|
|
7
|
+
|
|
8
|
+
import nest_asyncio
|
|
9
|
+
nest_asyncio.apply()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def mult(x: float, y: float) -> float:
|
|
13
|
+
"Multiply two numbers"
|
|
14
|
+
return x * y
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
fc_config_bedrock = AgentConfig(
|
|
18
|
+
agent_type=AgentType.FUNCTION_CALLING,
|
|
19
|
+
main_llm_provider=ModelProvider.BEDROCK,
|
|
20
|
+
tool_llm_provider=ModelProvider.BEDROCK,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
class TestBedrock(unittest.TestCase):
|
|
24
|
+
|
|
25
|
+
def test_multiturn(self):
|
|
26
|
+
tools = [ToolsFactory().create_tool(mult)]
|
|
27
|
+
topic = "AI topic"
|
|
28
|
+
instructions = "Always do as your father tells you, if your mother agrees!"
|
|
29
|
+
agent = Agent(
|
|
30
|
+
tools=tools,
|
|
31
|
+
topic=topic,
|
|
32
|
+
custom_instructions=instructions,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
agent.chat("What is 5 times 10. Only give the answer, nothing else")
|
|
36
|
+
agent.chat("what is 3 times 7. Only give the answer, nothing else")
|
|
37
|
+
res = agent.chat("multiply the results of the last two questions. Output only the answer.")
|
|
38
|
+
self.assertEqual(res.response, "1050")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
unittest.main()
|
vectara_agentic/_version.py
CHANGED
vectara_agentic/llm_utils.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Utilities for the Vectara agentic.
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
from typing import Tuple, Callable, Optional
|
|
6
|
+
import os
|
|
5
7
|
from functools import lru_cache
|
|
6
8
|
import tiktoken
|
|
7
9
|
|
|
@@ -14,11 +16,11 @@ from .agent_config import AgentConfig
|
|
|
14
16
|
|
|
15
17
|
provider_to_default_model_name = {
|
|
16
18
|
ModelProvider.OPENAI: "gpt-4o",
|
|
17
|
-
ModelProvider.ANTHROPIC: "claude-
|
|
19
|
+
ModelProvider.ANTHROPIC: "claude-sonnet-4-20250514",
|
|
18
20
|
ModelProvider.TOGETHER: "Qwen/Qwen2.5-72B-Instruct-Turbo",
|
|
19
21
|
ModelProvider.GROQ: "meta-llama/llama-4-scout-17b-16e-instruct",
|
|
20
22
|
ModelProvider.FIREWORKS: "accounts/fireworks/models/firefunction-v2",
|
|
21
|
-
ModelProvider.BEDROCK: "anthropic.claude-
|
|
23
|
+
ModelProvider.BEDROCK: "us.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
22
24
|
ModelProvider.COHERE: "command-a-03-2025",
|
|
23
25
|
ModelProvider.GEMINI: "models/gemini-2.0-flash",
|
|
24
26
|
}
|
|
@@ -136,9 +138,18 @@ def get_llm(role: LLMRole, config: Optional[AgentConfig] = None) -> LLM:
|
|
|
136
138
|
|
|
137
139
|
llm = Fireworks(model=model_name, temperature=0, max_tokens=max_tokens)
|
|
138
140
|
elif model_provider == ModelProvider.BEDROCK:
|
|
139
|
-
from llama_index.llms.
|
|
141
|
+
from llama_index.llms.bedrock_converse import BedrockConverse
|
|
142
|
+
|
|
143
|
+
aws_profile_name = os.getenv("AWS_PROFILE", None)
|
|
144
|
+
aws_region = os.getenv("AWS_REGION", "us-east-2")
|
|
140
145
|
|
|
141
|
-
llm =
|
|
146
|
+
llm = BedrockConverse(
|
|
147
|
+
model=model_name,
|
|
148
|
+
temperature=0,
|
|
149
|
+
max_tokens=max_tokens,
|
|
150
|
+
profile_name=aws_profile_name,
|
|
151
|
+
region_name=aws_region,
|
|
152
|
+
)
|
|
142
153
|
elif model_provider == ModelProvider.COHERE:
|
|
143
154
|
from llama_index.llms.cohere import Cohere
|
|
144
155
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vectara_agentic
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.20
|
|
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,20 +16,21 @@ 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.37
|
|
20
|
+
Requires-Dist: llama-index-core==0.12.37
|
|
20
21
|
Requires-Dist: llama-index-indices-managed-vectara==0.4.5
|
|
21
|
-
Requires-Dist: llama-index-agent-llm-compiler==0.3.
|
|
22
|
+
Requires-Dist: llama-index-agent-llm-compiler==0.3.1
|
|
22
23
|
Requires-Dist: llama-index-agent-lats==0.3.0
|
|
23
24
|
Requires-Dist: llama-index-agent-openai==0.4.8
|
|
24
|
-
Requires-Dist: llama-index-llms-openai==0.3.
|
|
25
|
+
Requires-Dist: llama-index-llms-openai==0.3.44
|
|
25
26
|
Requires-Dist: llama-index-llms-openai-like>=0.3.5
|
|
26
|
-
Requires-Dist: llama-index-llms-anthropic==0.6.
|
|
27
|
+
Requires-Dist: llama-index-llms-anthropic==0.6.19
|
|
27
28
|
Requires-Dist: llama-index-llms-together==0.3.1
|
|
28
29
|
Requires-Dist: llama-index-llms-groq==0.3.1
|
|
29
30
|
Requires-Dist: llama-index-llms-fireworks==0.3.2
|
|
30
31
|
Requires-Dist: llama-index-llms-cohere==0.4.1
|
|
31
|
-
Requires-Dist: llama-index-llms-google-genai==0.1.
|
|
32
|
-
Requires-Dist: llama-index-llms-bedrock==0.
|
|
32
|
+
Requires-Dist: llama-index-llms-google-genai==0.1.14
|
|
33
|
+
Requires-Dist: llama-index-llms-bedrock-converse==0.6.0
|
|
33
34
|
Requires-Dist: llama-index-tools-yahoo-finance==0.3.0
|
|
34
35
|
Requires-Dist: llama-index-tools-arxiv==0.3.0
|
|
35
36
|
Requires-Dist: llama-index-tools-database==0.3.0
|
|
@@ -44,8 +45,9 @@ Requires-Dist: llama-index-tools-slack==0.3.0
|
|
|
44
45
|
Requires-Dist: llama-index-tools-exa==0.3.0
|
|
45
46
|
Requires-Dist: llama-index-tools-wikipedia==0.3.0
|
|
46
47
|
Requires-Dist: llama-index-tools-bing-search==0.3.0
|
|
47
|
-
Requires-Dist:
|
|
48
|
-
Requires-Dist:
|
|
48
|
+
Requires-Dist: openai>=1.82.0
|
|
49
|
+
Requires-Dist: tavily-python==0.7.3
|
|
50
|
+
Requires-Dist: exa-py==1.13.1
|
|
49
51
|
Requires-Dist: openinference-instrumentation-llama-index==4.2.1
|
|
50
52
|
Requires-Dist: opentelemetry-proto>=1.31.0
|
|
51
53
|
Requires-Dist: arize-phoenix==8.26.1
|
|
@@ -144,7 +146,11 @@ Check out our example AI assistants:
|
|
|
144
146
|
- [Vectara account](https://console.vectara.com/signup/?utm_source=github&utm_medium=code&utm_term=DevRel&utm_content=vectara-agentic&utm_campaign=github-code-DevRel-vectara-agentic)
|
|
145
147
|
- A Vectara corpus with an [API key](https://docs.vectara.com/docs/api-keys)
|
|
146
148
|
- [Python 3.10 or higher](https://www.python.org/downloads/)
|
|
147
|
-
- OpenAI API key (or API keys for Anthropic, TOGETHER.AI, Fireworks AI,
|
|
149
|
+
- OpenAI API key (or API keys for Anthropic, TOGETHER.AI, Fireworks AI, Cohere, GEMINI or GROQ, if you choose to use them).
|
|
150
|
+
To use AWS Bedrock, make sure that
|
|
151
|
+
* The Bedrock models you need are enabled on your account
|
|
152
|
+
* Your environment includes `AWS_PROFILE` with your AWS profile name.
|
|
153
|
+
* Your environment includes `AWS_REGION` set to the region where you want to consume the AWS Bedrock services (defaults to us-east-2)
|
|
148
154
|
|
|
149
155
|
### Installation
|
|
150
156
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
tests/endpoint.py,sha256=frnpdZQpnuQNNKNYgAn2rFTarNG8MCJaNA77Bw_W22A,1420
|
|
3
|
-
tests/test_agent.py,sha256=
|
|
3
|
+
tests/test_agent.py,sha256=BmpJrYN-BLwYasgPhY5Dji-kIpc723e2F6I-nj4EQgc,5510
|
|
4
4
|
tests/test_agent_planning.py,sha256=JwEebGooROAvsQ9JZoaH6KEcrSyv1F0lL4TD4FjP8a8,2213
|
|
5
5
|
tests/test_agent_type.py,sha256=mWo-pTQNDj4fWFPETm5jnb7Y5N48aW35keTVvxdIaCc,7173
|
|
6
6
|
tests/test_api_endpoint.py,sha256=M9YGFCy_Jphzq9JznP4ftHqxZ_yu6dgWdX1jRvdsORA,5002
|
|
7
|
+
tests/test_bedrock.py,sha256=23A5_2FRaEl47PzgfUPDL6dgFDPJ9iktz-A-B1UwIhg,1224
|
|
7
8
|
tests/test_fallback.py,sha256=M5YD7NHZ0joVU1frYIr9_OiRAIje5mrXrYVcekzlyGs,2829
|
|
8
9
|
tests/test_gemini.py,sha256=QUBYWhZkX9AjnhPn5qa7sREf6YHZWeJEmYzKwVC23Io,4081
|
|
9
10
|
tests/test_groq.py,sha256=5RA6uFC6qra-Do55f6HUotk3EQqOosw0GjOGiHDBS4o,4071
|
|
@@ -17,20 +18,20 @@ vectara_agentic/__init__.py,sha256=2GLDS3U6KckK-dBRl9v_x1kSV507gEhjOfuMmmu0Qxg,8
|
|
|
17
18
|
vectara_agentic/_callback.py,sha256=ron49t1t-ox-736WaXzrZ99vhN4NI9bMiHFyj0iIPqg,13062
|
|
18
19
|
vectara_agentic/_observability.py,sha256=UbJxiOJFOdLq3b1t0-Y7swMC3BzJu3IOlTUM-c1oUk8,4328
|
|
19
20
|
vectara_agentic/_prompts.py,sha256=vAb02oahA7GKRgLOsDGqgKl-BLBop2AjOlCTgLrf3M4,9694
|
|
20
|
-
vectara_agentic/_version.py,sha256=
|
|
21
|
+
vectara_agentic/_version.py,sha256=UFpxkXKeHSevaFea4W2brcejYQjkcb-LSSVAYobX5C0,66
|
|
21
22
|
vectara_agentic/agent.py,sha256=zJ7ucFf8jc0VO4mTFqujfwREz2B-rJCpIgCJKAtNlEk,54884
|
|
22
23
|
vectara_agentic/agent_config.py,sha256=E-rtYMcpoGxnEAyy8231bizo2n0uGQ2qWxuSgTEfwdQ,4327
|
|
23
24
|
vectara_agentic/agent_endpoint.py,sha256=PzIN7HhEHv8Mq_Zo5cZ2xYrgdv2AN6kx6dc_2AJq28I,7497
|
|
24
25
|
vectara_agentic/db_tools.py,sha256=Kfz6n-rSj5TQEbAiJnWGmqWtcwB0A5GpxD7d1UwGzlc,11194
|
|
25
|
-
vectara_agentic/llm_utils.py,sha256=
|
|
26
|
+
vectara_agentic/llm_utils.py,sha256=K-rtHq4iNQiT2Jqp_gIJdbFtCheawe_3mvA6mr8JczY,5967
|
|
26
27
|
vectara_agentic/sub_query_workflow.py,sha256=cPeossVPFajpSAwy45fSXhTXbQOfzv_l66pxSa4molM,12366
|
|
27
28
|
vectara_agentic/tool_utils.py,sha256=jv98vCMYb9afFa-HaPxI2A8BXxplfQRv2Z9b5w7ztZc,18919
|
|
28
29
|
vectara_agentic/tools.py,sha256=2_9YBqszFqYDpvlTIZfdfplRKffe660jQRxp0akM-cE,32918
|
|
29
30
|
vectara_agentic/tools_catalog.py,sha256=cAN_kDOWZUoW4GNFwY5GdS6ImMUQNnF2sggx9OGK9Cg,4906
|
|
30
31
|
vectara_agentic/types.py,sha256=HcS7vR8P2v2xQTlOc6ZFV2vvlr3OpzSNWhtcLMxqUZc,1792
|
|
31
32
|
vectara_agentic/utils.py,sha256=R9HitEG5K3Q_p2M_teosT181OUxkhs1-hnj98qDYGbE,2545
|
|
32
|
-
vectara_agentic-0.2.
|
|
33
|
-
vectara_agentic-0.2.
|
|
34
|
-
vectara_agentic-0.2.
|
|
35
|
-
vectara_agentic-0.2.
|
|
36
|
-
vectara_agentic-0.2.
|
|
33
|
+
vectara_agentic-0.2.20.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
34
|
+
vectara_agentic-0.2.20.dist-info/METADATA,sha256=Q4SUWtoG_rVZ6mfPFexFq8YYMVV-3G1Aa2qoegJkmjs,30323
|
|
35
|
+
vectara_agentic-0.2.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
vectara_agentic-0.2.20.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
37
|
+
vectara_agentic-0.2.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|