langroid 0.39.1__tar.gz → 0.39.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.39.1 → langroid-0.39.2}/PKG-INFO +1 -1
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/chat_agent.py +18 -7
- {langroid-0.39.1 → langroid-0.39.2}/langroid/mytypes.py +1 -1
- {langroid-0.39.1 → langroid-0.39.2}/pyproject.toml +1 -1
- {langroid-0.39.1 → langroid-0.39.2}/.gitignore +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/LICENSE +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/README.md +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/base.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/batch.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/chat_document.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/arangodb/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/arangodb/arangodb_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/arangodb/system_messages.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/arangodb/tools.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/arangodb/utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/neo4j/system_messages.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/neo4j/tools.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/task.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tool_message.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/file_tools.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/orchestration.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/rewind_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/agent/xml_tool_message.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/cachedb/base.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/base.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/models.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/exceptions.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/base.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/config.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/mock_lm.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/model_info.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/openai_gpt.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/parser.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/pdf_utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/routing.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/search.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/spider.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/urls.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/parsing/web_search.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/prompts/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/prompts/dialog.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/prompts/templates.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/py.typed +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/pydantic_v1/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/pydantic_v1/main.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/configuration.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/constants.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/git_utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/globals.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/logging.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/object_registry.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/output/citations.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/output/printing.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/output/status.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/system.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/utils/types.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/base.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/momento.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/qdrantdb.py +0 -0
- {langroid-0.39.1 → langroid-0.39.2}/langroid/vector_store/weaviatedb.py +0 -0
@@ -46,6 +46,7 @@ logger = logging.getLogger(__name__)
|
|
46
46
|
class ChatAgentConfig(AgentConfig):
|
47
47
|
"""
|
48
48
|
Configuration for ChatAgent
|
49
|
+
|
49
50
|
Attributes:
|
50
51
|
system_message: system message to include in message sequence
|
51
52
|
(typically defines role and task of agent).
|
@@ -53,7 +54,8 @@ class ChatAgentConfig(AgentConfig):
|
|
53
54
|
user_message: user message to include in message sequence.
|
54
55
|
Used only if `task` is not specified in the constructor.
|
55
56
|
use_tools: whether to use our own ToolMessages mechanism
|
56
|
-
handle_llm_no_tool (
|
57
|
+
handle_llm_no_tool (Any): desired agent_response when
|
58
|
+
LLM generates non-tool msg.
|
57
59
|
use_functions_api: whether to use functions/tools native to the LLM API
|
58
60
|
(e.g. OpenAI's `function_call` or `tool_call` mechanism)
|
59
61
|
use_tools_api: When `use_functions_api` is True, if this is also True,
|
@@ -86,7 +88,7 @@ class ChatAgentConfig(AgentConfig):
|
|
86
88
|
|
87
89
|
system_message: str = "You are a helpful assistant."
|
88
90
|
user_message: Optional[str] = None
|
89
|
-
handle_llm_no_tool:
|
91
|
+
handle_llm_no_tool: Any = None
|
90
92
|
use_tools: bool = False
|
91
93
|
use_functions_api: bool = True
|
92
94
|
use_tools_api: bool = False
|
@@ -601,11 +603,20 @@ class ChatAgent(Agent):
|
|
601
603
|
if isinstance(msg, ChatDocument) and msg.metadata.sender == Entity.LLM:
|
602
604
|
from langroid.agent.tools.orchestration import AgentDoneTool, ForwardTool
|
603
605
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
606
|
+
no_tool_option = self.config.handle_llm_no_tool
|
607
|
+
if no_tool_option in list(NonToolAction):
|
608
|
+
# in case the `no_tool_option` is one of the special NonToolAction vals
|
609
|
+
match self.config.handle_llm_no_tool:
|
610
|
+
case NonToolAction.FORWARD_USER:
|
611
|
+
return ForwardTool(agent="User")
|
612
|
+
case NonToolAction.DONE:
|
613
|
+
return AgentDoneTool(
|
614
|
+
content=msg.content, tools=msg.tool_messages
|
615
|
+
)
|
616
|
+
# Otherwise just return `no_tool_option` as is:
|
617
|
+
# This can be any string, such as a specific nudge/reminder to the LLM,
|
618
|
+
# or even something like ResultTool etc.
|
619
|
+
return no_tool_option
|
609
620
|
|
610
621
|
def unhandled_tools(self) -> set[str]:
|
611
622
|
"""The set of tools that are known but not handled.
|
@@ -97,7 +97,7 @@ class Document(BaseModel):
|
|
97
97
|
|
98
98
|
class NonToolAction(str, Enum):
|
99
99
|
"""
|
100
|
-
Possible
|
100
|
+
Possible options to handle non-tool msgs from LLM.
|
101
101
|
"""
|
102
102
|
|
103
103
|
FORWARD_USER = "user" # forward msg to user
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
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.39.1 → langroid-0.39.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
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.39.1 → langroid-0.39.2}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.39.1 → langroid-0.39.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
|