langroid 0.1.226__tar.gz → 0.1.228__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.
- {langroid-0.1.226 → langroid-0.1.228}/PKG-INFO +2 -5
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/openai_assistant.py +10 -2
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/doc_chat_agent.py +5 -3
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/openai_gpt.py +1 -1
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/qdrantdb.py +4 -4
- {langroid-0.1.226 → langroid-0.1.228}/pyproject.toml +2 -4
- langroid-0.1.226/langroid/agent/tools/sciphi_search_rag_tool.py +0 -79
- {langroid-0.1.226 → langroid-0.1.228}/LICENSE +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/README.md +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/base.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/batch.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/chat_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/chat_document.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/helpers.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/junk +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/neo4j/utils/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/neo4j/utils/system_message.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/task.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tool_message.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/extract_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/generator_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/run_python_code.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/agent_config.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/cachedb/base.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/base.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/clustering.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/models.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/base.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/config.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/openai_assistants.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/utils.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/mytypes.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/code-parsing.md +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/config.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/image_text.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/parser.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/search.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/spider.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/url_loader_cookies.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/urls.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/utils.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/parsing/web_search.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/prompts/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/prompts/chat-gpt4-system-prompt.md +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/prompts/dialog.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/prompts/templates.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/prompts/transforms.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/configuration.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/constants.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/docker.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/globals.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/llms/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/llms/strings.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/logging.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/output/printing.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/output/status.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/system.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/web/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/utils/web/login.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/base.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/momento.py +0 -0
- {langroid-0.1.226 → langroid-0.1.228}/langroid/vector_store/qdrant_cloud.py +0 -0
@@ -1,14 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: langroid
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.228
|
4
4
|
Summary: Harness LLMs with Multi-Agent Programming
|
5
5
|
License: MIT
|
6
6
|
Author: Prasad Chalasani
|
7
7
|
Author-email: pchalasani@gmail.com
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.11,<3.12
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
12
11
|
Classifier: Programming Language :: Python :: 3.11
|
13
12
|
Provides-Extra: chainlit
|
14
13
|
Provides-Extra: chromadb
|
@@ -19,10 +18,8 @@ Provides-Extra: mkdocs
|
|
19
18
|
Provides-Extra: mysql
|
20
19
|
Provides-Extra: neo4j
|
21
20
|
Provides-Extra: postgres
|
22
|
-
Provides-Extra: sciphi
|
23
21
|
Provides-Extra: transformers
|
24
22
|
Provides-Extra: unstructured
|
25
|
-
Requires-Dist: agent-search (>=0.0.7,<0.0.8) ; extra == "sciphi"
|
26
23
|
Requires-Dist: aiohttp (>=3.9.1,<4.0.0)
|
27
24
|
Requires-Dist: async-generator (>=1.10,<2.0)
|
28
25
|
Requires-Dist: autopep8 (>=2.0.2,<3.0.0)
|
@@ -8,6 +8,10 @@ from enum import Enum
|
|
8
8
|
from typing import Any, Dict, List, Optional, Tuple, Type, cast, no_type_check
|
9
9
|
|
10
10
|
from openai.types.beta import Assistant, Thread
|
11
|
+
from openai.types.beta.assistant_update_params import (
|
12
|
+
ToolResources,
|
13
|
+
ToolResourcesCodeInterpreter,
|
14
|
+
)
|
11
15
|
from openai.types.beta.threads import Message, Run
|
12
16
|
from openai.types.beta.threads.runs import RunStep
|
13
17
|
from pydantic import BaseModel
|
@@ -29,7 +33,7 @@ logger = logging.getLogger(__name__)
|
|
29
33
|
|
30
34
|
|
31
35
|
class ToolType(str, Enum):
|
32
|
-
RETRIEVAL = "
|
36
|
+
RETRIEVAL = "file_search"
|
33
37
|
CODE_INTERPRETER = "code_interpreter"
|
34
38
|
FUNCTION = "function"
|
35
39
|
|
@@ -127,7 +131,11 @@ class OpenAIAssistant(ChatAgent):
|
|
127
131
|
self.config.files = list(set(self.config.files + files))
|
128
132
|
self.assistant = self.assistants.update(
|
129
133
|
self.assistant.id,
|
130
|
-
|
134
|
+
tool_resources=ToolResources(
|
135
|
+
code_interpreter=ToolResourcesCodeInterpreter(
|
136
|
+
file_ids=[f.id for f in self.files],
|
137
|
+
),
|
138
|
+
),
|
131
139
|
)
|
132
140
|
|
133
141
|
def add_assistant_tools(self, tools: List[AssistantTool]) -> None:
|
@@ -169,7 +169,8 @@ class DocChatAgentConfig(ChatAgentConfig):
|
|
169
169
|
dims=1536,
|
170
170
|
)
|
171
171
|
|
172
|
-
vecdb
|
172
|
+
# Allow vecdb to be None in case we want to explicitly set it later
|
173
|
+
vecdb: Optional[VectorStoreConfig] = LanceDBConfig(
|
173
174
|
collection_name="doc-chat-lancedb",
|
174
175
|
replace_collection=True,
|
175
176
|
storage_path=".lancedb/data/",
|
@@ -209,12 +210,13 @@ class DocChatAgent(ChatAgent):
|
|
209
210
|
|
210
211
|
def clear(self) -> None:
|
211
212
|
"""Clear the document collection and the specific collection in vecdb"""
|
212
|
-
if self.vecdb is None:
|
213
|
-
raise ValueError("VecDB not set")
|
214
213
|
self.original_docs = []
|
215
214
|
self.original_docs_length = 0
|
216
215
|
self.chunked_docs = []
|
217
216
|
self.chunked_docs_clean = []
|
217
|
+
if self.vecdb is None:
|
218
|
+
logger.warning("Attempting to clear VecDB, but VecDB not set.")
|
219
|
+
return
|
218
220
|
collection_name = self.vecdb.config.collection_name
|
219
221
|
if collection_name is None:
|
220
222
|
return
|
@@ -192,8 +192,7 @@ class QdrantDB(VectorStore):
|
|
192
192
|
with the same name. Defaults to False.
|
193
193
|
"""
|
194
194
|
self.config.collection_name = collection_name
|
195
|
-
|
196
|
-
if collection_name in collections:
|
195
|
+
if self.client.collection_exists(collection_name=collection_name):
|
197
196
|
coll = self.client.get_collection(collection_name=collection_name)
|
198
197
|
if (
|
199
198
|
coll.status == CollectionStatus.GREEN
|
@@ -205,7 +204,8 @@ class QdrantDB(VectorStore):
|
|
205
204
|
return
|
206
205
|
else:
|
207
206
|
logger.warning("Recreating fresh collection")
|
208
|
-
|
207
|
+
self.client.delete_collection(collection_name=collection_name)
|
208
|
+
self.client.create_collection(
|
209
209
|
collection_name=collection_name,
|
210
210
|
vectors_config=VectorParams(
|
211
211
|
size=self.embedding_dim,
|
@@ -214,7 +214,7 @@ class QdrantDB(VectorStore):
|
|
214
214
|
)
|
215
215
|
collection_info = self.client.get_collection(collection_name=collection_name)
|
216
216
|
assert collection_info.status == CollectionStatus.GREEN
|
217
|
-
assert collection_info.vectors_count
|
217
|
+
assert collection_info.vectors_count in [0, None]
|
218
218
|
if settings.debug:
|
219
219
|
level = logger.getEffectiveLevel()
|
220
220
|
logger.setLevel(logging.INFO)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "langroid"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.228"
|
4
4
|
description = "Harness LLMs with Multi-Agent Programming"
|
5
5
|
authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
|
6
6
|
readme = "README.md"
|
7
7
|
license = "MIT"
|
8
8
|
|
9
9
|
[tool.poetry.dependencies]
|
10
|
-
python = ">=3.
|
10
|
+
python = ">=3.11,<3.12"
|
11
11
|
mkdocs = {version="^1.4.2", optional=true}
|
12
12
|
mkdocs-material = {version="^9.1.5", optional=true}
|
13
13
|
mkdocstrings = {extras = ["python"], version = "^0.21.2", optional=true}
|
@@ -84,7 +84,6 @@ lancedb = "^0.6.2"
|
|
84
84
|
pyarrow = "15.0.0"
|
85
85
|
pytest-redis = "^3.0.2"
|
86
86
|
neo4j = {version = "^5.14.1", optional = true}
|
87
|
-
agent-search = {version = "^0.0.7", optional = true}
|
88
87
|
python-docx = "^1.1.0"
|
89
88
|
aiohttp = "^3.9.1"
|
90
89
|
grpcio = "^1.62.1"
|
@@ -108,7 +107,6 @@ postgres = ["psycopg2", "pytest-postgresql"]
|
|
108
107
|
mysql = ["pymysql", "pytest-mysql"]
|
109
108
|
litellm = ["litellm"]
|
110
109
|
neo4j = ["neo4j"]
|
111
|
-
sciphi = ["agent-search"]
|
112
110
|
metaphor = ["metaphor-python"]
|
113
111
|
chainlit = ["chainlit", "python-socketio"]
|
114
112
|
chromadb = ["chromadb"]
|
@@ -1,79 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
A tool which returns a Search RAG response from the SciPhi API.
|
3
|
-
their titles, links, summaries. Since the tool is stateless (i.e. does not need
|
4
|
-
access to agent state), it can be enabled for any agent, without having to define a
|
5
|
-
special method inside the agent: `agent.enable_message(SciPhiSearchRAGTool)`
|
6
|
-
|
7
|
-
Example return output appears as follows below:
|
8
|
-
|
9
|
-
<-- Query -->
|
10
|
-
```
|
11
|
-
Find 3 results on the internet about the LK-99 superconducting material.
|
12
|
-
``
|
13
|
-
|
14
|
-
<-- Response (compressed for this example)-->
|
15
|
-
```
|
16
|
-
[ result1 ]
|
17
|
-
|
18
|
-
[ result2 ]
|
19
|
-
|
20
|
-
[ result3 ]
|
21
|
-
|
22
|
-
```
|
23
|
-
|
24
|
-
NOTE: Using this tool requires getting an API key from sciphi.ai.
|
25
|
-
Setup is as simple as shown below
|
26
|
-
# Get a free API key at https://www.sciphi.ai/account
|
27
|
-
# export SCIPHI_API_KEY=$MY_SCIPHI_API_KEY before running the agent
|
28
|
-
# OR add SCIPHI_API_KEY=$MY_SCIPHI_API_KEY to your .env file
|
29
|
-
|
30
|
-
This tool requires installing langroid with the `sciphi` extra, e.g.
|
31
|
-
`pip install langroid[sciphi]` or `poetry add langroid[sciphi]`
|
32
|
-
(it installs the `agent-search` package from pypi).
|
33
|
-
|
34
|
-
For more information, please refer to the official docs:
|
35
|
-
https://agent-search.readthedocs.io/en/latest/
|
36
|
-
"""
|
37
|
-
|
38
|
-
from typing import List
|
39
|
-
|
40
|
-
try:
|
41
|
-
from agent_search import SciPhi
|
42
|
-
except ImportError:
|
43
|
-
raise ImportError(
|
44
|
-
"You are attempting to use the `agent-search` library;"
|
45
|
-
"To use it, please install langroid with the `sciphi` extra, e.g. "
|
46
|
-
"`pip install langroid[sciphi]` or `poetry add langroid[sciphi]` "
|
47
|
-
"(it installs the `agent-search` package from pypi)."
|
48
|
-
)
|
49
|
-
|
50
|
-
from langroid.agent.tool_message import ToolMessage
|
51
|
-
|
52
|
-
|
53
|
-
class SciPhiSearchRAGTool(ToolMessage):
|
54
|
-
request: str = "web_search_rag"
|
55
|
-
purpose: str = """
|
56
|
-
To search the web with provider <search_provider> and
|
57
|
-
return a response summary with llm model <llm_model> the given <query>.
|
58
|
-
"""
|
59
|
-
query: str
|
60
|
-
|
61
|
-
def handle(self) -> str:
|
62
|
-
rag_response = SciPhi().get_search_rag_response(
|
63
|
-
query=self.query, search_provider="bing", llm_model="SciPhi/Sensei-7B-V1"
|
64
|
-
)
|
65
|
-
result = rag_response["response"]
|
66
|
-
result = (
|
67
|
-
f"### RAG Response:\n{result}\n\n"
|
68
|
-
+ "### Related Queries:\n"
|
69
|
-
+ "\n".join(rag_response["related_queries"])
|
70
|
-
)
|
71
|
-
return result # type: ignore
|
72
|
-
|
73
|
-
@classmethod
|
74
|
-
def examples(cls) -> List["ToolMessage"]:
|
75
|
-
return [
|
76
|
-
cls(
|
77
|
-
query="When was the Llama2 Large Language Model (LLM) released?",
|
78
|
-
),
|
79
|
-
]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/lance_rag/query_planner_agent.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.226 → langroid-0.1.228}/langroid/agent/special/sql/utils/description_extractors.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.226 → langroid-0.1.228}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.1.226 → langroid-0.1.228}/langroid/language_models/prompt_formatter/llama2_formatter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|