vectara-agentic 0.1.14__py3-none-any.whl → 0.1.15__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/_prompts.py +1 -0
- vectara_agentic/tools.py +2 -4
- vectara_agentic/tools_catalog.py +3 -15
- vectara_agentic/utils.py +2 -4
- {vectara_agentic-0.1.14.dist-info → vectara_agentic-0.1.15.dist-info}/METADATA +2 -2
- vectara_agentic-0.1.15.dist-info/RECORD +17 -0
- vectara_agentic-0.1.14.dist-info/RECORD +0 -17
- {vectara_agentic-0.1.14.dist-info → vectara_agentic-0.1.15.dist-info}/LICENSE +0 -0
- {vectara_agentic-0.1.14.dist-info → vectara_agentic-0.1.15.dist-info}/WHEEL +0 -0
- {vectara_agentic-0.1.14.dist-info → vectara_agentic-0.1.15.dist-info}/top_level.txt +0 -0
vectara_agentic/__init__.py
CHANGED
vectara_agentic/_prompts.py
CHANGED
|
@@ -20,6 +20,7 @@ GENERAL_INSTRUCTIONS = """
|
|
|
20
20
|
- Be very careful to respond only when you are confident the response is accurate and not a hallucination.
|
|
21
21
|
- If including latex equations in the markdown response, make sure the equations are on a separate line and enclosed in double dollar signs.
|
|
22
22
|
- Always respond in the language of the question, and in text (no images, videos or code).
|
|
23
|
+
- Always call the "get_bad_topics" tool to determine the topics you are not allowed to discuss or respond to.
|
|
23
24
|
"""
|
|
24
25
|
|
|
25
26
|
#
|
vectara_agentic/tools.py
CHANGED
|
@@ -22,7 +22,7 @@ from .tools_catalog import (
|
|
|
22
22
|
summarize_text,
|
|
23
23
|
rephrase_text,
|
|
24
24
|
critique_text,
|
|
25
|
-
|
|
25
|
+
get_bad_topics,
|
|
26
26
|
db_load_sample_data
|
|
27
27
|
)
|
|
28
28
|
|
|
@@ -387,9 +387,7 @@ class ToolsFactory:
|
|
|
387
387
|
Create a list of guardrail tools to avoid controversial topics.
|
|
388
388
|
"""
|
|
389
389
|
return [
|
|
390
|
-
self.create_tool(
|
|
391
|
-
avoid_topics_tool(["politics", "religion", "voilence", "hate speech", "adult content", "illegal activities"])
|
|
392
|
-
)
|
|
390
|
+
self.create_tool(get_bad_topics)
|
|
393
391
|
]
|
|
394
392
|
|
|
395
393
|
def financial_tools(self):
|
vectara_agentic/tools_catalog.py
CHANGED
|
@@ -122,23 +122,11 @@ def critique_text(
|
|
|
122
122
|
#
|
|
123
123
|
# Guardrails tools
|
|
124
124
|
#
|
|
125
|
-
def
|
|
126
|
-
text: str = Field(description="the original text."),
|
|
127
|
-
topics_to_avoid: List[str] = Field(default=["politics", "religion", "violence", "hate speech", "adult content", "illegal activities"],
|
|
128
|
-
description="List of topics to avoid.")
|
|
129
|
-
) -> str:
|
|
125
|
+
def get_bad_topics() -> List[str]:
|
|
130
126
|
"""
|
|
131
|
-
|
|
132
|
-
Given the input text, rephrases the text to ensure that the response avoids of the topics listed in 'topics_to_avoid'.
|
|
133
|
-
|
|
134
|
-
Args:
|
|
135
|
-
text (str): The original text.
|
|
136
|
-
topics_to_avoid (List[str]): A list of topics to avoid.
|
|
137
|
-
|
|
138
|
-
Returns:
|
|
139
|
-
str: The rephrased text.
|
|
127
|
+
Get the list of topics to avoid in the response.
|
|
140
128
|
"""
|
|
141
|
-
return
|
|
129
|
+
return ["politics", "religion", "violence", "hate speech", "adult content", "illegal activities"]
|
|
142
130
|
|
|
143
131
|
#
|
|
144
132
|
# Additional database tool
|
vectara_agentic/utils.py
CHANGED
|
@@ -3,14 +3,13 @@ Utilities for the Vectara agentic.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
import tiktoken
|
|
7
|
+
from typing import Tuple, Callable, Optional
|
|
6
8
|
|
|
7
9
|
from llama_index.core.llms import LLM
|
|
8
10
|
from llama_index.llms.openai import OpenAI
|
|
9
11
|
from llama_index.llms.anthropic import Anthropic
|
|
10
12
|
|
|
11
|
-
import tiktoken
|
|
12
|
-
from typing import Tuple, Callable, Optional
|
|
13
|
-
|
|
14
13
|
from .types import LLMRole, AgentType, ModelProvider
|
|
15
14
|
|
|
16
15
|
provider_to_default_model_name = {
|
|
@@ -25,7 +24,6 @@ provider_to_default_model_name = {
|
|
|
25
24
|
|
|
26
25
|
DEFAULT_MODEL_PROVIDER = ModelProvider.OPENAI
|
|
27
26
|
|
|
28
|
-
|
|
29
27
|
def _get_llm_params_for_role(role: LLMRole) -> Tuple[ModelProvider, str]:
|
|
30
28
|
"""Get the model provider and model name for the specified role."""
|
|
31
29
|
if role == LLMRole.TOOL:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vectara_agentic
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.15
|
|
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
|
|
@@ -46,7 +46,7 @@ Requires-Dist: python-dotenv==1.0.1
|
|
|
46
46
|
Requires-Dist: tiktoken==0.7.0
|
|
47
47
|
Requires-Dist: dill==0.3.8
|
|
48
48
|
|
|
49
|
-
# <img src=".github/assets/Vectara-logo.png" alt="Vectara Logo" width="30" height="30" style="vertical-align: middle;"> vectara-agentic
|
|
49
|
+
# <img src="https://raw.githubusercontent.com/vectara/py-vectara-agentic/main/.github/assets/Vectara-logo.png" alt="Vectara Logo" width="30" height="30" style="vertical-align: middle;"> vectara-agentic
|
|
50
50
|
|
|
51
51
|
<p align="center">
|
|
52
52
|
<a href="https://vectara.github.io/vectara-agentic-docs">Documentation</a> ·
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
tests/test_agent.py,sha256=aQYYr_8hKlFiDgyI5Dd39TG5vkmDJe7F_nIzMTCLsTQ,2517
|
|
3
|
+
tests/test_tools.py,sha256=hDAlXkWKuXHnAjeQwMuTLTwNdRsM-xR7muBzFkZRefw,2942
|
|
4
|
+
vectara_agentic/__init__.py,sha256=6fUc3UCD7OWmxCM2fo4jLGLEgFsm_qOj6Fi0xOqOhvA,449
|
|
5
|
+
vectara_agentic/_callback.py,sha256=oRbGfSZtoG6UZA0LLbHtoUd1b3v7ACoc_CvIcHQOSqM,4670
|
|
6
|
+
vectara_agentic/_observability.py,sha256=6QGcVGt5mf0IXTS5EMZ6jUGCqZwZ6DGeTtPFnOnGSKg,3694
|
|
7
|
+
vectara_agentic/_prompts.py,sha256=opo4R3vrAmxKV42zTgT6XGYVavyrHILyvp7uGYR9wag,4839
|
|
8
|
+
vectara_agentic/agent.py,sha256=DBTAVup0lZe-gG_nCXzxcdtX7XUDSeW7dAg7eNsAQac,18414
|
|
9
|
+
vectara_agentic/tools.py,sha256=9fPsXpLsPZCcAs_sn99k8fDqmYdearCAK_J-I_rwQdI,19327
|
|
10
|
+
vectara_agentic/tools_catalog.py,sha256=PVOs5vesVwaGy3tMYWdLJbakFvA2okge6wniFdStbI0,4948
|
|
11
|
+
vectara_agentic/types.py,sha256=SGkqKusZC6RpRnWdD2YSUq4uMQ3B4jP6qBWehPmeOdI,1132
|
|
12
|
+
vectara_agentic/utils.py,sha256=HqCf0W0HqNBhaDznF9EOaF8m40MIJlKW3-GoCsKSEG0,3795
|
|
13
|
+
vectara_agentic-0.1.15.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
vectara_agentic-0.1.15.dist-info/METADATA,sha256=PdhPd5XQxWsWPxiEO6qs6KNTHpx8Mphmxx-naXJu2m0,12080
|
|
15
|
+
vectara_agentic-0.1.15.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
16
|
+
vectara_agentic-0.1.15.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
17
|
+
vectara_agentic-0.1.15.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
tests/test_agent.py,sha256=aQYYr_8hKlFiDgyI5Dd39TG5vkmDJe7F_nIzMTCLsTQ,2517
|
|
3
|
-
tests/test_tools.py,sha256=hDAlXkWKuXHnAjeQwMuTLTwNdRsM-xR7muBzFkZRefw,2942
|
|
4
|
-
vectara_agentic/__init__.py,sha256=Byj1d6B-DWzwa-vvRsbh4dcfHDgH5AnP-AUaBFLi7c0,449
|
|
5
|
-
vectara_agentic/_callback.py,sha256=oRbGfSZtoG6UZA0LLbHtoUd1b3v7ACoc_CvIcHQOSqM,4670
|
|
6
|
-
vectara_agentic/_observability.py,sha256=6QGcVGt5mf0IXTS5EMZ6jUGCqZwZ6DGeTtPFnOnGSKg,3694
|
|
7
|
-
vectara_agentic/_prompts.py,sha256=BhvNiGcmkt7aIf888FtG4Pum-ZEh--pbqtTp70ZISoY,4729
|
|
8
|
-
vectara_agentic/agent.py,sha256=DBTAVup0lZe-gG_nCXzxcdtX7XUDSeW7dAg7eNsAQac,18414
|
|
9
|
-
vectara_agentic/tools.py,sha256=HMXvCcEqXszlidoFigEutuk-7WlJlkeG_fc6Jr_gG_A,19455
|
|
10
|
-
vectara_agentic/tools_catalog.py,sha256=qojmqmA3DGYzA0mdeS0vycCh7w_R-3RMoV56lyYrbhw,5519
|
|
11
|
-
vectara_agentic/types.py,sha256=SGkqKusZC6RpRnWdD2YSUq4uMQ3B4jP6qBWehPmeOdI,1132
|
|
12
|
-
vectara_agentic/utils.py,sha256=TY0EHZ1vyc_xNKJoJYGdIce21_M3tQI50Hjumv-eOII,3797
|
|
13
|
-
vectara_agentic-0.1.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
-
vectara_agentic-0.1.14.dist-info/METADATA,sha256=_OpYgV5AkGZerUdZ34YweTU9SW4uPsAp87AgNofq4RE,12014
|
|
15
|
-
vectara_agentic-0.1.14.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
16
|
-
vectara_agentic-0.1.14.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
17
|
-
vectara_agentic-0.1.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|