langroid 0.9.4__tar.gz → 0.10.0__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.9.4 → langroid-0.10.0}/PKG-INFO +1 -1
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/__init__.py +2 -1
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/base.py +26 -2
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/chat_agent.py +2 -2
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/chat_document.py +3 -1
- langroid-0.10.0/langroid/agent/structured_message.py +9 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/task.py +10 -5
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tool_message.py +26 -0
- {langroid-0.9.4 → langroid-0.10.0}/pyproject.toml +1 -1
- {langroid-0.9.4 → langroid-0.10.0}/LICENSE +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/README.md +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/batch.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/helpers.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/junk +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/neo4j/utils/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/neo4j/utils/system_message.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/extract_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/generator_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/note_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/orchestration.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/rewind_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/run_python_code.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent/typed_task.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/agent_config.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/cachedb/base.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/base.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/clustering.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/models.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/exceptions.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/.chainlit/config.toml +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/.chainlit/translations/en-US.json +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/base.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/config.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/mock_lm.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/openai_gpt.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/language_models/utils.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/mytypes.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/code-parsing.md +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/config.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/image_text.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/parser.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/routing.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/search.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/spider.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/url_loader_cookies.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/urls.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/utils.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/parsing/web_search.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/prompts/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/prompts/chat-gpt4-system-prompt.md +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/prompts/dialog.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/prompts/templates.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/pydantic_v1/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/pydantic_v1/main.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/configuration.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/constants.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/docker.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/globals.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/llms/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/llms/strings.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/logging.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/object_registry.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/output/citations.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/output/printing.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/output/status.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/system.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/web/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/utils/web/login.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/base.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/momento.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/qdrant_cloud.py +0 -0
- {langroid-0.9.4 → langroid-0.10.0}/langroid/vector_store/qdrantdb.py +0 -0
@@ -6,7 +6,7 @@ from .chat_document import (
|
|
6
6
|
ChatDocument,
|
7
7
|
)
|
8
8
|
from .chat_agent import ChatAgentConfig, ChatAgent
|
9
|
-
from .tool_message import ToolMessage
|
9
|
+
from .tool_message import ToolMessage, FinalResultTool
|
10
10
|
from .task import Task
|
11
11
|
|
12
12
|
from . import base
|
@@ -29,6 +29,7 @@ __all__ = [
|
|
29
29
|
"ChatAgent",
|
30
30
|
"ChatAgentConfig",
|
31
31
|
"ToolMessage",
|
32
|
+
"FinalResultTool",
|
32
33
|
"Task",
|
33
34
|
"base",
|
34
35
|
"chat_document",
|
@@ -45,7 +45,13 @@ from langroid.mytypes import Entity
|
|
45
45
|
from langroid.parsing.parse_json import extract_top_level_json
|
46
46
|
from langroid.parsing.parser import Parser, ParsingConfig
|
47
47
|
from langroid.prompts.prompts_config import PromptsConfig
|
48
|
-
from langroid.pydantic_v1 import
|
48
|
+
from langroid.pydantic_v1 import (
|
49
|
+
BaseModel,
|
50
|
+
BaseSettings,
|
51
|
+
Field,
|
52
|
+
ValidationError,
|
53
|
+
validator,
|
54
|
+
)
|
49
55
|
from langroid.utils.configuration import settings
|
50
56
|
from langroid.utils.constants import DONE, NO_ANSWER, PASS, PASS_TO, SEND_TO
|
51
57
|
from langroid.utils.object_registry import ObjectRegistry
|
@@ -1050,6 +1056,7 @@ class Agent(ABC):
|
|
1050
1056
|
"""
|
1051
1057
|
try:
|
1052
1058
|
tools = self.get_tool_messages(msg)
|
1059
|
+
tools = [t for t in tools if self._tool_recipient_match(t)]
|
1053
1060
|
except ValidationError as ve:
|
1054
1061
|
# correct tool name but bad fields
|
1055
1062
|
return self.tool_validation_error(ve)
|
@@ -1300,8 +1307,25 @@ class Agent(ABC):
|
|
1300
1307
|
# else wrap it in an agent response and return it so
|
1301
1308
|
# orchestrator can find a respondent
|
1302
1309
|
result = self.create_agent_response(tool_messages=[maybe_result])
|
1303
|
-
|
1310
|
+
elif isinstance(maybe_result, (ChatDocument, str)):
|
1304
1311
|
result = maybe_result
|
1312
|
+
elif isinstance(maybe_result, BaseModel):
|
1313
|
+
result = maybe_result.json()
|
1314
|
+
else:
|
1315
|
+
# last resort: use json.dumps() or str() to make it a str
|
1316
|
+
try:
|
1317
|
+
result = json.dumps(maybe_result)
|
1318
|
+
except Exception:
|
1319
|
+
try:
|
1320
|
+
result = str(maybe_result)
|
1321
|
+
except Exception as e:
|
1322
|
+
logger.error(
|
1323
|
+
f"""
|
1324
|
+
Error converting result of {tool_name} to str: {e}",
|
1325
|
+
""",
|
1326
|
+
exc_info=True,
|
1327
|
+
)
|
1328
|
+
result = None
|
1305
1329
|
except Exception as e:
|
1306
1330
|
# raise the error here since we are sure it's
|
1307
1331
|
# not a pydantic validation error,
|
@@ -453,7 +453,7 @@ class ChatAgent(Agent):
|
|
453
453
|
# remove leading and trailing newlines and other whitespace
|
454
454
|
return LLMMessage(role=Role.SYSTEM, content=content.strip())
|
455
455
|
|
456
|
-
def
|
456
|
+
def unhandled_tools(self) -> set[str]:
|
457
457
|
"""The set of tools that are known but not handled.
|
458
458
|
Useful in task flow: an agent can refuse to accept an incoming msg
|
459
459
|
when it only has unhandled tools.
|
@@ -719,7 +719,7 @@ class ChatAgent(Agent):
|
|
719
719
|
llm_msgs = ChatDocument.to_LLMMessage(message, self.oai_tool_calls)
|
720
720
|
# LLM only responds to the content, so only those msgs with
|
721
721
|
# non-empty content should be kept
|
722
|
-
llm_msgs = [m for m in llm_msgs if m.content != ""]
|
722
|
+
llm_msgs = [m for m in llm_msgs if m.content.strip() != ""]
|
723
723
|
if len(llm_msgs) == 0:
|
724
724
|
return [], 0
|
725
725
|
# process tools if any
|
@@ -119,7 +119,9 @@ class ChatDocument(Document):
|
|
119
119
|
oai_tool_id2result: Optional[OrderedDict[str, str]] = None
|
120
120
|
oai_tool_choice: ToolChoiceTypes | Dict[str, Dict[str, str] | str] = "auto"
|
121
121
|
function_call: Optional[LLMFunctionCall] = None
|
122
|
-
|
122
|
+
# tools that are explicitly added by agent response/handler,
|
123
|
+
# or tools recognized in the ChatDocument as handle-able tools
|
124
|
+
tool_messages: List[ToolMessage] = []
|
123
125
|
# all known tools in the msg that are in an agent's llm_tools_known list,
|
124
126
|
# even if non-used/handled
|
125
127
|
all_tool_messages: List[ToolMessage] = []
|
@@ -0,0 +1,9 @@
|
|
1
|
+
from langroid.agent.tool_message import ToolMessage
|
2
|
+
|
3
|
+
|
4
|
+
class StructuredMessage(ToolMessage):
|
5
|
+
request: str = ""
|
6
|
+
purpose: str = "Wrapper for a structured message"
|
7
|
+
|
8
|
+
# allow subclasses to inhert this "extras allowed" config
|
9
|
+
# model_config = ConfigDict(extra=Extra.allow)
|
@@ -33,7 +33,7 @@ from langroid.agent.chat_document import (
|
|
33
33
|
ChatDocument,
|
34
34
|
StatusCode,
|
35
35
|
)
|
36
|
-
from langroid.agent.tool_message import ToolMessage
|
36
|
+
from langroid.agent.tool_message import FinalResultTool, ToolMessage
|
37
37
|
from langroid.agent.tools.orchestration import AgentDoneTool, DoneTool
|
38
38
|
from langroid.cachedb.redis_cachedb import RedisCache, RedisCacheConfig
|
39
39
|
from langroid.exceptions import InfiniteLoopException
|
@@ -1399,14 +1399,18 @@ class Task:
|
|
1399
1399
|
# if there is an LLMDoneTool or AgentDoneTool among these,
|
1400
1400
|
# we extract content and tools from here, and ignore all others
|
1401
1401
|
for t in tool_messages:
|
1402
|
-
if isinstance(t,
|
1402
|
+
if isinstance(t, FinalResultTool):
|
1403
|
+
content = ""
|
1404
|
+
tool_messages = [t] # pass it on to parent so it also quits
|
1405
|
+
break
|
1406
|
+
elif isinstance(t, (AgentDoneTool, DoneTool)):
|
1403
1407
|
# there shouldn't be multiple tools like this; just take the first
|
1404
1408
|
content = t.content
|
1405
1409
|
if isinstance(t, AgentDoneTool):
|
1406
1410
|
tool_messages = t.tools
|
1407
1411
|
break
|
1408
1412
|
# drop the "Done" tools since they should not be part of the task result,
|
1409
|
-
# or else they would cause the parent task to get done!
|
1413
|
+
# or else they would cause the parent task to get unintentionally done!
|
1410
1414
|
tool_messages = [
|
1411
1415
|
t for t in tool_messages if not isinstance(t, (DoneTool, AgentDoneTool))
|
1412
1416
|
]
|
@@ -1473,7 +1477,7 @@ class Task:
|
|
1473
1477
|
and (
|
1474
1478
|
DONE in result.content
|
1475
1479
|
or any(
|
1476
|
-
isinstance(t, (DoneTool, AgentDoneTool))
|
1480
|
+
isinstance(t, (DoneTool, AgentDoneTool, FinalResultTool))
|
1477
1481
|
for t in result.tool_messages
|
1478
1482
|
)
|
1479
1483
|
)
|
@@ -1594,7 +1598,8 @@ class Task:
|
|
1594
1598
|
done_result = result is not None and (
|
1595
1599
|
DONE in (result.content if isinstance(result, str) else result.content)
|
1596
1600
|
or any(
|
1597
|
-
isinstance(t, (DoneTool, AgentDoneTool))
|
1601
|
+
isinstance(t, (DoneTool, AgentDoneTool, FinalResultTool))
|
1602
|
+
for t in result.tool_messages
|
1598
1603
|
)
|
1599
1604
|
)
|
1600
1605
|
|
@@ -273,3 +273,29 @@ class ToolMessage(ABC, BaseModel):
|
|
273
273
|
exclude=list(cls.Config.schema_extra["exclude"]),
|
274
274
|
)
|
275
275
|
return schema
|
276
|
+
|
277
|
+
|
278
|
+
class FinalResultTool(ToolMessage):
|
279
|
+
"""Class to use as a wrapper for sending arbitrary results from an Agent's
|
280
|
+
agent_response or tool handlers, to:
|
281
|
+
(a) trigger completion of the current task as well as all parent tasks, and
|
282
|
+
(b) be returned as the final result of the root task, i.e. this tool would appear
|
283
|
+
in the final ChatDocument's `tool_messages` list.
|
284
|
+
See test_tool_handlers_and_results in test_tool_messages.py, and
|
285
|
+
examples/basic/tool-extract-short-example.py.
|
286
|
+
|
287
|
+
Note:
|
288
|
+
- when defining a tool handler or agent_response, you can directly return
|
289
|
+
FinalResultTool(field1 = val1, ...),
|
290
|
+
where the values can be aribitrary data structures, including nested
|
291
|
+
Pydantic objs, or you can define a subclass of FinalResultTool with the
|
292
|
+
fields you want to return.
|
293
|
+
- This is a special ToolMessage that is NOT meant to be used or handled
|
294
|
+
by an agent.
|
295
|
+
"""
|
296
|
+
|
297
|
+
request: str = ""
|
298
|
+
purpose: str = "Ignored; Wrapper for a structured message"
|
299
|
+
|
300
|
+
class Config:
|
301
|
+
extra = Extra.allow
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
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.9.4 → langroid-0.10.0}/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
|
{langroid-0.9.4 → langroid-0.10.0}/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.9.4 → langroid-0.10.0}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.9.4 → langroid-0.10.0}/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
|