langroid 0.56.14__tar.gz → 0.56.16__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.56.14 → langroid-0.56.16}/PKG-INFO +1 -1
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/task.py +12 -21
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/openai_gpt.py +2 -2
- {langroid-0.56.14 → langroid-0.56.16}/pyproject.toml +1 -1
- {langroid-0.56.14 → langroid-0.56.16}/.gitignore +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/LICENSE +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/README.md +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/base.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/batch.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/chat_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/chat_document.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/done_sequence_parser.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/arangodb/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/arangodb/arangodb_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/arangodb/system_messages.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/arangodb/tools.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/arangodb/utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/doc_chat_task.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/neo4j/system_messages.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/neo4j/tools.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tool_message.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/exa_search_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/file_tools.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/mcp/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/mcp/decorators.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/mcp/fastmcp_client.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/orchestration.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/rewind_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/task_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/tools/tavily_search_tool.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/agent/xml_tool_message.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/cachedb/base.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/base.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/models.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/exceptions.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/base.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/client_cache.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/config.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/mock_lm.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/model_info.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/provider_params.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/mcp/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/mcp/server/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/mytypes.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/file_attachment.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/md_parser.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/parser.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/pdf_utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/routing.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/search.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/spider.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/urls.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/parsing/web_search.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/prompts/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/prompts/dialog.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/prompts/templates.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/py.typed +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/pydantic_v1/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/pydantic_v1/main.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/configuration.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/constants.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/git_utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/globals.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/logging.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/object_registry.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/output/citations.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/output/printing.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/output/status.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/system.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/utils/types.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/base.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/pineconedb.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/postgres.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/qdrantdb.py +0 -0
- {langroid-0.56.14 → langroid-0.56.16}/langroid/vector_store/weaviatedb.py +0 -0
@@ -409,6 +409,8 @@ class Task:
|
|
409
409
|
self.llm_delegate = llm_delegate
|
410
410
|
# Track last responder for done sequence checking
|
411
411
|
self._last_responder: Optional[Responder] = None
|
412
|
+
# Track response sequence for message chain
|
413
|
+
self.response_sequence: List[ChatDocument] = []
|
412
414
|
if llm_delegate:
|
413
415
|
if self.single_round:
|
414
416
|
# 0: User instructs (delegating to LLM);
|
@@ -761,6 +763,13 @@ class Task:
|
|
761
763
|
while True:
|
762
764
|
self._step_idx = i # used in step() below
|
763
765
|
self.step()
|
766
|
+
# Track pending message in response sequence
|
767
|
+
if self.pending_message is not None:
|
768
|
+
if (
|
769
|
+
not self.response_sequence
|
770
|
+
or self.pending_message.id() != self.response_sequence[-1].id()
|
771
|
+
):
|
772
|
+
self.response_sequence.append(self.pending_message)
|
764
773
|
done, status = self.done()
|
765
774
|
if done:
|
766
775
|
if self._level == 0 and not settings.quiet:
|
@@ -2257,33 +2266,15 @@ class Task:
|
|
2257
2266
|
def _get_message_chain(
|
2258
2267
|
self, msg: ChatDocument | None, max_depth: Optional[int] = None
|
2259
2268
|
) -> List[ChatDocument]:
|
2260
|
-
"""Get the chain of messages
|
2269
|
+
"""Get the chain of messages from response sequence."""
|
2261
2270
|
if max_depth is None:
|
2262
2271
|
# Get max depth needed from all sequences
|
2263
2272
|
max_depth = 50 # default fallback
|
2264
2273
|
if self._parsed_done_sequences:
|
2265
2274
|
max_depth = max(len(seq.events) for seq in self._parsed_done_sequences)
|
2266
2275
|
|
2267
|
-
#
|
2268
|
-
|
2269
|
-
m.chat_document_id for m in self.agent.message_history if m.chat_document_id
|
2270
|
-
]
|
2271
|
-
|
2272
|
-
# Add current message ID if it exists and is not already the last one
|
2273
|
-
if msg:
|
2274
|
-
msg_id = msg.id()
|
2275
|
-
if not doc_ids or doc_ids[-1] != msg_id:
|
2276
|
-
doc_ids.append(msg_id)
|
2277
|
-
|
2278
|
-
# Take only the last max_depth elements
|
2279
|
-
relevant_ids = doc_ids[-max_depth:]
|
2280
|
-
|
2281
|
-
# Convert IDs to ChatDocuments and filter out None values
|
2282
|
-
return [
|
2283
|
-
doc
|
2284
|
-
for doc_id in relevant_ids
|
2285
|
-
if (doc := ChatDocument.from_id(doc_id)) is not None
|
2286
|
-
]
|
2276
|
+
# Simply return the last max_depth elements from response_sequence
|
2277
|
+
return self.response_sequence[-max_depth:]
|
2287
2278
|
|
2288
2279
|
def _matches_event(self, actual: AgentEvent, expected: AgentEvent) -> bool:
|
2289
2280
|
"""Check if an actual event matches an expected event pattern."""
|
@@ -203,8 +203,8 @@ class OpenAICallParams(BaseModel):
|
|
203
203
|
https://platform.openai.com/docs/api-reference/chat
|
204
204
|
"""
|
205
205
|
|
206
|
-
max_tokens: int =
|
207
|
-
temperature: float =
|
206
|
+
max_tokens: int | None = None
|
207
|
+
temperature: float | None = None
|
208
208
|
frequency_penalty: float | None = None # between -2 and 2
|
209
209
|
presence_penalty: float | None = None # between -2 and 2
|
210
210
|
response_format: Dict[str, str] | None = None
|
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.56.14 → langroid-0.56.16}/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.56.14 → langroid-0.56.16}/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
|
{langroid-0.56.14 → langroid-0.56.16}/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
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.56.14 → langroid-0.56.16}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.56.14 → langroid-0.56.16}/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
|