langroid 0.1.253__tar.gz → 0.1.256__tar.gz
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-0.1.253 → langroid-0.1.256}/PKG-INFO +37 -26
- {langroid-0.1.253 → langroid-0.1.256}/README.md +15 -10
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/__init__.py +10 -2
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/doc_chat_agent.py +5 -1
- langroid-0.1.256/langroid/agent/special/sql/__init__.py +17 -0
- langroid-0.1.256/langroid/cachedb/__init__.py +17 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/__init__.py +8 -2
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/document_parser.py +28 -8
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/spider.py +12 -7
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/__init__.py +0 -6
- {langroid-0.1.253 → langroid-0.1.256}/pyproject.toml +23 -9
- langroid-0.1.253/langroid/agent/special/sql/__init__.py +0 -10
- langroid-0.1.253/langroid/cachedb/__init__.py +0 -9
- {langroid-0.1.253 → langroid-0.1.256}/LICENSE +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/base.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/batch.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/chat_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/chat_document.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/helpers.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/junk +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/neo4j/utils/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/neo4j/utils/system_message.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/task.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tool_message.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/extract_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/generator_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/run_python_code.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/agent_config.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/cachedb/base.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/base.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/clustering.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/models.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/exceptions.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/base.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/config.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/openai_assistants.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/openai_gpt.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/utils.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/mytypes.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/code-parsing.md +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/config.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/image_text.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/parser.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/parser.pyi +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/routing.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/search.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/url_loader_cookies.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/urls.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/utils.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/parsing/web_search.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/prompts/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/prompts/chat-gpt4-system-prompt.md +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/prompts/dialog.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/prompts/templates.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/prompts/transforms.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/configuration.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/constants.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/docker.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/globals.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/llms/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/llms/strings.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/logging.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/output/citations.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/output/printing.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/output/status.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/system.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/web/__init__.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/utils/web/login.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/base.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/momento.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/qdrant_cloud.py +0 -0
- {langroid-0.1.253 → langroid-0.1.256}/langroid/vector_store/qdrantdb.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: langroid
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.256
|
4
4
|
Summary: Harness LLMs with Multi-Agent Programming
|
5
5
|
License: MIT
|
6
6
|
Author: Prasad Chalasani
|
@@ -12,6 +12,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
13
13
|
Provides-Extra: chainlit
|
14
14
|
Provides-Extra: chromadb
|
15
|
+
Provides-Extra: db
|
16
|
+
Provides-Extra: doc-chat
|
17
|
+
Provides-Extra: docx
|
18
|
+
Provides-Extra: embeddings
|
15
19
|
Provides-Extra: hf-embeddings
|
16
20
|
Provides-Extra: lancedb
|
17
21
|
Provides-Extra: litellm
|
@@ -23,6 +27,7 @@ Provides-Extra: mysql
|
|
23
27
|
Provides-Extra: neo4j
|
24
28
|
Provides-Extra: pdf-parsers
|
25
29
|
Provides-Extra: postgres
|
30
|
+
Provides-Extra: scrapy
|
26
31
|
Provides-Extra: sql
|
27
32
|
Provides-Extra: transformers
|
28
33
|
Provides-Extra: unstructured
|
@@ -42,7 +47,7 @@ Requires-Dist: google-generativeai (>=0.5.2,<0.6.0)
|
|
42
47
|
Requires-Dist: groq (>=0.5.0,<0.6.0)
|
43
48
|
Requires-Dist: grpcio (>=1.62.1,<2.0.0)
|
44
49
|
Requires-Dist: halo (>=0.0.31,<0.0.32)
|
45
|
-
Requires-Dist: huggingface-hub (>=0.21.2,<0.22.0) ; extra == "transformers"
|
50
|
+
Requires-Dist: huggingface-hub (>=0.21.2,<0.22.0) ; extra == "embeddings" or extra == "transformers"
|
46
51
|
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
|
47
52
|
Requires-Dist: lancedb (>=0.6.2,<0.7.0) ; extra == "lancedb"
|
48
53
|
Requires-Dist: litellm (>=1.30.1,<2.0.0) ; extra == "litellm"
|
@@ -66,40 +71,41 @@ Requires-Dist: nltk (>=3.8.1,<4.0.0)
|
|
66
71
|
Requires-Dist: onnxruntime (>=1.16.1,<2.0.0)
|
67
72
|
Requires-Dist: openai (>=1.14.0,<2.0.0)
|
68
73
|
Requires-Dist: pandas (>=2.0.3,<3.0.0)
|
69
|
-
Requires-Dist: pdf2image (>=1.17.0,<2.0.0) ; extra == "pdf-parsers"
|
70
|
-
Requires-Dist: pdfplumber (>=0.10.2,<0.11.0)
|
74
|
+
Requires-Dist: pdf2image (>=1.17.0,<2.0.0) ; extra == "doc-chat" or extra == "pdf-parsers"
|
75
|
+
Requires-Dist: pdfplumber (>=0.10.2,<0.11.0) ; extra == "doc-chat" or extra == "pdf-parsers"
|
71
76
|
Requires-Dist: prettytable (>=3.8.0,<4.0.0)
|
72
|
-
Requires-Dist: psycopg2 (>=2.9.7,<3.0.0) ; extra == "postgres" or extra == "sql"
|
77
|
+
Requires-Dist: psycopg2 (>=2.9.7,<3.0.0) ; extra == "db" or extra == "postgres" or extra == "sql"
|
73
78
|
Requires-Dist: pyarrow (==15.0.0) ; extra == "lancedb"
|
74
79
|
Requires-Dist: pydantic (==1.10.13)
|
75
80
|
Requires-Dist: pygithub (>=1.58.1,<2.0.0)
|
76
81
|
Requires-Dist: pygments (>=2.15.1,<3.0.0)
|
77
|
-
Requires-Dist: pymupdf (>=1.23.3,<2.0.0) ; extra == "pdf-parsers"
|
78
|
-
Requires-Dist: pymysql (>=1.1.0,<2.0.0) ; extra == "mysql" or extra == "sql"
|
82
|
+
Requires-Dist: pymupdf (>=1.23.3,<2.0.0) ; extra == "doc-chat" or extra == "pdf-parsers"
|
83
|
+
Requires-Dist: pymysql (>=1.1.0,<2.0.0) ; extra == "db" or extra == "mysql" or extra == "sql"
|
79
84
|
Requires-Dist: pyparsing (>=3.0.9,<4.0.0)
|
80
|
-
Requires-Dist: pypdf (>=3.12.2,<4.0.0) ; extra == "pdf-parsers"
|
81
|
-
Requires-Dist: pytesseract (>=0.3.10,<0.4.0) ; extra == "pdf-parsers"
|
82
|
-
Requires-Dist: python-docx (>=1.1.0,<2.0.0)
|
85
|
+
Requires-Dist: pypdf (>=3.12.2,<4.0.0) ; extra == "doc-chat" or extra == "pdf-parsers"
|
86
|
+
Requires-Dist: pytesseract (>=0.3.10,<0.4.0) ; extra == "doc-chat" or extra == "pdf-parsers"
|
87
|
+
Requires-Dist: python-docx (>=1.1.0,<2.0.0) ; extra == "doc-chat" or extra == "docx"
|
83
88
|
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
84
89
|
Requires-Dist: python-magic (>=0.4.27,<0.5.0)
|
85
90
|
Requires-Dist: python-socketio (>=5.11.0,<6.0.0) ; extra == "chainlit"
|
91
|
+
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
86
92
|
Requires-Dist: qdrant-client (>=1.8.0,<2.0.0)
|
87
93
|
Requires-Dist: rank-bm25 (>=0.2.2,<0.3.0)
|
88
94
|
Requires-Dist: redis (>=5.0.1,<6.0.0)
|
89
95
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
90
96
|
Requires-Dist: requests-oauthlib (>=1.3.1,<2.0.0)
|
91
97
|
Requires-Dist: rich (>=13.3.4,<14.0.0)
|
92
|
-
Requires-Dist: scrapy (>=2.11.0,<3.0.0)
|
93
|
-
Requires-Dist: sentence-transformers (==2.2.2) ; extra == "hf-embeddings"
|
94
|
-
Requires-Dist: sqlalchemy (>=2.0.19,<3.0.0) ; extra == "sql"
|
98
|
+
Requires-Dist: scrapy (>=2.11.0,<3.0.0) ; extra == "scrapy"
|
99
|
+
Requires-Dist: sentence-transformers (==2.2.2) ; extra == "embeddings" or extra == "hf-embeddings"
|
100
|
+
Requires-Dist: sqlalchemy (>=2.0.19,<3.0.0) ; extra == "db" or extra == "sql"
|
95
101
|
Requires-Dist: tantivy (>=0.21.0,<0.22.0) ; extra == "lancedb"
|
96
102
|
Requires-Dist: thefuzz (>=0.20.0,<0.21.0)
|
97
103
|
Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
|
98
|
-
Requires-Dist: torch (==2.0.0) ; extra == "hf-embeddings" or extra == "transformers"
|
104
|
+
Requires-Dist: torch (==2.0.0) ; extra == "embeddings" or extra == "hf-embeddings" or extra == "transformers"
|
99
105
|
Requires-Dist: trafilatura (>=1.5.0,<2.0.0)
|
100
|
-
Requires-Dist: transformers (>=4.40.1,<5.0.0) ; extra == "transformers"
|
106
|
+
Requires-Dist: transformers (>=4.40.1,<5.0.0) ; extra == "embeddings" or extra == "transformers"
|
101
107
|
Requires-Dist: typer (>=0.9.0,<0.10.0)
|
102
|
-
Requires-Dist: unstructured[docx,pdf,pptx] (>=0.10.16,<0.10.18) ; extra == "unstructured"
|
108
|
+
Requires-Dist: unstructured[docx,pdf,pptx] (>=0.10.16,<0.10.18) ; extra == "doc-chat" or extra == "unstructured"
|
103
109
|
Requires-Dist: wget (>=3.2,<4.0)
|
104
110
|
Description-Content-Type: text/markdown
|
105
111
|
|
@@ -459,7 +465,8 @@ such as [LiteLLM](https://docs.litellm.ai/docs/providers) that in effect mimic t
|
|
459
465
|
|
460
466
|
### Install `langroid`
|
461
467
|
Langroid requires Python 3.11+. We recommend using a virtual environment.
|
462
|
-
Use `pip` to install `langroid` (from PyPi) to your virtual
|
468
|
+
Use `pip` to install a bare-bones slim version of `langroid` (from PyPi) to your virtual
|
469
|
+
environment:
|
463
470
|
```bash
|
464
471
|
pip install langroid
|
465
472
|
```
|
@@ -467,17 +474,21 @@ The core Langroid package lets you use OpenAI Embeddings models via their API.
|
|
467
474
|
If you instead want to use the `sentence-transformers` embedding models from HuggingFace,
|
468
475
|
install Langroid like this:
|
469
476
|
```bash
|
470
|
-
pip install langroid[hf-embeddings]
|
471
|
-
```
|
472
|
-
If using `zsh` (or similar shells), you may need to escape the square brackets, e.g.:
|
473
|
-
```
|
474
|
-
pip install langroid\[hf-embeddings\]
|
475
|
-
```
|
476
|
-
or use quotes:
|
477
|
-
```
|
478
477
|
pip install "langroid[hf-embeddings]"
|
479
478
|
```
|
480
|
-
|
479
|
+
For many practical scenarios, you may need additional optional dependencies:
|
480
|
+
- To use various document-parsers, install langroid with the `doc-chat` extra:
|
481
|
+
```bash
|
482
|
+
pip install "langroid[doc-chat]"
|
483
|
+
```
|
484
|
+
- For "chat with databases", use the `db` extra:
|
485
|
+
```bash
|
486
|
+
pip install "langroid[db]"
|
487
|
+
``
|
488
|
+
- You can specify multiple extras by separating them with commas, e.g.:
|
489
|
+
```bash
|
490
|
+
pip install "langroid[doc-chat,db]"
|
491
|
+
```
|
481
492
|
|
482
493
|
<details>
|
483
494
|
<summary><b>Optional Installs for using SQL Chat with a PostgreSQL DB </b></summary>
|
@@ -354,7 +354,8 @@ such as [LiteLLM](https://docs.litellm.ai/docs/providers) that in effect mimic t
|
|
354
354
|
|
355
355
|
### Install `langroid`
|
356
356
|
Langroid requires Python 3.11+. We recommend using a virtual environment.
|
357
|
-
Use `pip` to install `langroid` (from PyPi) to your virtual
|
357
|
+
Use `pip` to install a bare-bones slim version of `langroid` (from PyPi) to your virtual
|
358
|
+
environment:
|
358
359
|
```bash
|
359
360
|
pip install langroid
|
360
361
|
```
|
@@ -362,17 +363,21 @@ The core Langroid package lets you use OpenAI Embeddings models via their API.
|
|
362
363
|
If you instead want to use the `sentence-transformers` embedding models from HuggingFace,
|
363
364
|
install Langroid like this:
|
364
365
|
```bash
|
365
|
-
pip install langroid[hf-embeddings]
|
366
|
-
```
|
367
|
-
If using `zsh` (or similar shells), you may need to escape the square brackets, e.g.:
|
368
|
-
```
|
369
|
-
pip install langroid\[hf-embeddings\]
|
370
|
-
```
|
371
|
-
or use quotes:
|
372
|
-
```
|
373
366
|
pip install "langroid[hf-embeddings]"
|
374
367
|
```
|
375
|
-
|
368
|
+
For many practical scenarios, you may need additional optional dependencies:
|
369
|
+
- To use various document-parsers, install langroid with the `doc-chat` extra:
|
370
|
+
```bash
|
371
|
+
pip install "langroid[doc-chat]"
|
372
|
+
```
|
373
|
+
- For "chat with databases", use the `db` extra:
|
374
|
+
```bash
|
375
|
+
pip install "langroid[db]"
|
376
|
+
``
|
377
|
+
- You can specify multiple extras by separating them with commas, e.g.:
|
378
|
+
```bash
|
379
|
+
pip install "langroid[doc-chat,db]"
|
380
|
+
```
|
376
381
|
|
377
382
|
<details>
|
378
383
|
<summary><b>Optional Installs for using SQL Chat with a PostgreSQL DB </b></summary>
|
@@ -16,7 +16,8 @@ from .table_chat_agent import (
|
|
16
16
|
TableChatAgentConfig,
|
17
17
|
PandasEvalTool,
|
18
18
|
)
|
19
|
-
|
19
|
+
|
20
|
+
|
20
21
|
from . import relevance_extractor_agent
|
21
22
|
from . import doc_chat_agent
|
22
23
|
from . import retriever_agent
|
@@ -39,7 +40,6 @@ __all__ = [
|
|
39
40
|
"TableChatAgent",
|
40
41
|
"TableChatAgentConfig",
|
41
42
|
"PandasEvalTool",
|
42
|
-
"sql",
|
43
43
|
"relevance_extractor_agent",
|
44
44
|
"doc_chat_agent",
|
45
45
|
"retriever_agent",
|
@@ -49,3 +49,11 @@ __all__ = [
|
|
49
49
|
"lance_doc_chat_agent",
|
50
50
|
"lance_rag",
|
51
51
|
]
|
52
|
+
|
53
|
+
try:
|
54
|
+
from . import sql
|
55
|
+
|
56
|
+
sql
|
57
|
+
__all__.append("sql")
|
58
|
+
except ImportError:
|
59
|
+
pass
|
@@ -35,6 +35,7 @@ from langroid.embedding_models.models import (
|
|
35
35
|
OpenAIEmbeddingsConfig,
|
36
36
|
SentenceTransformerEmbeddingsConfig,
|
37
37
|
)
|
38
|
+
from langroid.exceptions import LangroidImportError
|
38
39
|
from langroid.language_models.base import StreamingIfAllowed
|
39
40
|
from langroid.language_models.openai_gpt import OpenAIChatModel, OpenAIGPTConfig
|
40
41
|
from langroid.mytypes import DocMetaData, Document, Entity
|
@@ -108,6 +109,9 @@ vecdb_config: VectorStoreConfig = QdrantDBConfig(
|
|
108
109
|
)
|
109
110
|
|
110
111
|
try:
|
112
|
+
import lancedb
|
113
|
+
|
114
|
+
lancedb # appease mypy
|
111
115
|
from langroid.vector_store.lancedb import LanceDBConfig
|
112
116
|
|
113
117
|
vecdb_config = LanceDBConfig(
|
@@ -117,7 +121,7 @@ try:
|
|
117
121
|
embedding=(hf_embed_config if has_sentence_transformers else oai_embed_config),
|
118
122
|
)
|
119
123
|
|
120
|
-
except ImportError:
|
124
|
+
except (ImportError, LangroidImportError):
|
121
125
|
pass
|
122
126
|
|
123
127
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from . import utils
|
2
|
+
|
3
|
+
|
4
|
+
__all__ = [
|
5
|
+
"utils",
|
6
|
+
]
|
7
|
+
|
8
|
+
try:
|
9
|
+
from . import sql_chat_agent
|
10
|
+
from .sql_chat_agent import SQLChatAgentConfig, SQLChatAgent
|
11
|
+
|
12
|
+
sql_chat_agent
|
13
|
+
SQLChatAgent
|
14
|
+
SQLChatAgentConfig
|
15
|
+
__all__.extend(["SQLChatAgentConfig", "SQLChatAgent", "sql_chat_agent"])
|
16
|
+
except ImportError:
|
17
|
+
pass
|
@@ -11,7 +11,6 @@ from . import urls
|
|
11
11
|
from . import utils
|
12
12
|
from . import search
|
13
13
|
from . import web_search
|
14
|
-
from . import spider
|
15
14
|
|
16
15
|
from .parser import (
|
17
16
|
Splitter,
|
@@ -36,7 +35,6 @@ __all__ = [
|
|
36
35
|
"utils",
|
37
36
|
"search",
|
38
37
|
"web_search",
|
39
|
-
"spider",
|
40
38
|
"Splitter",
|
41
39
|
"PdfParsingConfig",
|
42
40
|
"DocxParsingConfig",
|
@@ -44,3 +42,11 @@ __all__ = [
|
|
44
42
|
"ParsingConfig",
|
45
43
|
"Parser",
|
46
44
|
]
|
45
|
+
|
46
|
+
try:
|
47
|
+
from . import spider
|
48
|
+
|
49
|
+
spider
|
50
|
+
__all__.append("spider")
|
51
|
+
except ImportError:
|
52
|
+
pass
|
@@ -1,26 +1,37 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
1
3
|
import itertools
|
2
4
|
import logging
|
3
5
|
import re
|
4
6
|
from enum import Enum
|
5
7
|
from io import BytesIO
|
6
|
-
from typing import Any, Generator, List, Tuple
|
8
|
+
from typing import TYPE_CHECKING, Any, Generator, List, Tuple
|
7
9
|
|
8
10
|
from langroid.exceptions import LangroidImportError
|
9
11
|
|
10
12
|
try:
|
11
13
|
import fitz
|
12
14
|
except ImportError:
|
13
|
-
|
15
|
+
if not TYPE_CHECKING:
|
16
|
+
fitz = None
|
14
17
|
|
15
18
|
try:
|
16
19
|
import pypdf
|
17
20
|
except ImportError:
|
18
|
-
|
21
|
+
if not TYPE_CHECKING:
|
22
|
+
pypdf = None
|
23
|
+
|
24
|
+
try:
|
25
|
+
import pdfplumber
|
26
|
+
except ImportError:
|
27
|
+
if not TYPE_CHECKING:
|
28
|
+
pdfplumber = None
|
19
29
|
|
20
|
-
import pdfplumber
|
21
30
|
import requests
|
22
31
|
from bs4 import BeautifulSoup
|
23
|
-
|
32
|
+
|
33
|
+
if TYPE_CHECKING:
|
34
|
+
from PIL import Image
|
24
35
|
|
25
36
|
from langroid.mytypes import DocMetaData, Document
|
26
37
|
from langroid.parsing.parser import Parser, ParsingConfig
|
@@ -373,19 +384,21 @@ class FitzPDFParser(DocumentParser):
|
|
373
384
|
Parser for processing PDFs using the `fitz` library.
|
374
385
|
"""
|
375
386
|
|
376
|
-
def iterate_pages(self) -> Generator[Tuple[int, fitz.Page], None, None]:
|
387
|
+
def iterate_pages(self) -> Generator[Tuple[int, "fitz.Page"], None, None]:
|
377
388
|
"""
|
378
389
|
Yield each page in the PDF using `fitz`.
|
379
390
|
|
380
391
|
Returns:
|
381
392
|
Generator[fitz.Page]: Generator yielding each page.
|
382
393
|
"""
|
394
|
+
if fitz is None:
|
395
|
+
raise LangroidImportError("fitz", "pdf-parsers")
|
383
396
|
doc = fitz.open(stream=self.doc_bytes, filetype="pdf")
|
384
397
|
for i, page in enumerate(doc):
|
385
398
|
yield i, page
|
386
399
|
doc.close()
|
387
400
|
|
388
|
-
def extract_text_from_page(self, page: fitz.Page) -> str:
|
401
|
+
def extract_text_from_page(self, page: "fitz.Page") -> str:
|
389
402
|
"""
|
390
403
|
Extract text from a given `fitz` page.
|
391
404
|
|
@@ -410,6 +423,8 @@ class PyPDFParser(DocumentParser):
|
|
410
423
|
Returns:
|
411
424
|
Generator[pypdf.pdf.PageObject]: Generator yielding each page.
|
412
425
|
"""
|
426
|
+
if pypdf is None:
|
427
|
+
raise LangroidImportError("pypdf", "pdf-parsers")
|
413
428
|
reader = pypdf.PdfReader(self.doc_bytes)
|
414
429
|
for i, page in enumerate(reader.pages):
|
415
430
|
yield i, page
|
@@ -441,6 +456,8 @@ class PDFPlumberParser(DocumentParser):
|
|
441
456
|
Returns:
|
442
457
|
Generator[pdfplumber.Page]: Generator yielding each page.
|
443
458
|
"""
|
459
|
+
if pdfplumber is None:
|
460
|
+
raise LangroidImportError("pdfplumber", "pdf-parsers")
|
444
461
|
with pdfplumber.open(self.doc_bytes) as pdf:
|
445
462
|
for i, page in enumerate(pdf.pages):
|
446
463
|
yield i, page
|
@@ -654,7 +671,10 @@ class PythonDocxParser(DocumentParser):
|
|
654
671
|
In a DOCX file, pages are not explicitly defined,
|
655
672
|
so we consider each paragraph as a separate 'page' for simplicity.
|
656
673
|
"""
|
657
|
-
|
674
|
+
try:
|
675
|
+
import docx
|
676
|
+
except ImportError:
|
677
|
+
raise LangroidImportError("python-docx", "docx")
|
658
678
|
|
659
679
|
doc = docx.Document(self.doc_bytes)
|
660
680
|
for i, para in enumerate(doc.paragraphs, start=1):
|
@@ -1,13 +1,18 @@
|
|
1
1
|
from typing import List, Set, no_type_check
|
2
2
|
from urllib.parse import urlparse
|
3
3
|
|
4
|
-
from
|
5
|
-
|
6
|
-
|
7
|
-
from
|
8
|
-
from scrapy
|
9
|
-
from scrapy.
|
10
|
-
from
|
4
|
+
from langroid.exceptions import LangroidImportError
|
5
|
+
|
6
|
+
try:
|
7
|
+
from pydispatch import dispatcher
|
8
|
+
from scrapy import signals
|
9
|
+
from scrapy.crawler import CrawlerRunner
|
10
|
+
from scrapy.http import Response
|
11
|
+
from scrapy.linkextractors import LinkExtractor
|
12
|
+
from scrapy.spiders import CrawlSpider, Rule
|
13
|
+
from twisted.internet import defer, reactor
|
14
|
+
except ImportError:
|
15
|
+
raise LangroidImportError("scrapy", "scrapy")
|
11
16
|
|
12
17
|
|
13
18
|
@no_type_check
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "langroid"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.256"
|
4
4
|
description = "Harness LLMs with Multi-Agent Programming"
|
5
5
|
authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
|
6
6
|
readme = "README.md"
|
@@ -44,8 +44,12 @@ pdf2image = {version="^1.17.0", optional=true}
|
|
44
44
|
pytesseract = {version="^0.3.10", optional=true}
|
45
45
|
sqlalchemy = {version="^2.0.19", optional=true}
|
46
46
|
pyarrow = {version="15.0.0", optional=true}
|
47
|
+
pdfplumber = {version="^0.10.2", optional=true}
|
48
|
+
python-docx = {version="^1.1.0", optional=true}
|
49
|
+
scrapy = {version="^2.11.0", optional=true}
|
47
50
|
|
48
|
-
# CORE
|
51
|
+
# ====CORE================================
|
52
|
+
pyyaml = "^6.0.1"
|
49
53
|
onnxruntime = "^1.16.1"
|
50
54
|
fire = "^0.5.0"
|
51
55
|
bs4 = "^0.0.1"
|
@@ -77,32 +81,42 @@ lxml = "^4.9.3"
|
|
77
81
|
|
78
82
|
rank-bm25 = "^0.2.2"
|
79
83
|
thefuzz = "^0.20.0"
|
80
|
-
pdfplumber = "^0.10.2"
|
81
84
|
|
82
85
|
jinja2 = "^3.1.2"
|
83
|
-
|
84
86
|
docstring-parser = "^0.15"
|
85
|
-
scrapy = "^2.11.0"
|
86
|
-
async-generator = "^1.10"
|
87
87
|
|
88
|
-
python-docx = "^1.1.0"
|
89
88
|
aiohttp = "^3.9.1"
|
90
89
|
grpcio = "^1.62.1"
|
91
90
|
duckduckgo-search = "^6.0.0"
|
92
91
|
|
92
|
+
google-generativeai = "^0.5.2"
|
93
93
|
groq = "^0.5.0"
|
94
94
|
nest-asyncio = "^1.6.0"
|
95
|
+
async-generator = "^1.10"
|
96
|
+
|
95
97
|
python-magic = "^0.4.27"
|
96
98
|
|
97
|
-
google-generativeai = "^0.5.2"
|
98
99
|
|
99
100
|
# ================= EXTRAS =================
|
101
|
+
|
100
102
|
[tool.poetry.extras]
|
101
103
|
# install these using, e.g.,
|
102
104
|
# `poetry install -E [...]` where [...] is one of the extras below
|
103
105
|
# or install multiple extras using, e.g., `poetry install -E "litellm mysql"
|
106
|
+
|
107
|
+
# Groupings for common use-cases
|
108
|
+
doc-chat = [
|
109
|
+
"unstructured", "python-docx", "pdfplumber", "pypdf",
|
110
|
+
"pymupdf", "pdf2image", "pytesseract"
|
111
|
+
]
|
112
|
+
db = ["postgres", "mysql", "sqlalchemy", "psycopg2", "pymysql"]
|
113
|
+
embeddings = ["sentence-transformers", "torch", "transformers", "huggingface-hub"]
|
114
|
+
|
115
|
+
# more granular groupings
|
104
116
|
lancedb = ["lancedb", "tantivy", "pyarrow"]
|
105
|
-
pdf-parsers = ["pypdf", "pymupdf", "pdf2image", "pytesseract"]
|
117
|
+
pdf-parsers = ["pdfplumber", "pypdf", "pymupdf", "pdf2image", "pytesseract"]
|
118
|
+
docx = ["python-docx"]
|
119
|
+
scrapy = ["scrapy"]
|
106
120
|
hf-embeddings = ["sentence-transformers", "torch"]
|
107
121
|
transformers = ["transformers", "huggingface-hub", "torch"]
|
108
122
|
unstructured = ["unstructured"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/lance_rag/query_planner_agent.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.253 → langroid-0.1.256}/langroid/agent/special/sql/utils/description_extractors.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.253 → langroid-0.1.256}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.1.253 → langroid-0.1.256}/langroid/language_models/prompt_formatter/llama2_formatter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|