langroid 0.6.4__py3-none-any.whl → 0.6.6__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.
@@ -6,6 +6,7 @@ from rich import print
6
6
  from rich.console import Console
7
7
 
8
8
  from langroid.agent import ToolMessage
9
+ from langroid.parsing.parse_json import datetime_to_json
9
10
  from langroid.pydantic_v1 import BaseModel, BaseSettings
10
11
 
11
12
  if TYPE_CHECKING:
@@ -279,11 +280,17 @@ class Neo4jChatAgent(ChatAgent):
279
280
  response = self.read_query(query)
280
281
  if isinstance(response.data, list) and len(response.data) == 0:
281
282
  return """
282
- No results found; perhaps try an approximate or case-insensitive match,
283
- or the other RETRY-SUGGESTIONS in your instructions.
283
+ No results found; check if your query used the right label names --
284
+ remember these are case sensitive, so you have to use the exact label
285
+ names you found in the schema.
286
+ Or retry using one of the RETRY-SUGGESTIONS in your instructions.
284
287
  """
285
288
  if response.success:
286
- return json.dumps(response.data)
289
+ try:
290
+ json_str = json.dumps(response.data, default=datetime_to_json)
291
+ return json_str
292
+ except TypeError:
293
+ return str(response.data)
287
294
  else:
288
295
  return str(response.data)
289
296
 
@@ -41,7 +41,8 @@ If you receive a null or other unexpected result,
41
41
  (a) make sure you use the available TOOLs correctly,
42
42
  (b) USE `get_schema` tool/function-call to get all the node labels, relationship
43
43
  types, and property keys available in your Neo4j database.
44
- (c) LABELS may be CASE-SENSITIVE, so try using CASE-INSENSITIVE MATCHES,
44
+ (c) LABELS are CASE-SENSITIVE -- make sure you adhere to the exact label name
45
+ you found in the schema.
45
46
  (d) see if you have made an assumption in your Neo4j query, and try another way,
46
47
  or use `retrieval_query` to explore the database contents before submitting your
47
48
  final query.
@@ -1,5 +1,6 @@
1
1
  import ast
2
2
  import json
3
+ from datetime import datetime
3
4
  from typing import Any, Dict, Iterator, List, Union
4
5
 
5
6
  import yaml
@@ -167,3 +168,10 @@ def top_level_json_field(s: str, f: str) -> Any:
167
168
  return json_data[f]
168
169
 
169
170
  return ""
171
+
172
+
173
+ def datetime_to_json(obj: Any) -> Any:
174
+ if isinstance(obj, datetime):
175
+ return obj.isoformat()
176
+ # Let json.dumps() handle the raising of TypeError for non-serializable objects
177
+ return obj
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langroid
3
- Version: 0.6.4
3
+ Version: 0.6.6
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  License: MIT
6
6
  Author: Prasad Chalasani
@@ -23,9 +23,9 @@ langroid/agent/special/lance_rag_new/query_planner_agent.py,sha256=JqO_5fKW8HPn-
23
23
  langroid/agent/special/lance_tools.py,sha256=BznV_r3LAFyybvBRa9KQ0oU7mPM3uQVfri7PFp7M_qc,1894
24
24
  langroid/agent/special/neo4j/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  langroid/agent/special/neo4j/csv_kg_chat.py,sha256=dRsAgMBa1H_EMI2YYgJR2Xyv1D7e4o3G9M64mTewq_c,6409
26
- langroid/agent/special/neo4j/neo4j_chat_agent.py,sha256=ic09EvAxSWo6q-h-HpPKwFMzaeuD8iGbbJYDvHnRonA,13301
26
+ langroid/agent/special/neo4j/neo4j_chat_agent.py,sha256=W-nXoqfOwZTl6p7ZLRQw017OARWKUzz_LSwFTjqpE04,13651
27
27
  langroid/agent/special/neo4j/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- langroid/agent/special/neo4j/utils/system_message.py,sha256=XNEP1jWQNYqjxMAVJpBkpfHHK0x537rj882sgV111vE,2887
