langroid 0.1.222__py3-none-any.whl → 0.1.225__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.
@@ -389,9 +389,7 @@ class DocChatAgent(ChatAgent):
389
389
  if split:
390
390
  docs = self.parser.split(docs)
391
391
  else:
392
- # treat each doc as a chunk
393
- for d in docs:
394
- d.metadata.is_chunk = True
392
+ self.parser.add_window_ids(docs)
395
393
  if self.vecdb is None:
396
394
  raise ValueError("VecDB not set")
397
395
 
@@ -216,7 +216,7 @@ class TableChatAgent(ChatAgent):
216
216
 
217
217
  # Evaluate the last line and get the result
218
218
  try:
219
- eval_result = eval(lines[-1], {}, local_vars)
219
+ eval_result = pd.eval(lines[-1], local_dict=local_vars)
220
220
  except Exception as e:
221
221
  eval_result = f"ERROR: {type(e)}: {e}"
222
222
 
@@ -1,24 +1,8 @@
1
1
  """
2
- A tool to trigger a Metaphor search for a given query,
3
- (https://docs.exa.ai/reference/getting-started)
4
- and return the top results with their titles, links, summaries.
5
- Since the tool is stateless (i.e. does not need
2
+ A tool to trigger a DuckDuckGo search for a given query, and return the top results with
3
+ their titles, links, summaries. Since the tool is stateless (i.e. does not need
6
4
  access to agent state), it can be enabled for any agent, without having to define a
7
- special method inside the agent: `agent.enable_message(MetaphorSearchTool)`
8
-
9
- NOTE: To use this tool, you need to:
10
-
11
- * set the METAPHOR_API_KEY environment variables in
12
- your `.env` file, e.g. `METAPHOR_API_KEY=your_api_key_here`
13
- (Note as of 28 Jan 2023, Metaphor renamed to Exa, so you can also use
14
- `EXA_API_KEY=your_api_key_here`)
15
-
16
- * install langroid with the `metaphor` extra, e.g.
17
- `pip install langroid[metaphor]` or `poetry add langroid[metaphor]`
18
- (it installs the `metaphor-python` package from pypi).
19
-
20
- For more information, please refer to the official docs:
21
- https://metaphor.systems/
5
+ special method inside the agent: `agent.enable_message(DuckduckgoSearchTool)`
22
6
  """
23
7
 
24
8
  from typing import List
@@ -41,8 +25,8 @@ class DuckduckgoSearchTool(ToolMessage):
41
25
 
42
26
  def handle(self) -> str:
