langroid 0.59.12__py3-none-any.whl → 0.59.13__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.
@@ -279,8 +279,8 @@ class ChatAgent(Agent):
279
279
  new_agent.llm_functions_handled = self.llm_functions_handled
280
280
  new_agent.llm_functions_usable = self.llm_functions_usable
281
281
  new_agent.llm_function_force = self.llm_function_force
282
- # Caution - we are copying the vector-db, maybe we don't always want this?
283
- new_agent.vecdb = self.vecdb
282
+ # Ensure each clone gets its own vecdb client when supported.
283
+ new_agent.vecdb = None if self.vecdb is None else self.vecdb.clone()
284
284
  new_agent.id = ObjectRegistry.new_id()
285
285
  if self.config.add_to_registry:
286
286
  ObjectRegistry.register_object(new_agent)
@@ -1414,6 +1414,7 @@ class DocChatAgent(ChatAgent):
1414
1414
  )
1415
1415
 
1416
1416
  if len(passages) == 0:
1417
+ logger.debug("No passages retrieved for query '%s'", query)
1417
1418
  return []
1418
1419
 
1419
1420
  if self.config.rerank_after_adding_context:
@@ -95,6 +95,37 @@ class VectorStore(ABC):
95
95
  def embedding_dim(self) -> int:
96
96
  return len(self.embedding_fn(["test"])[0])
97
97
 
98
+ def clone(self) -> "VectorStore":
99
+ """Return a vector-store clone suitable for agent cloning.
100
+
101
+ The default implementation deep-copies the configuration, reuses any
102
+ existing embedding model, and instantiates a fresh store of the same
103
+ type. Subclasses can override when sharing the instance is required
104
+ (e.g., embedded/local stores that rely on file locks).
105
+ """
106
+
107
+ config_copy = self.config.model_copy(deep=True)
108
+ # Preserve the calculated collection contents without forcing replaces
109
+ if hasattr(config_copy, "replace_collection"):
110
+ config_copy.replace_collection = False # type: ignore[attr-defined]
111
+ if hasattr(config_copy, "embedding_model"):
112
+ config_copy.embedding_model = getattr(self.config, "embedding_model", None)
113
+ # Fall back to the existing embedding model instance if config lacks it
114
+ if getattr(config_copy, "embedding_model", None) is None:
115
+ setattr(
116
+ config_copy, "embedding_model", getattr(self, "embedding_model", None)
117
+ )
118
+
119
+ cloned_store = type(self)(config_copy) # type: ignore[call-arg]
120
+ # Some stores might not honour replace_collection; ensure same collection
121
+ if getattr(self.config, "collection_name", None) is not None:
122
+ setattr(
123
+ cloned_store.config,
124
+ "collection_name",
125
+ getattr(self.config, "collection_name", None),
126
+ )
127
+ return cloned_store
128
+
98
129
  @abstractmethod
99
130
  def clear_empty_collections(self) -> int:
100
131
  """Clear all empty collections in the vector store.
@@ -143,6 +143,14 @@ class QdrantDB(VectorStore):
143
143
  config.collection_name, replace=config.replace_collection
144
144
  )
145
145
 
146
+ def clone(self) -> "QdrantDB":
147
+ """Create an independent Qdrant client when running against Qdrant Cloud."""
148
+ if not self.config.cloud:
149
+ return self
150
+ cloned = super().clone()
151
+ assert isinstance(cloned, QdrantDB)
152
+ return cloned
153
+
146
154
  def close(self) -> None:
147
155
  """
148
156
  Close the QdrantDB client and release any resources (e.g., file locks).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langroid
3
- Version: 0.59.12
3
+ Version: 0.59.13
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  Author-email: Prasad Chalasani <pchalasani@gmail.com>
6
6
  License: MIT
@@ -5,7 +5,7 @@ langroid/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  langroid/agent/__init__.py,sha256=ll0Cubd2DZ-fsCMl7e10hf9ZjFGKzphfBco396IKITY,786
6
6
  langroid/agent/base.py,sha256=mP57z3QiOm8Y7tG_OHpyvcsWmoq-4WSrHxAiiwgtsX8,87307
7
7
  langroid/agent/batch.py,sha256=wpE9RqCNDVDhAXkCB7wEqfCIEAi6qKcrhaZ-Zr9T4C0,21375
8
- langroid/agent/chat_agent.py,sha256=OqP4N9jqeSJfCqTznE4zqtsVCyzUQlAhz_ToXYIYCSc,90436
8
+ langroid/agent/chat_agent.py,sha256=NnsqwHo66KVZXsiGKZxmGtlT3RUC0qUGc96sp2mCY00,90463
9
9
  langroid/agent/chat_document.py,sha256=bgNGfgyvTqPqUV8093IYRJ7jLNlOEctEvjnwdVUApaI,19748
