langroid 0.1.222__py3-none-any.whl → 0.1.224__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/doc_chat_agent.py +1 -3
- langroid/agent/tools/duckduckgo_search_tool.py +5 -21
- langroid/parsing/repo_loader.py +0 -29
- {langroid-0.1.222.dist-info → langroid-0.1.224.dist-info}/METADATA +1 -1
- {langroid-0.1.222.dist-info → langroid-0.1.224.dist-info}/RECORD +7 -7
- {langroid-0.1.222.dist-info → langroid-0.1.224.dist-info}/LICENSE +0 -0
- {langroid-0.1.222.dist-info → langroid-0.1.224.dist-info}/WHEEL +0 -0
@@ -389,9 +389,7 @@ class DocChatAgent(ChatAgent):
|
|
389
389
|
if split:
|
390
390
|
docs = self.parser.split(docs)
|
391
391
|
else:
|
392
|
-
|
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
|
|
@@ -1,24 +1,8 @@
|
|
1
1
|
"""
|
2
|
-
A tool to trigger a
|
3
|
-
(
|
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(
|
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
|
45
|
-
and number of results by triggering a
|
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
|
langroid/parsing/repo_loader.py
CHANGED
@@ -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(
|
@@ -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
|
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
|
@@ -35,7 +35,7 @@ langroid/agent/special/table_chat_agent.py,sha256=rUV7Rv2GFF6Yqv3_uqvgFSs_EdyDUN
|
|
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=
|
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=
|
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.
|
125
|
-
langroid-0.1.
|
126
|
-
langroid-0.1.
|
127
|
-
langroid-0.1.
|
124
|
+
langroid-0.1.224.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
125
|
+
langroid-0.1.224.dist-info/METADATA,sha256=RcA6ws7zfEluIKudRchVOZX4qvusx_gjXTbBB4IxuT0,47945
|
126
|
+
langroid-0.1.224.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
127
|
+
langroid-0.1.224.dist-info/RECORD,,
|
File without changes
|
File without changes
|