langroid 0.33.7__py3-none-any.whl → 0.33.9__py3-none-any.whl
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/agent/special/sql/sql_chat_agent.py +2 -1
- langroid/agent/task.py +5 -1
- langroid/parsing/url_loader.py +8 -4
- langroid/vector_store/qdrantdb.py +21 -0
- {langroid-0.33.7.dist-info → langroid-0.33.9.dist-info}/METADATA +1 -1
- {langroid-0.33.7.dist-info → langroid-0.33.9.dist-info}/RECORD +8 -8
- {langroid-0.33.7.dist-info → langroid-0.33.9.dist-info}/WHEEL +0 -0
- {langroid-0.33.7.dist-info → langroid-0.33.9.dist-info}/licenses/LICENSE +0 -0
@@ -72,7 +72,8 @@ Start by asking what I would like to know about the data.
|
|
72
72
|
|
73
73
|
ADDRESSING_INSTRUCTION = """
|
74
74
|
IMPORTANT - Whenever you are NOT writing a SQL query, make sure you address the user
|
75
|
-
using {prefix}User
|
75
|
+
using {prefix}User (NO SPACE between {prefix} and User).
|
76
|
+
You MUST use the EXACT syntax {prefix}User !!!
|
76
77
|
|
77
78
|
In other words, you ALWAYS write EITHER:
|
78
79
|
- a SQL query using the `run_query` tool,
|
langroid/agent/task.py
CHANGED
@@ -200,7 +200,11 @@ class Task:
|
|
200
200
|
control of task termination.
|
201
201
|
system_message (str): if not empty, overrides agent's system_message
|
202
202
|
user_message (str): if not empty, overrides agent's user_message
|
203
|
-
restart (bool): if true, resets the agent's message history
|
203
|
+
restart (bool): if true (default), resets the agent's message history
|
204
|
+
*at every run* when it is the top-level task. Ignored when
|
205
|
+
the task is a subtask of another task. Restart behavior of a subtask's
|
206
|
+
`run()` can be controlled via the `TaskConfig.restart_as_subtask`
|
207
|
+
setting.
|
204
208
|
default_human_response (str|None): default response from user; useful for
|
205
209
|
testing, to avoid interactive input from user.
|
206
210
|
[Instead of this, setting `interactive` usually suffices]
|
langroid/parsing/url_loader.py
CHANGED
@@ -52,10 +52,14 @@ class URLLoader:
|
|
52
52
|
or url.lower().endswith(".docx")
|
53
53
|
or url.lower().endswith(".doc")
|
54
54
|
):
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
try:
|
56
|
+
doc_parser = DocumentParser.create(
|
57
|
+
url,
|
58
|
+
self.parser.config,
|
59
|
+
)
|
60
|
+
except Exception as e:
|
61
|
+
logging.error(f"Error parsing {url}: {e}")
|
62
|
+
continue
|
59
63
|
new_chunks = doc_parser.get_doc_chunks()
|
60
64
|
if len(new_chunks) == 0:
|
61
65
|
# If the document is empty, try to extract images
|
@@ -2,6 +2,7 @@ import hashlib
|
|
2
2
|
import json
|
3
3
|
import logging
|
4
4
|
import os
|
5
|
+
import time
|
5
6
|
import uuid
|
6
7
|
from typing import Dict, List, Optional, Sequence, Tuple, TypeVar
|
7
8
|
|
@@ -323,6 +324,26 @@ class QdrantDB(VectorStore):
|
|
323
324
|
}
|
324
325
|
if self.config.use_sparse_embeddings:
|
325
326
|
vectors["text-sparse"] = sparse_embedding_vecs[i : i + b]
|
327
|
+
coll_found: bool = False
|
328
|
+
for _ in range(3):
|
329
|
+
# poll until collection is ready
|
330
|
+
if (
|
331
|
+
self.client.collection_exists(self.config.collection_name)
|
332
|
+
and self.client.get_collection(self.config.collection_name).status
|
333
|
+
== CollectionStatus.GREEN
|
334
|
+
):
|
335
|
+
coll_found = True
|
336
|
+
break
|
337
|
+
time.sleep(1)
|
338
|
+
|
339
|
+
if not coll_found:
|
340
|
+
raise ValueError(
|
341
|
+
f"""
|
342
|
+
QdrantDB Collection {self.config.collection_name}
|
343
|
+
not found or not ready
|
344
|
+
"""
|
345
|
+
)
|
346
|
+
|
326
347
|
self.client.upsert(
|
327
348
|
collection_name=self.config.collection_name,
|
328
349
|
points=Batch(
|
@@ -8,7 +8,7 @@ langroid/agent/batch.py,sha256=qK3ph6VNj_1sOhfXCZY4r6gh035DglDKU751p8BU0tY,14665
|
|
8
8
|
langroid/agent/chat_agent.py,sha256=Idts_HDO1tW052POVOQ9FvuU37TTB7c1I96YVbnBumo,80030
|
9
9
|
langroid/agent/chat_document.py,sha256=xPUMGzR83rn4iAEXIw2jy5LQ6YJ6Y0TiZ78XRQeDnJQ,17778
|
10
10
|
langroid/agent/openai_assistant.py,sha256=JkAcs02bIrgPNVvUWVR06VCthc5-ulla2QMBzux_q6o,34340
|
11
|
-
langroid/agent/task.py,sha256=
|
11
|
+
langroid/agent/task.py,sha256=c_Ih0Cc_iiyFKBmKMSdirHcW4RX_35JkCFp05jDAEiM,89994
|
12
12
|
langroid/agent/tool_message.py,sha256=HDW_FVQXvZAHI61CtOYNuZet0qlK_WwOnjSYd1g81eo,14742
|
13
13
|
langroid/agent/xml_tool_message.py,sha256=6SshYZJKIfi4mkE-gIoSwjkEYekQ8GwcSiCv7a5uO9E,15054
|
14
14
|
langroid/agent/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -35,7 +35,7 @@ langroid/agent/special/neo4j/neo4j_chat_agent.py,sha256=1RMKupJra0KZ-hA7AiiR662S
|
|
35
35
|
langroid/agent/special/neo4j/system_messages.py,sha256=m2jsVayey6E_88F5B_gW2WbWKBJvIeDUoVCRBbNs97o,4522
|
36
36
|
langroid/agent/special/neo4j/tools.py,sha256=Vw3HvtDfG2c4_bUHgt4_ZbJq48lpIQstbjjwhh1BjrQ,905
|
37
37
|
langroid/agent/special/sql/__init__.py,sha256=mWfmm1QpXCezpFOS2eI57M0L_Ok3q5_ukG8tXBnBrEA,319
|
38
|
-
langroid/agent/special/sql/sql_chat_agent.py,sha256=
|
38
|
+
langroid/agent/special/sql/sql_chat_agent.py,sha256=bHJ2TsZciijOBPXKbKvJvDbdEwCRXOSkaRdMmGW1yr0,24660
|
39
39
|
langroid/agent/special/sql/utils/__init__.py,sha256=JFif6CRTrN-bc91uuAI4K9fe2ndIWSNMVxJ0WA68--M,446
|
40
40
|
langroid/agent/special/sql/utils/description_extractors.py,sha256=cX8TIpmTPXZXQTMpIi3OUFwFsPywxFFdurpx717Kq0I,6529
|
41
41
|
langroid/agent/special/sql/utils/populate_metadata.py,sha256=1J22UsyEPKzwK0XlJZtYn9r6kYc0FXIr8-lZrndYlhc,3131
|
@@ -87,7 +87,7 @@ langroid/parsing/routing.py,sha256=-FcnlqldzL4ZoxuDwXjQPNHgBe9F9-F4R6q7b_z9CvI,1
|
|
87
87
|
langroid/parsing/search.py,sha256=0i_r0ESb5HEQfagA2g7_uMQyxYPADWVbdcN9ixZhS4E,8992
|
88
88
|
langroid/parsing/spider.py,sha256=Y6y7b86Y2k770LdhxgjVlImBxuuy1V9n8-XQ3QPaG5s,3199
|
89
89
|
langroid/parsing/table_loader.py,sha256=qNM4obT_0Y4tjrxNBCNUYjKQ9oETCZ7FbolKBTcz-GM,3410
|
90
|
-
langroid/parsing/url_loader.py,sha256=
|
90
|
+
langroid/parsing/url_loader.py,sha256=JK48KktLRDBfjrt4nsUfy92M6yGdEeicAqOum2MdULM,4656
|
91
91
|
langroid/parsing/urls.py,sha256=XjpaV5onG7gKQ5iQeFTzHSw5P08Aqw0g-rMUu61lR6s,7988
|
92
92
|
langroid/parsing/utils.py,sha256=kb9DlHaG1iQB-6JagH1C26SdCNNf8U-2XaXia4_dWCw,12726
|
93
93
|
langroid/parsing/web_search.py,sha256=8rW8EI3tyHITaB2l9MT_6yLMeQfo8y-Ih-8N2v2uMpk,4931
|
@@ -120,8 +120,8 @@ langroid/vector_store/chromadb.py,sha256=9WXW9IoSnhOmGEtMruVhEtVWL_VO6NXnPIz-nzh
|
|
120
120
|
langroid/vector_store/lancedb.py,sha256=b3_vWkTjG8mweZ7ZNlUD-NjmQP_rLBZfyKWcxt2vosA,14855
|
121
121
|
langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3HmhHQICXLs,11663
|
122
122
|
langroid/vector_store/momento.py,sha256=UNHGT6jXuQtqY9f6MdqGU14bVnS0zHgIJUa30ULpUJo,10474
|
123
|
-
langroid/vector_store/qdrantdb.py,sha256=
|
124
|
-
langroid-0.33.
|
125
|
-
langroid-0.33.
|
126
|
-
langroid-0.33.
|
127
|
-
langroid-0.33.
|
123
|
+
langroid/vector_store/qdrantdb.py,sha256=HRLCt-FG8y4718omwpFaQZnWeYxPj0XCwS4tjokI1sU,18116
|
124
|
+
langroid-0.33.9.dist-info/METADATA,sha256=5dBFIEzwzxNpjICkMYzMSUNgGONETNZ-Mb9BWhkQs2s,59015
|
125
|
+
langroid-0.33.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
126
|
+
langroid-0.33.9.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
127
|
+
langroid-0.33.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|