10
10
  langroid/agent/done_sequence_parser.py,sha256=99UZoLknQx0AZzX-hGp03MfUxHomrMTLcyekpC25JoU,5845
11
11
  langroid/agent/openai_assistant.py,sha256=v__MWg0jhEOQVplKh1urU2Dq4VZonHV0G3CuGiHFw7o,34386
@@ -15,7 +15,7 @@ langroid/agent/xml_tool_message.py,sha256=b5zyYuQS8bduVNoe-jOjy7iLB5VOMvbGfD_A5Z
15
15
  langroid/agent/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  langroid/agent/callbacks/chainlit.py,sha256=nRCTkYDgTiBPP8Cg2ct8dLUBDevLMO4w0jv0GfQQq2U,20960
17
17
  langroid/agent/special/__init__.py,sha256=gik_Xtm_zV7U9s30Mn8UX3Gyuy4jTjQe9zjiE3HWmEo,1273
18
- langroid/agent/special/doc_chat_agent.py,sha256=O59btjW3o8pIl6VhLiJ5b9MsajRSq6fDtlxenpKfus8,69146
18
+ langroid/agent/special/doc_chat_agent.py,sha256=LOH7akB2uELYsOEDWnz8kZP_LmikKcnWpfyU5Yo6N_U,69218
19
19
  langroid/agent/special/doc_chat_task.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  langroid/agent/special/lance_doc_chat_agent.py,sha256=6pIqi2DF-MvYYN3-blsdUgulYnOBTl7I21T7wPAt1zM,10413
21
21
  langroid/agent/special/lance_tools.py,sha256=3j7Hsyf3-H9ccTXjyNOcnMnpJ7r1lXnqDLSMQgFa7ZI,2114
@@ -131,15 +131,15 @@ langroid/utils/output/citations.py,sha256=9W0slQQgzRGLS7hU51mm5UWao5cS_xr8AVosVe
131
131
  langroid/utils/output/printing.py,sha256=yzPJZN-8_jyOJmI9N_oLwEDfjMwVgk3IDiwnZ4eK_AE,2962
132
132
  langroid/utils/output/status.py,sha256=rzbE7mDJcgNNvdtylCseQcPGCGghtJvVq3lB-OPJ49E,1049
133
133
  langroid/vector_store/__init__.py,sha256=8ktJUVsVUoc7FMmkUFpFBZu7VMWUqQY9zpm4kEJ8yTs,1537
134
- langroid/vector_store/base.py,sha256=27DmKvYNQInD5xDTRFIUgHl4vOYt5TQzAGbk_0EqGtI,15064
134
+ langroid/vector_store/base.py,sha256=cgsmXPDjcLAiYkwhsNQEs15BBqtB52Ex8qJ3B-RyDjs,16580
135
135
  langroid/vector_store/chromadb.py,sha256=p9mEqJwO2BrL2jSSXfa23kCPlPOwWpF3xJYd5zoWw_c,8661
136
136
  langroid/vector_store/lancedb.py,sha256=8rXonTIGgwQU2R6Zy2zcWXR-iI7cdGf-ZwasjGFAziw,14761
137
137
  langroid/vector_store/meilisearch.py,sha256=97rvoVR720mbNOVCbXcnw9GYjiyLI9RrrT10P7giabw,11674
138
138
  langroid/vector_store/pineconedb.py,sha256=7V0Bkt4ZrOR3V90tdXvdFmyNGuww7SFdyPq7-_GG5W0,14988
139
139
  langroid/vector_store/postgres.py,sha256=TY_VshimwFZglYgKYm7Qn1F-dCSL8GsXRTgmh7VTe9c,16110
140
- langroid/vector_store/qdrantdb.py,sha256=mqxMOrcLAQpl0opuL8vXhdIt6ppv2zYyAvddHZoEW0Y,19184
140
+ langroid/vector_store/qdrantdb.py,sha256=QL1PamTPXIVxU4im5Hz6fjgy4FRfNkXQtoRlhEPl4eM,19462
141
141
  langroid/vector_store/weaviatedb.py,sha256=BS95bxVKNYfQc9VPb85a1HlcgnXfAkgMzjydnjCgRHc,11853
142
- langroid-0.59.12.dist-info/METADATA,sha256=ESfzLcUoh0cCmabOtjQ5rOdCJOjbI9ZZmHZuhtpT4w8,66518
143
- langroid-0.59.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
144
- langroid-0.59.12.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
145
- langroid-0.59.12.dist-info/RECORD,,
142
+ langroid-0.59.13.dist-info/METADATA,sha256=cDqIhp_jcNsawN7i0D8psBlEKo9imbQi0wqh1FdwWSM,66518
143
+ langroid-0.59.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
144
+ langroid-0.59.13.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
145
+ langroid-0.59.13.dist-info/RECORD,,