28
+ langroid/agent/special/neo4j/utils/system_message.py,sha256=_2NKX2Sx_7nLGNk_0rUyDkgTHZJuKm_DgtG7M_BFPkY,2920
29
29
  langroid/agent/special/relevance_extractor_agent.py,sha256=zIx8GUdVo1aGW6ASla0NPQjYYIpmriK_TYMijqAx3F8,4796
30
30
  langroid/agent/special/retriever_agent.py,sha256=lvMvf-u9rSosg4YASuFdUbGLgkzLPknXAbJZfZ1LZCc,1868
31
31
  langroid/agent/special/sql/__init__.py,sha256=mWfmm1QpXCezpFOS2eI57M0L_Ok3q5_ukG8tXBnBrEA,319
@@ -87,7 +87,7 @@ langroid/parsing/config.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
87
  langroid/parsing/document_parser.py,sha256=WGnA5ADwMHliGJt6WW9rc4RiFXQcKU33b5zdPiGrtEY,24265
88
88
  langroid/parsing/image_text.py,sha256=sbLIQ5nHe2UnYUksBaQsmZGaX-X0qgEpPd7CEzi_z5M,910
89
89
  langroid/parsing/para_sentence_split.py,sha256=AJBzZojP3zpB-_IMiiHismhqcvkrVBQ3ZINoQyx_bE4,2000
90
- langroid/parsing/parse_json.py,sha256=Rcy0iCyMMICk2QstrlJtW7zDPs9lOZ3N_mlaJGWkC40,5033
90
+ langroid/parsing/parse_json.py,sha256=Ivh6YcEOESAi9y8E55E7qhFqfncvnluyb6sZGWK0--U,5268
91
91
  langroid/parsing/parser.py,sha256=AgtmlVUvrkSG1l7-YZPX8rlldgXjh_HqXAMqpXkBxUo,11746
92
92
  langroid/parsing/repo_loader.py,sha256=3GjvPJS6Vf5L6gV2zOU8s-Tf1oq_fZm-IB_RL_7CTsY,29373
93
93
  langroid/parsing/routing.py,sha256=-FcnlqldzL4ZoxuDwXjQPNHgBe9F9-F4R6q7b_z9CvI,1232
@@ -134,8 +134,8 @@ langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3Hmh
134
134
  langroid/vector_store/momento.py,sha256=qR-zBF1RKVHQZPZQYW_7g-XpTwr46p8HJuYPCkfJbM4,10534
135
135
  langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
136
136
  langroid/vector_store/qdrantdb.py,sha256=v88lqFkepADvlN6lByUj9I4NEKa9X9lWH16uTPPbYrE,17457
137
- pyproject.toml,sha256=MUbx-I1YZJEr0r177JeAZTH0YRO_TyN5UQIDWsiNCeI,7063
138
- langroid-0.6.4.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
139
- langroid-0.6.4.dist-info/METADATA,sha256=h2pVxowaNGKIl57xLgzNdahRrcNly8W2koXNk1Mg2pM,54402
140
- langroid-0.6.4.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
141
- langroid-0.6.4.dist-info/RECORD,,
137
+ pyproject.toml,sha256=s7qSfD_4EuQqtVpxQ-3fAGwEiJjb6b3tRtXh4ZQgKNU,7063
138
+ langroid-0.6.6.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
139
+ langroid-0.6.6.dist-info/METADATA,sha256=-xsYzS3TfrdtgozB_TNT5IZFV_RlG3z1eLFItYVAwRg,54402
140
+ langroid-0.6.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
141
+ langroid-0.6.6.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "langroid"
3
- version = "0.6.4"
3
+ version = "0.6.6"
4
4
  description = "Harness LLMs with Multi-Agent Programming"
5
5
  authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
6
6
  readme = "README.md"