43
27
  """
44
- Conducts a search using the metaphor API based on the provided query
45
- and number of results by triggering a metaphor_search.
28
+ Conducts a search using DuckDuckGo based on the provided query
29
+ and number of results by triggering a duckduckgo_search.
46
30
 
47
31
  Returns:
48
32
  str: A formatted string containing the titles, links, and
@@ -562,35 +562,6 @@ class RepoLoader:
562
562
  lines=lines,
563
563
  )
564
564
  )
565
- # dtype: DocumentType = DocumentParser._document_type(file_path, doc_type)
566
- # if dtype in [DocumentType.PDF, DocumentType.DOC, DocumentType.DOCX]:
567
- # doc_parser = DocumentParser.create(
568
- # file_path,
569
- # parser.config,
570
- # doc_type=doc_type,
571
- # )
572
- # new_chunks = doc_parser.get_doc_chunks()
573
- # if len(new_chunks) == 0 and file_extension.lower() == ".pdf":
574
- # doc_parser = ImagePdfParser(file_path, parser.config)
575
- # new_chunks = doc_parser.get_doc_chunks()
576
- # docs.extend(new_chunks)
577
- # else:
578
- # # try getting as plain text; these will be chunked downstream
579
- # with open(file_path, "r") as f:
580
- # if lines is not None:
581
- # file_lines = list(itertools.islice(f, lines))
582
- # content = "\n".join(line.strip() for line in file_lines)
583
- # else:
584
- # content = f.read()
585
- # soup = BeautifulSoup(content, "html.parser")
586
- # text = soup.get_text()
587
- # docs.append(
588
- # Document(
589
- # content=text,
590
- # metadata=DocMetaData(source=str(file_path)),
591
- # )
592
- # )
593
-
594
565
  return docs
595
566
 
596
567
  def load_docs_from_github(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langroid
3
- Version: 0.1.222
3
+ Version: 0.1.225
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  License: MIT
6
6
  Author: Prasad Chalasani
@@ -10,7 +10,7 @@ langroid/agent/helpers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  langroid/agent/junk,sha256=LxfuuW7Cijsg0szAzT81OjWWv1PMNI-6w_-DspVIO2s,339
11
11
  langroid/agent/openai_assistant.py,sha256=QTLBgnH6Btf2GWzN-WApvra-vPQWvYcXcAOULuIy4Ig,32702
12
12
  langroid/agent/special/__init__.py,sha256=XPE076zD-roskxNBn-A1hnh4AHoMiQN9gk1UDjPaBaU,1201
13
- langroid/agent/special/doc_chat_agent.py,sha256=-jMgaAvjMEIVL1iPpxhGYq3_YoIvSfic3em5FzoKtWQ,53342
13
+ langroid/agent/special/doc_chat_agent.py,sha256=DI2FW0uqxspCAMTmOTMe1lWOdjaJx4Wmt2FRWNfRKdA,53277
14
14
  langroid/agent/special/lance_doc_chat_agent.py,sha256=USp0U3eTaJzwF_3bdqE7CedSLbaqAi2tm-VzygcyLaA,10175
15
15
  langroid/agent/special/lance_rag/__init__.py,sha256=QTbs0IVE2ZgDg8JJy1zN97rUUg4uEPH7SLGctFNumk4,174
16
16
  langroid/agent/special/lance_rag/critic_agent.py,sha256=pi_9eMBxEycbWTddtq_yz-mOb2V4SgGm3zfsOH1HU-Q,5775
@@ -31,11 +31,11 @@ langroid/agent/special/sql/utils/description_extractors.py,sha256=RZ2R3DmASxB1ij
31
31
  langroid/agent/special/sql/utils/populate_metadata.py,sha256=x2OMKfmIBnJESBG3qKt6gvr3H3L4ZQcoxHfNdWfHjZs,2987
32
32
  langroid/agent/special/sql/utils/system_message.py,sha256=qKLHkvQWRQodTtPLPxr1GSLUYUFASZU8x-ybV67cB68,1885
33
33
  langroid/agent/special/sql/utils/tools.py,sha256=6uB2424SLtmapui9ggcEr0ZTiB6_dL1-JRGgN8RK9Js,1332
34
- langroid/agent/special/table_chat_agent.py,sha256=rUV7Rv2GFF6Yqv3_uqvgFSs_EdyDUNpdQobTTpjdEtc,9031
34
+ langroid/agent/special/table_chat_agent.py,sha256=-Qtqr2FP8VcyYcA-Pzqa9ucSl1-nXudbNsv_qakSSco,9041
35
35
  langroid/agent/task.py,sha256=sFncTES0L_O2IpbnHRrNzad0HhtsbHoQ7j3Cjc9eTt0,49711
36
36
  langroid/agent/tool_message.py,sha256=2kPsQUwi3ZzINTUNj10huKnZLjLp5SXmefacTHx8QDc,8304
37
37
  langroid/agent/tools/__init__.py,sha256=q-maq3k2BXhPAU99G0H6-j_ozoRvx15I1RFpPVicQIU,304
38
- langroid/agent/tools/duckduckgo_search_tool.py,sha256=yvd735hJkFRgcJF7pgaiIg0OmMw5BMFxqDTyyg1EC9g,2461
38
+ langroid/agent/tools/duckduckgo_search_tool.py,sha256=mLGhlgs6pwbYZIwrOs9shfh1dMBVT4DtkR29pYL3cCQ,1900
39
39
  langroid/agent/tools/extract_tool.py,sha256=u5lL9rKBzaLBOrRyLnTAZ97pQ1uxyLP39XsWMnpaZpw,3789
40
40
  langroid/agent/tools/generator_tool.py,sha256=y0fB0ZObjA0b3L0uSTtrqRCKHDUR95arBftqiUeKD2o,663
41
41
  langroid/agent/tools/google_search_tool.py,sha256=cQxcNtb8XCNpOo_yCeYRwG_y-OATjPgkbr01kea9qWE,1421
@@ -80,7 +80,7 @@ langroid/parsing/image_text.py,sha256=sbLIQ5nHe2UnYUksBaQsmZGaX-X0qgEpPd7CEzi_z5
80
80
  langroid/parsing/para_sentence_split.py,sha256=AJBzZojP3zpB-_IMiiHismhqcvkrVBQ3ZINoQyx_bE4,2000
81
81
  langroid/parsing/parse_json.py,sha256=tgB_oatcrgt6L9ZplC-xBBXjLzL1gjSQf1L2_W5kwFA,4230
82
82
  langroid/parsing/parser.py,sha256=vE5j1LVDeFQPmLrXCWBfvuoPsjjvVIGHcsIWCBR8HDM,10617
83
- langroid/parsing/repo_loader.py,sha256=nyVBvkhh2nXTLFwMcnsayqMrjvtLKXXj89RTBzXBcng,30781
83
+ langroid/parsing/repo_loader.py,sha256=My5UIe-h1xr0I-6Icu0ZVwRHmGRRRW8SrJYMc9J1M9Q,29361
84
84
  langroid/parsing/search.py,sha256=plQtjarB9afGfJLB0CyPXPq3mM4m7kRsfd0_4brziEI,8846
85
85
  langroid/parsing/spider.py,sha256=w_mHR1B4KOmxsBLoVI8kMkMTEbwTzeK3ath9fOMJrTk,3043
86
86
  langroid/parsing/table_loader.py,sha256=qNM4obT_0Y4tjrxNBCNUYjKQ9oETCZ7FbolKBTcz-GM,3410
@@ -121,7 +121,7 @@ langroid/vector_store/meilisearch.py,sha256=d2huA9P-NoYRuAQ9ZeXJmMKr7ry8u90RUSR2
121
121
  langroid/vector_store/momento.py,sha256=9cui31TTrILid2KIzUpBkN2Ey3g_CZWOQVdaFsA4Ors,10045
122
122
  langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
123
123
  langroid/vector_store/qdrantdb.py,sha256=_egbsP9SWBwmI827EDYSSOqfIQSmwNsmJfFTxrLpWYE,13457
124
- langroid-0.1.222.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
125
- langroid-0.1.222.dist-info/METADATA,sha256=QyobDMsdMsLmxSLszrL4QfoMxX3S3qwNNM4WqvHLHAQ,47945
126
- langroid-0.1.222.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
127
- langroid-0.1.222.dist-info/RECORD,,
124
+ langroid-0.1.225.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
125
+ langroid-0.1.225.dist-info/METADATA,sha256=KjNcg_frXWM6GDgGegML_8CngAXR49gX7PLZKtzNk6w,47945
126
+ langroid-0.1.225.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
127
+ langroid-0.1.225.dist-info/RECORD,,