langroid 0.10.1__tar.gz → 0.10.2__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.10.1 → langroid-0.10.2}/PKG-INFO +1 -1
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/base.py +0 -1
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/chat_agent.py +10 -1
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/lance_rag/critic_agent.py +1 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/lance_rag/query_planner_agent.py +1 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/task.py +1 -4
- {langroid-0.10.1 → langroid-0.10.2}/pyproject.toml +4 -3
- {langroid-0.10.1 → langroid-0.10.2}/LICENSE +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/README.md +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/batch.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/chat_document.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/helpers.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/junk +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/neo4j/utils/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/neo4j/utils/system_message.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/structured_message.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tool_message.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/extract_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/generator_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/note_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/orchestration.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/rewind_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/run_python_code.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent/typed_task.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/agent_config.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/cachedb/base.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/base.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/clustering.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/models.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/exceptions.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/.chainlit/config.toml +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/.chainlit/translations/en-US.json +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/base.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/config.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/mock_lm.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/openai_gpt.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/language_models/utils.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/mytypes.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/code-parsing.md +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/config.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/image_text.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/parser.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/routing.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/search.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/spider.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/url_loader_cookies.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/urls.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/utils.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/parsing/web_search.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/prompts/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/prompts/chat-gpt4-system-prompt.md +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/prompts/dialog.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/prompts/templates.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/pydantic_v1/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/pydantic_v1/main.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/configuration.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/constants.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/docker.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/globals.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/llms/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/llms/strings.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/logging.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/object_registry.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/output/citations.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/output/printing.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/output/status.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/system.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/web/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/utils/web/login.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/base.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/momento.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/qdrant_cloud.py +0 -0
- {langroid-0.10.1 → langroid-0.10.2}/langroid/vector_store/qdrantdb.py +0 -0
@@ -118,7 +118,7 @@ class ChatAgent(Agent):
|
|
118
118
|
self.config: ChatAgentConfig = config
|
119
119
|
self.config._set_fn_or_tools(self._fn_call_available())
|
120
120
|
self.message_history: List[LLMMessage] = []
|
121
|
-
self.
|
121
|
+
self.init_state()
|
122
122
|
# An agent's "task" is defined by a system msg and an optional user msg;
|
123
123
|
# These are "priming" messages that kick off the agent's conversation.
|
124
124
|
self.system_message: str = self.config.system_message
|
@@ -172,6 +172,15 @@ class ChatAgent(Agent):
|
|
172
172
|
self.enable_message(SendTool, use=False, handle=True)
|
173
173
|
self.enable_message(AgentSendTool, use=False, handle=True)
|
174
174
|
|
175
|
+
def init_state(self) -> None:
|
176
|
+
"""
|
177
|
+
Initialize the state of the agent. Just conversation state here,
|
178
|
+
but subclasses can override this to initialize other state.
|
179
|
+
"""
|
180
|
+
super().init_state()
|
181
|
+
self.clear_history(0)
|
182
|
+
self.clear_dialog()
|
183
|
+
|
175
184
|
@staticmethod
|
176
185
|
def from_id(id: str) -> "ChatAgent":
|
177
186
|
"""
|
@@ -169,6 +169,7 @@ class QueryPlanCritic(ChatAgent):
|
|
169
169
|
self.enable_message(AgentDoneTool, use=False, handle=True)
|
170
170
|
|
171
171
|
def init_state(self) -> None:
|
172
|
+
super().init_state()
|
172
173
|
self.expecting_feedback_tool = False
|
173
174
|
|
174
175
|
def query_plan_answer(self, msg: QueryPlanAnswerTool) -> str:
|
@@ -144,6 +144,7 @@ class LanceQueryPlanAgent(ChatAgent):
|
|
144
144
|
self.enable_message(AgentDoneTool, use=False, handle=True)
|
145
145
|
|
146
146
|
def init_state(self) -> None:
|
147
|
+
super().init_state()
|
147
148
|
self.curr_query_plan: QueryPlan | None = None
|
148
149
|
self.expecting_query_plan: bool = False
|
149
150
|
# how many times re-trying query plan in response to feedback:
|
@@ -259,8 +259,7 @@ class Task:
|
|
259
259
|
agent = cast(ChatAgent, agent)
|
260
260
|
self.agent: ChatAgent = agent
|
261
261
|
if isinstance(agent, ChatAgent) and len(agent.message_history) == 0 or restart:
|
262
|
-
self.agent.
|
263
|
-
self.agent.clear_dialog()
|
262
|
+
self.agent.init_state()
|
264
263
|
# possibly change the system and user messages
|
265
264
|
if system_message:
|
266
265
|
# we always have at least 1 task_message
|
@@ -579,8 +578,6 @@ class Task:
|
|
579
578
|
Recursively reset message history & state of own agent and
|
580
579
|
those of all sub-tasks.
|
581
580
|
"""
|
582
|
-
self.agent.clear_history(0)
|
583
|
-
self.agent.clear_dialog()
|
584
581
|
self.agent.init_state()
|
585
582
|
for t in self.sub_tasks:
|
586
583
|
t.reset_all_sub_tasks()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "langroid"
|
3
|
-
version = "0.10.
|
3
|
+
version = "0.10.2"
|
4
4
|
description = "Harness LLMs with Multi-Agent Programming"
|
5
5
|
authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
|
6
6
|
readme = "README.md"
|
@@ -90,6 +90,7 @@ async-generator = "^1.10"
|
|
90
90
|
python-magic = "^0.4.27"
|
91
91
|
json-repair = "^0.27.0"
|
92
92
|
|
93
|
+
|
93
94
|
[tool.poetry.extras]
|
94
95
|
# install these using, e.g.,
|
95
96
|
# `poetry install -E [...]` where [...] is one of the extras below
|
@@ -169,14 +170,14 @@ optional = true
|
|
169
170
|
|
170
171
|
mkdocs = "^1.4.2"
|
171
172
|
mkdocs-material = "^9.1.5"
|
172
|
-
mkdocstrings = {extras = ["python"], version = "^0.
|
173
|
+
mkdocstrings = {extras = ["python"], version = "^0.25.2"}
|
173
174
|
mkdocs-awesome-pages-plugin = "^2.8.0"
|
174
175
|
mkdocs-rss-plugin = "^1.8.0"
|
175
176
|
mkdocs-gen-files = "^0.4.0"
|
176
177
|
mkdocs-literate-nav = "^0.6.0"
|
177
178
|
mkdocs-section-index = "^0.3.5"
|
178
179
|
mkdocs-jupyter = "^0.24.1"
|
179
|
-
|
180
|
+
griffe = "<1.0.0"
|
180
181
|
|
181
182
|
|
182
183
|
# ========================================
|
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.10.1 → langroid-0.10.2}/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
|
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.10.1 → langroid-0.10.2}/langroid/language_models/.chainlit/translations/en-US.json
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.10.1 → langroid-0.10.2}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.10.1 → langroid-0.10.2}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|