langroid 0.1.150__tar.gz → 0.1.152__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.150 → langroid-0.1.152}/PKG-INFO +1 -1
- {langroid-0.1.150 → langroid-0.1.152}/langroid/__init__.py +1 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/task.py +20 -7
- {langroid-0.1.150 → langroid-0.1.152}/pyproject.toml +1 -1
- {langroid-0.1.150 → langroid-0.1.152}/LICENSE +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/README.md +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/base.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/batch.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/chat_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/chat_document.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/helpers.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/junk +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tool_message.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/extract_tool.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/generator_tool.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/run_python_code.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/agent_config.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/cachedb/base.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/embedding_models/base.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/embedding_models/clustering.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/embedding_models/models.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/base.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/config.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/openai_assistants.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/openai_gpt.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/language_models/utils.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/mytypes.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/code-parsing.md +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/config.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/json.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/parser.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/search.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/spider.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/url_loader_cookies.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/urls.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/utils.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/parsing/web_search.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/prompts/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/prompts/dialog.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/prompts/templates.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/prompts/transforms.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/configuration.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/constants.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/docker.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/globals.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/llms/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/llms/strings.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/logging.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/output/printing.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/system.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/web/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/web/login.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/utils/web/selenium_login.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/base.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/momento.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/qdrant_cloud.py +0 -0
- {langroid-0.1.150 → langroid-0.1.152}/langroid/vector_store/qdrantdb.py +0 -0
@@ -78,12 +78,17 @@ class Task:
|
|
78
78
|
Args:
|
79
79
|
agent (Agent): agent associated with the task
|
80
80
|
name (str): name of the task
|
81
|
-
llm_delegate (bool):
|
81
|
+
llm_delegate (bool):
|
82
|
+
[Deprecated, not used; use `done_if_response`, `done_if_no_response`
|
83
|
+
instead]
|
84
|
+
Whether to delegate control to LLM; conceptually,
|
82
85
|
the "controlling entity" is the one "seeking" responses to its queries,
|
83
86
|
and has a goal it is aiming to achieve. The "controlling entity" is
|
84
87
|
either the LLM or the USER. (Note within a Task there is just one
|
85
88
|
LLM, and all other entities are proxies of the "User" entity).
|
86
|
-
single_round (bool):
|
89
|
+
single_round (bool):
|
90
|
+
[Deprecated: Use `done_if_response`, `done_if_no_response` instead].
|
91
|
+
If true, task runs until one message by controller,
|
87
92
|
and subsequent response by non-controller. If false, runs for the
|
88
93
|
specified number of turns in `run`, or until `done()` is true.
|
89
94
|
One run of step() is considered a "turn".
|
@@ -92,16 +97,19 @@ class Task:
|
|
92
97
|
restart (bool): if true, resets the agent's message history
|
93
98
|
default_human_response (str): default response from user; useful for
|
94
99
|
testing, to avoid interactive input from user.
|
100
|
+
[Instead of this, setting `interactive` usually suffices]
|
95
101
|
interactive (bool): if true, wait for human input after each non-human
|
96
102
|
response (prevents infinite loop of non-human responses).
|
97
103
|
Default is true. If false, then `default_human_response` is set to ""
|
98
104
|
only_user_quits_root (bool): if true, only user can quit the root task.
|
105
|
+
[Instead of this, setting `interactive` usually suffices]
|
99
106
|
erase_substeps (bool): if true, when task completes, erase intermediate
|
100
107
|
conversation with subtasks from this agent's `message_history`, and also
|
101
108
|
erase all subtask agents' `message_history`.
|
102
109
|
Note: erasing can reduce prompt sizes, but results in repetitive
|
103
110
|
sub-task delegation.
|
104
|
-
allow_null_result (bool):
|
111
|
+
allow_null_result (bool): [Deprecated, may be removed in future.]
|
112
|
+
If true, allow null (empty or NO_ANSWER)
|
105
113
|
as the result of a step or overall task result.
|
106
114
|
Optional, default is True.
|
107
115
|
max_stalled_steps (int): task considered done after this many consecutive
|
@@ -132,12 +140,13 @@ class Task:
|
|
132
140
|
self.step_progress = False # progress in current step?
|
133
141
|
self.n_stalled_steps = 0 # how many consecutive steps with no progress?
|
134
142
|
self.max_stalled_steps = max_stalled_steps
|
135
|
-
self.done_if_response = [
|
136
|
-
self.done_if_no_response = [
|
143
|
+
self.done_if_response = [r.value for r in done_if_response]
|
144
|
+
self.done_if_no_response = [r.value for r in done_if_no_response]
|
137
145
|
self.is_done = False # is task done (based on response)?
|
138
146
|
self.is_pass_thru = False # is current response a pass-thru?
|
139
147
|
self.task_progress = False # progress in current task (since run or run_async)?
|
140
148
|
self.name = name or agent.config.name
|
149
|
+
self.value: str = self.name
|
141
150
|
self.default_human_response = default_human_response
|
142
151
|
self.interactive = interactive
|
143
152
|
self.message_history_idx = -1
|
@@ -221,6 +230,10 @@ class Task:
|
|
221
230
|
interactive=self.interactive,
|
222
231
|
only_user_quits_root=self.only_user_quits_root,
|
223
232
|
erase_substeps=self.erase_substeps,
|
233
|
+
allow_null_result=self.allow_null_result,
|
234
|
+
max_stalled_steps=self.max_stalled_steps,
|
235
|
+
done_if_no_response=[Entity(s) for s in self.done_if_no_response],
|
236
|
+
done_if_response=[Entity(s) for s in self.done_if_response],
|
224
237
|
)
|
225
238
|
|
226
239
|
def __repr__(self) -> str:
|
@@ -808,11 +821,11 @@ class Task:
|
|
808
821
|
)
|
809
822
|
return (
|
810
823
|
(
|
811
|
-
|
824
|
+
responder.value in self.done_if_response
|
812
825
|
and not self._is_empty_message(result)
|
813
826
|
)
|
814
827
|
or (
|
815
|
-
|
828
|
+
responder.value in self.done_if_no_response
|
816
829
|
and self._is_empty_message(result)
|
817
830
|
)
|
818
831
|
or (not self._is_empty_message(result) and response_says_done)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
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.150 → langroid-0.1.152}/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
|
{langroid-0.1.150 → langroid-0.1.152}/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
|