langroid 0.26.1__py3-none-any.whl → 0.26.2__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.
@@ -58,6 +58,8 @@ class ChatAgentConfig(AgentConfig):
58
58
  the OpenAI tool-call API is used, rather than the older/deprecated
59
59
  function-call API. However the tool-call API has some tricky aspects,
60
60
  hence we set this to False by default.
61
+ strict_recovery: whether to enable strict schema recovery when there
62
+ is a tool-generation error.
61
63
  enable_orchestration_tool_handling: whether to enable handling of orchestration
62
64
  tools, e.g. ForwardTool, DoneTool, PassTool, etc.
63
65
  output_format: When supported by the LLM (certain OpenAI LLMs
@@ -357,6 +357,7 @@ class DocumentParser(Parser):
357
357
  docs: List[Document] = []
358
358
  # metadata.id to be shared by ALL chunks of this document
359
359
  common_id = ObjectRegistry.new_id()
360
+ n_chunks = 0 # how many chunk so far
360
361
  for i, page in self.iterate_pages():
361
362
  page_text = self.extract_text_from_page(page)
362
363
  split += self.tokenizer.encode(page_text)
@@ -378,9 +379,14 @@ class DocumentParser(Parser):
378
379
  ),
379
380
  )
380
381
  )
382
+ n_chunks += 1
381
383
  split = split[self.config.chunk_size - self.config.overlap :]
382
384
  pages = [str(i + 1)]
383
- if len(split) > self.config.overlap:
385
+ # there may be a last split remaining:
386
+ # if it's shorter than the overlap, we shouldn't make a chunk for it
387
+ # since it's already included in the prior chunk;
388
+ # the only exception is if there have been no chunks so far.
389
+ if len(split) > self.config.overlap or n_chunks == 0:
384
390
  pg = "-".join([pages[0], pages[-1]])
385
391
  text = self.tokenizer.decode(split[: self.config.chunk_size])
386
392
  docs.append(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langroid
3
- Version: 0.26.1
3
+ Version: 0.26.2
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  License: MIT
6
6
  Author: Prasad Chalasani
@@ -4,7 +4,7 @@ langroid/agent/base.py,sha256=jAt7tbyPIWoGJDe6Xi75nthl-JY47yWB9Q5O1m9QJq0,76798
4
4
  langroid/agent/batch.py,sha256=qK3ph6VNj_1sOhfXCZY4r6gh035DglDKU751p8BU0tY,14665
5
5
  langroid/agent/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  langroid/agent/callbacks/chainlit.py,sha256=C6zzzYC30qC4eMA7al7eFpRoTgoe3475kaMKyXgQM0Q,20695
7
- langroid/agent/chat_agent.py,sha256=jZaeMOQsGZlrnWj7RBT7RR17Bd0zR9H4D6n_F4rPUn0,79517
7
+ langroid/agent/chat_agent.py,sha256=wqpcTO0H3ZcxlUFBN49t0jvBG17n6fWSxqtIfdqsT8o,79634
8
8
  langroid/agent/chat_document.py,sha256=xPUMGzR83rn4iAEXIw2jy5LQ6YJ6Y0TiZ78XRQeDnJQ,17778
9
9
  langroid/agent/helpers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  langroid/agent/junk,sha256=LxfuuW7Cijsg0szAzT81OjWWv1PMNI-6w_-DspVIO2s,339
@@ -87,7 +87,7 @@ langroid/parsing/agent_chats.py,sha256=sbZRV9ujdM5QXvvuHVjIi2ysYSYlap-uqfMMUKulr
87
87
  langroid/parsing/code-parsing.md,sha256=--cyyNiSZSDlIwcjAV4-shKrSiRe2ytF3AdSoS_hD2g,3294
88
88
  langroid/parsing/code_parser.py,sha256=AOxb3xbYpTBPP3goOm5dKfJdh5hS_2BhLVCEkifWZN8,3796
89
89
  langroid/parsing/config.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
- langroid/parsing/document_parser.py,sha256=ZGxgG4ytnCIah4HWk3ZrK3EGAMXDjAzI9KaPEXCbMm0,24589
90
+ langroid/parsing/document_parser.py,sha256=9xUOyrVNBAS9cpCvCptr2XK4Kq47W574i8zzGEoXc3c,24933
91
91
  langroid/parsing/image_text.py,sha256=sbLIQ5nHe2UnYUksBaQsmZGaX-X0qgEpPd7CEzi_z5M,910
92
92
  langroid/parsing/para_sentence_split.py,sha256=AJBzZojP3zpB-_IMiiHismhqcvkrVBQ3ZINoQyx_bE4,2000
93
93
  langroid/parsing/parse_json.py,sha256=aADo38bAHQhC8on4aWZZzVzSDy-dK35vRLZsFI2ewh8,4756
@@ -142,8 +142,8 @@ langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3Hmh
142
142
  langroid/vector_store/momento.py,sha256=qR-zBF1RKVHQZPZQYW_7g-XpTwr46p8HJuYPCkfJbM4,10534
143
143
  langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
144
144
  langroid/vector_store/qdrantdb.py,sha256=v88lqFkepADvlN6lByUj9I4NEKa9X9lWH16uTPPbYrE,17457
145
- pyproject.toml,sha256=eBqM11UEFyExp9V3T3mzm3ecLHYfwjlcMZ_p9iihz8I,7496
146
- langroid-0.26.1.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
147
- langroid-0.26.1.dist-info/METADATA,sha256=MA5FyOkURNni69GpGG3yEHoUufurJh4pwtENzET6WsI,57521
148
- langroid-0.26.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
149
- langroid-0.26.1.dist-info/RECORD,,
145
+ pyproject.toml,sha256=_oWo5xkx_o4Kibt75oyNuMuhI6120ltehonplPVZsAY,7496
146
+ langroid-0.26.2.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
147
+ langroid-0.26.2.dist-info/METADATA,sha256=UVItMAVeO-IVh6M2CvoWlroa2fXGaE9Skmeh0nyOsB4,57521
148
+ langroid-0.26.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
149
+ langroid-0.26.2.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "langroid"
3
- version = "0.26.1"
3
+ version = "0.26.2"
4
4
  description = "Harness LLMs with Multi-Agent Programming"
5
5
  authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
6
6
  readme = "README.md"