langroid 0.31.2__py3-none-any.whl → 0.33.3__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.
Files changed (163) hide show
  1. {langroid-0.31.2.dist-info → langroid-0.33.3.dist-info}/METADATA +150 -124
  2. langroid-0.33.3.dist-info/RECORD +7 -0
  3. {langroid-0.31.2.dist-info → langroid-0.33.3.dist-info}/WHEEL +1 -1
  4. langroid-0.33.3.dist-info/entry_points.txt +4 -0
  5. pyproject.toml +317 -212
  6. langroid/__init__.py +0 -106
  7. langroid/agent/.chainlit/config.toml +0 -121
  8. langroid/agent/.chainlit/translations/bn.json +0 -231
  9. langroid/agent/.chainlit/translations/en-US.json +0 -229
  10. langroid/agent/.chainlit/translations/gu.json +0 -231
  11. langroid/agent/.chainlit/translations/he-IL.json +0 -231
  12. langroid/agent/.chainlit/translations/hi.json +0 -231
  13. langroid/agent/.chainlit/translations/kn.json +0 -231
  14. langroid/agent/.chainlit/translations/ml.json +0 -231
  15. langroid/agent/.chainlit/translations/mr.json +0 -231
  16. langroid/agent/.chainlit/translations/ta.json +0 -231
  17. langroid/agent/.chainlit/translations/te.json +0 -231
  18. langroid/agent/.chainlit/translations/zh-CN.json +0 -229
  19. langroid/agent/__init__.py +0 -41
  20. langroid/agent/base.py +0 -1981
  21. langroid/agent/batch.py +0 -398
  22. langroid/agent/callbacks/__init__.py +0 -0
  23. langroid/agent/callbacks/chainlit.py +0 -598
  24. langroid/agent/chat_agent.py +0 -1899
  25. langroid/agent/chat_document.py +0 -454
  26. langroid/agent/helpers.py +0 -0
  27. langroid/agent/junk +0 -13
  28. langroid/agent/openai_assistant.py +0 -882
  29. langroid/agent/special/__init__.py +0 -59
  30. langroid/agent/special/arangodb/__init__.py +0 -0
  31. langroid/agent/special/arangodb/arangodb_agent.py +0 -656
  32. langroid/agent/special/arangodb/system_messages.py +0 -186
  33. langroid/agent/special/arangodb/tools.py +0 -107
  34. langroid/agent/special/arangodb/utils.py +0 -36
  35. langroid/agent/special/doc_chat_agent.py +0 -1466
  36. langroid/agent/special/lance_doc_chat_agent.py +0 -262
  37. langroid/agent/special/lance_rag/__init__.py +0 -9
  38. langroid/agent/special/lance_rag/critic_agent.py +0 -198
  39. langroid/agent/special/lance_rag/lance_rag_task.py +0 -82
  40. langroid/agent/special/lance_rag/query_planner_agent.py +0 -260
  41. langroid/agent/special/lance_tools.py +0 -61
  42. langroid/agent/special/neo4j/__init__.py +0 -0
  43. langroid/agent/special/neo4j/csv_kg_chat.py +0 -174
  44. langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -433
  45. langroid/agent/special/neo4j/system_messages.py +0 -120
  46. langroid/agent/special/neo4j/tools.py +0 -32
  47. langroid/agent/special/relevance_extractor_agent.py +0 -127
  48. langroid/agent/special/retriever_agent.py +0 -56
  49. langroid/agent/special/sql/__init__.py +0 -17
  50. langroid/agent/special/sql/sql_chat_agent.py +0 -654
  51. langroid/agent/special/sql/utils/__init__.py +0 -21
  52. langroid/agent/special/sql/utils/description_extractors.py +0 -190
  53. langroid/agent/special/sql/utils/populate_metadata.py +0 -85
  54. langroid/agent/special/sql/utils/system_message.py +0 -35
  55. langroid/agent/special/sql/utils/tools.py +0 -64
  56. langroid/agent/special/table_chat_agent.py +0 -263
  57. langroid/agent/structured_message.py +0 -9
  58. langroid/agent/task.py +0 -2093
  59. langroid/agent/tool_message.py +0 -393
  60. langroid/agent/tools/__init__.py +0 -38
  61. langroid/agent/tools/duckduckgo_search_tool.py +0 -50
  62. langroid/agent/tools/file_tools.py +0 -234
  63. langroid/agent/tools/google_search_tool.py +0 -39
  64. langroid/agent/tools/metaphor_search_tool.py +0 -67
  65. langroid/agent/tools/orchestration.py +0 -303
  66. langroid/agent/tools/recipient_tool.py +0 -235
  67. langroid/agent/tools/retrieval_tool.py +0 -32
  68. langroid/agent/tools/rewind_tool.py +0 -137
  69. langroid/agent/tools/segment_extract_tool.py +0 -41
  70. langroid/agent/typed_task.py +0 -19
  71. langroid/agent/xml_tool_message.py +0 -382
  72. langroid/agent_config.py +0 -0
  73. langroid/cachedb/__init__.py +0 -17
  74. langroid/cachedb/base.py +0 -58
  75. langroid/cachedb/momento_cachedb.py +0 -108
  76. langroid/cachedb/redis_cachedb.py +0 -153
  77. langroid/embedding_models/__init__.py +0 -39
  78. langroid/embedding_models/base.py +0 -74
  79. langroid/embedding_models/clustering.py +0 -189
  80. langroid/embedding_models/models.py +0 -461
  81. langroid/embedding_models/protoc/__init__.py +0 -0
  82. langroid/embedding_models/protoc/embeddings.proto +0 -19
  83. langroid/embedding_models/protoc/embeddings_pb2.py +0 -33
  84. langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -50
  85. langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -79
  86. langroid/embedding_models/remote_embeds.py +0 -153
  87. langroid/exceptions.py +0 -65
  88. langroid/experimental/team-save.py +0 -391
  89. langroid/language_models/.chainlit/config.toml +0 -121
  90. langroid/language_models/.chainlit/translations/en-US.json +0 -231
  91. langroid/language_models/__init__.py +0 -53
  92. langroid/language_models/azure_openai.py +0 -153
  93. langroid/language_models/base.py +0 -678
  94. langroid/language_models/config.py +0 -18
  95. langroid/language_models/mock_lm.py +0 -124
  96. langroid/language_models/openai_gpt.py +0 -1923
  97. langroid/language_models/prompt_formatter/__init__.py +0 -16
  98. langroid/language_models/prompt_formatter/base.py +0 -40
  99. langroid/language_models/prompt_formatter/hf_formatter.py +0 -132
  100. langroid/language_models/prompt_formatter/llama2_formatter.py +0 -75
  101. langroid/language_models/utils.py +0 -147
  102. langroid/mytypes.py +0 -84
  103. langroid/parsing/__init__.py +0 -52
  104. langroid/parsing/agent_chats.py +0 -38
  105. langroid/parsing/code-parsing.md +0 -86
  106. langroid/parsing/code_parser.py +0 -121
  107. langroid/parsing/config.py +0 -0
  108. langroid/parsing/document_parser.py +0 -718
  109. langroid/parsing/image_text.py +0 -32
  110. langroid/parsing/para_sentence_split.py +0 -62
  111. langroid/parsing/parse_json.py +0 -155
  112. langroid/parsing/parser.py +0 -313
  113. langroid/parsing/repo_loader.py +0 -790
  114. langroid/parsing/routing.py +0 -36
  115. langroid/parsing/search.py +0 -275
  116. langroid/parsing/spider.py +0 -102
  117. langroid/parsing/table_loader.py +0 -94
  118. langroid/parsing/url_loader.py +0 -111
  119. langroid/parsing/url_loader_cookies.py +0 -73
  120. langroid/parsing/urls.py +0 -273
  121. langroid/parsing/utils.py +0 -373
  122. langroid/parsing/web_search.py +0 -155
  123. langroid/prompts/__init__.py +0 -9
  124. langroid/prompts/chat-gpt4-system-prompt.md +0 -68
  125. langroid/prompts/dialog.py +0 -17
  126. langroid/prompts/prompts_config.py +0 -5
  127. langroid/prompts/templates.py +0 -141
  128. langroid/pydantic_v1/__init__.py +0 -10
  129. langroid/pydantic_v1/main.py +0 -4
  130. langroid/utils/.chainlit/config.toml +0 -121
  131. langroid/utils/.chainlit/translations/en-US.json +0 -231
  132. langroid/utils/__init__.py +0 -19
  133. langroid/utils/algorithms/__init__.py +0 -3
  134. langroid/utils/algorithms/graph.py +0 -103
  135. langroid/utils/configuration.py +0 -98
  136. langroid/utils/constants.py +0 -30
  137. langroid/utils/docker.py +0 -37
  138. langroid/utils/git_utils.py +0 -252
  139. langroid/utils/globals.py +0 -49
  140. langroid/utils/llms/__init__.py +0 -0
  141. langroid/utils/llms/strings.py +0 -8
  142. langroid/utils/logging.py +0 -135
  143. langroid/utils/object_registry.py +0 -66
  144. langroid/utils/output/__init__.py +0 -20
  145. langroid/utils/output/citations.py +0 -41
  146. langroid/utils/output/printing.py +0 -99
  147. langroid/utils/output/status.py +0 -40
  148. langroid/utils/pandas_utils.py +0 -30
  149. langroid/utils/pydantic_utils.py +0 -602
  150. langroid/utils/system.py +0 -286
  151. langroid/utils/types.py +0 -93
  152. langroid/utils/web/__init__.py +0 -0
  153. langroid/utils/web/login.py +0 -83
  154. langroid/vector_store/__init__.py +0 -50
  155. langroid/vector_store/base.py +0 -357
  156. langroid/vector_store/chromadb.py +0 -214
  157. langroid/vector_store/lancedb.py +0 -401
  158. langroid/vector_store/meilisearch.py +0 -299
  159. langroid/vector_store/momento.py +0 -278
  160. langroid/vector_store/qdrant_cloud.py +0 -6
  161. langroid/vector_store/qdrantdb.py +0 -468
  162. langroid-0.31.2.dist-info/RECORD +0 -162
  163. {langroid-0.31.2.dist-info → langroid-0.33.3.dist-info/licenses}/LICENSE +0 -0
pyproject.toml CHANGED
@@ -1,251 +1,356 @@
1
- [tool.poetry]
1
+ [project]
2
2
  name = "langroid"
3
- version = "0.31.2"
3
+ version = "0.33.3"
4
+ authors = [
5
+ { name = "Prasad Chalasani", email = "pchalasani@gmail.com" },
6
+ ]
4
7
  description = "Harness LLMs with Multi-Agent Programming"
5
- authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
6
8
  readme = "README.md"
7
- license = "MIT"
8
- include = ["pyproject.toml", "langroid/py.typed"]
9
-
10
-
11
- # =============== MAIN DEPS ==============
12
- [tool.poetry.dependencies]
13
- python = ">=3.10,<3.13"
14
-
15
- # =========== OPTIONALS ==============================
16
- chromadb = {version=">=0.4.21, <=0.4.23", optional=true}
17
- momento = {version=">=1.10.2, < 1.21", optional=true}
18
- unstructured = {extras = ["docx", "pptx", "pdf"], version = ">=0.10.16,<0.10.18", optional=true}
19
- sentence-transformers = {version="^2.2.2", optional=true}
20
- torch = {version="^2.0.0", optional=true}
21
- psycopg2 = {version="^2.9.7", optional=true}
22
- pymysql = {version = "^1.1.0", optional = true}
23
- meilisearch-python-sdk = {version="^2.2.3", optional=true}
24
- litellm = {version = "^1.30.1", optional = true}
25
- metaphor-python = {version = "^0.1.23", optional = true}
26
- chainlit = {version = "^1.3.2", optional = true}
27
- python-socketio = {version="^5.11.0", optional=true}
28
- neo4j = {version = "^5.14.1", optional = true}
29
- huggingface-hub = {version="^0.21.2", optional=true}
30
- transformers = {version="^4.40.1", optional=true}
31
- lancedb = {version="^0.8.2", optional=true}
32
- tantivy = {version="^0.21.0", optional=true}
33
- pypdf = {version=">=5.1.0", optional=true}
34
- pymupdf = {version="^1.23.3", optional=true}
35
- pdf2image = {version="^1.17.0", optional=true}
36
- pytesseract = {version="^0.3.10", optional=true}
37
- sqlalchemy = {version="^2.0.19", optional=true}
38
- pyarrow = {version="15.0.0", optional=true}
39
- pdfplumber = {version="^0.10.2", optional=true}
40
- python-docx = {version="^1.1.0", optional=true}
41
- scrapy = {version="^2.11.0", optional=true}
42
- fastembed = {version="^0.3.1", optional=true}
43
-
44
- # ====CORE================================
45
- pyyaml = "^6.0.1"
46
- onnxruntime = "^1.16.1"
47
- fire = "^0.5.0"
48
- bs4 = "^0.0.1"
49
- python-dotenv = "^1.0.0"
50
- wget = "^3.2"
51
- rich = "^13.3.4"
52
- requests-oauthlib = "^1.3.1"
53
- trafilatura = "^1.5.0"
54
- halo = "^0.0.31"
55
- typer = "^0.9.0"
56
- colorlog = "^6.7.0"
57
- openai = "^1.45.0"
58
- tiktoken = "^0.7.0"
59
- pygithub = "^1.58.1"
60
- pygments = "^2.15.1"
61
- redis = "^5.0.1"
62
- fakeredis = "^2.12.1"
63
- faker = "^18.9.0"
64
- requests = "^2.31.0"
65
- pyparsing = "^3.0.9"
66
- nltk = "^3.8.2"
67
- qdrant-client = "^1.8.0"
68
- pydantic = ">=1,<2.10.2"
69
- pandas = "^2.0.3"
70
- prettytable = "^3.8.0"
71
-
72
- google-api-python-client = "^2.95.0"
73
- lxml = "^4.9.3"
74
-
75
- rank-bm25 = "^0.2.2"
76
- thefuzz = "^0.20.0"
77
-
78
- jinja2 = "^3.1.2"
79
- docstring-parser = "^0.16"
80
-
81
- aiohttp = "^3.9.1"
82
- grpcio = "^1.62.1"
83
- duckduckgo-search = "^6.0.0"
84
-
85
- google-generativeai = "^0.5.2"
86
- groq = "^0.13.0"
87
- nest-asyncio = "^1.6.0"
88
- async-generator = "^1.10"
89
-
90
- python-magic = "^0.4.27"
91
- json-repair = "^0.29.9"
92
- cerebras-cloud-sdk = "^1.1.0"
93
- gitpython = "^3.1.43"
94
- python-arango = {version="^8.1.2", optional=true}
95
- arango-datasets = {version="^1.2.2", optional=true}
96
- adb-cloud-connector = "^1.0.2"
97
- pytest-rerunfailures = "^15.0"
98
-
9
+ requires-python = "<3.13,>=3.10"
10
+ dependencies = [
11
+ "adb-cloud-connector<2.0.0,>=1.0.2",
12
+ "aiohttp<4.0.0,>=3.9.1",
13
+ "async-generator<2.0,>=1.10",
14
+ "bs4<1.0.0,>=0.0.1",
15
+ "cerebras-cloud-sdk<2.0.0,>=1.1.0",
16
+ "colorlog<7.0.0,>=6.7.0",
17
+ "docstring-parser<1.0,>=0.16",
18
+ "duckduckgo-search<7.0.0,>=6.0.0",
19
+ "faker<19.0.0,>=18.9.0",
20
+ "fakeredis<3.0.0,>=2.12.1",
21
+ "fire<1.0.0,>=0.5.0",
22
+ "gitpython<4.0.0,>=3.1.43",
23
+ "google-api-python-client<3.0.0,>=2.95.0",
24
+ "google-generativeai<1.0.0,>=0.5.2",
25
+ "groq<1.0.0,>=0.13.0",
26
+ "grpcio<2.0.0,>=1.62.1",
27
+ "halo<1.0.0,>=0.0.31",
28
+ "jinja2<4.0.0,>=3.1.2",
29
+ "json-repair<1.0.0,>=0.29.9",
30
+ "lxml<5.0.0,>=4.9.3",
31
+ "nest-asyncio<2.0.0,>=1.6.0",
32
+ "nltk<4.0.0,>=3.8.2",
33
+ "onnxruntime<2.0.0,>=1.16.1",
34
+ "openai<2.0.0,>=1.45.0",
35
+ "pandas<3.0.0,>=2.0.3",
36
+ "prettytable<4.0.0,>=3.8.0",
37
+ "pydantic<2.10.2,>=1",
38
+ "pygithub<2.0.0,>=1.58.1",
39
+ "pygments<3.0.0,>=2.15.1",
40
+ "pyparsing<4.0.0,>=3.0.9",
41
+ "pytest-rerunfailures<16.0,>=15.0",
42
+ "python-dotenv<2.0.0,>=1.0.0",
43
+ "python-magic<1.0.0,>=0.4.27",
44
+ "pyyaml<7.0.0,>=6.0.1",
45
+ "qdrant-client<2.0.0,>=1.8.0",
46
+ "rank-bm25<1.0.0,>=0.2.2",
47
+ "redis<6.0.0,>=5.0.1",
48
+ "requests<3.0.0,>=2.31.0",
49
+ "requests-oauthlib<2.0.0,>=1.3.1",
50
+ "rich<14.0.0,>=13.3.4",
51
+ "thefuzz<1.0.0,>=0.20.0",
52
+ "tiktoken<1.0.0,>=0.7.0",
53
+ "trafilatura<2.0.0,>=1.5.0",
54
+ "typer<1.0.0,>=0.9.0",
55
+ "wget<4.0,>=3.2",
56
+ ]
99
57
 
100
- [tool.poetry.extras]
101
- # install these using, e.g.,
102
- # `poetry install -E [...]` where [...] is one of the extras below
103
- # or install multiple extras using, e.g., `poetry install -E "litellm mysql"
58
+ [project.license]
59
+ text = "MIT"
104
60
 
105
- # Groupings for common use-cases
61
+ [project.optional-dependencies]
106
62
  doc-chat = [
107
- "unstructured", "python-docx", "pdfplumber", "pypdf",
108
- "pymupdf", "pdf2image", "pytesseract"
63
+ "pdf2image<2.0.0,>=1.17.0",
64
+ "pdfplumber<0.11.0,>=0.10.2",
65
+ "pymupdf<2.0.0,>=1.23.3",
66
+ "pypdf>=5.1.0",
67
+ "pytesseract<0.4.0,>=0.3.10",
68
+ "python-docx<2.0.0,>=1.1.0",
69
+ "unstructured[docx,pdf,pptx]<0.10.18,>=0.10.16",
70
+ ]
71
+ hf-transformers = [
72
+ "sentence-transformers<3.0.0,>=2.2.2",
73
+ "torch<3.0.0,>=2.0.0",
74
+ "transformers<5.0.0,>=4.40.1",
75
+ "huggingface-hub<0.22.0,>=0.21.2",
76
+ ]
77
+ vecdbs = [
78
+ "lancedb<0.9.0,>=0.8.2",
79
+ "tantivy<0.22.0,>=0.21.0",
80
+ "pyarrow<16.0.0,>=15.0.0",
81
+ "chromadb<=0.4.23,>=0.4.21",
82
+ ]
83
+ db = [
84
+ "sqlalchemy<3.0.0,>=2.0.19",
85
+ "psycopg2<3.0.0,>=2.9.7",
86
+ "pymysql<2.0.0,>=1.1.0",
109
87
  ]
110
- db = ["postgres", "mysql", "sqlalchemy", "psycopg2", "pymysql"]
111
- hf-transformers = ["sentence-transformers", "torch", "transformers", "huggingface-hub"]
112
- vecdbs = ["lancedb", "tantivy", "pyarrow", "chromadb"]
113
88
  all = [
114
- "unstructured", "python-docx", "pdfplumber", "pypdf",
115
- "pymupdf", "pdf2image", "pytesseract",
116
- "postgres", "mysql", "sqlalchemy", "psycopg2", "pymysql",
117
- "sentence-transformers", "torch", "transformers", "huggingface-hub",
118
- # "lancedb", "tantivy", "pyarrow",
119
- "chromadb",
120
- "metaphor-python", "neo4j",
121
- "python-arango", "arango-datasets",
122
- "litellm",
123
- "chainlit", "python-socketio",
124
- "fastembed"
125
- ]
126
- # more granular groupings
127
- lancedb = ["lancedb", "tantivy", "pyarrow"]
128
- pdf-parsers = ["pdfplumber", "pypdf", "pymupdf", "pdf2image", "pytesseract"]
129
- docx = ["python-docx"]
130
- scrapy = ["scrapy"]
131
- hf-embeddings = ["sentence-transformers", "torch"]
132
- transformers = ["transformers", "huggingface-hub", "torch"]
133
- unstructured = ["unstructured"]
134
- postgres = ["psycopg2"]
135
- mysql = ["pymysql"]
136
- sql = ["sqlalchemy", "pymysql", "psycopg2"]
137
- litellm = ["litellm"]
138
- neo4j = ["neo4j"]
139
- arango = ["python-arango", "arango-datasets"]
140
- metaphor = ["metaphor-python"]
141
- chainlit = ["chainlit", "python-socketio"]
142
- chromadb = ["chromadb"]
143
- mkdocs = [
144
- "mkdocs", "mkdocs-material", "mkdocstrings", "mkdocs-awesome-pages-plugin",
145
- "mkdocs-gen-files", "mkdocs-literate-nav",
146
- "mkdocs-section-index", "mkdocs-jupyter", "mkdocs-rss-plugin"
147
- ]
148
- meilisearch = ["meilisearch-python-sdk"]
149
- momento = ["momento"]
150
- fastembed = ["fastembed"]
151
-
152
-
153
- # ================= DEV DEPS =================
154
- [tool.poetry.group.dev.dependencies]
155
- black = {extras = ["jupyter"], version = "^24.3.0"}
156
- flake8 = "^6.0.0"
157
- mypy = "^1.11.2"
158
- ruff = "^0.8.4"
159
- pre-commit = "^3.3.2"
160
- autopep8 = "^2.0.2"
161
-
162
- types-redis = "^4.5.5.2"
163
- types-requests = "^2.31.0.1"
164
- types-pyyaml = "^6.0.12.20240311"
165
- types-pillow = "^10.2.0.20240406"
166
-
167
- pytest = "^7.3.1"
168
- pytest-redis = "^3.0.2"
169
- pytest-asyncio = "^0.21.1"
170
- pytest-postgresql = "^5.0.0"
171
- pytest-mysql = "^2.4.2"
172
- coverage = "^7.2.5"
173
- pytest-xdist = "^3.6.1"
174
- pytest-timeout = "^2.3.1"
175
- pytest-cov = "^5.0.0"
176
- docker = "^7.1.0"
177
-
178
- [tool.poetry.group.docs]
179
- optional = true
180
-
181
- [tool.poetry.group.docs.dependencies]
182
-
183
- mkdocs = "^1.4.2"
184
- mkdocs-material = "^9.1.5"
185
- mkdocstrings = {extras = ["python"], version = "^0.25.2"}
186
- mkdocs-awesome-pages-plugin = "^2.8.0"
187
- mkdocs-rss-plugin = "^1.8.0"
188
- mkdocs-gen-files = "^0.4.0"
189
- mkdocs-literate-nav = "^0.6.0"
190
- mkdocs-section-index = "^0.3.5"
191
- mkdocs-jupyter = "^0.24.1"
192
- griffe = "<1.0.0"
89
+ "pdf2image<2.0.0,>=1.17.0",
90
+ "pdfplumber<0.11.0,>=0.10.2",
91
+ "pymupdf<2.0.0,>=1.23.3",
92
+ "pypdf>=5.1.0",
93
+ "pytesseract<0.4.0,>=0.3.10",
94
+ "python-docx<2.0.0,>=1.1.0",
95
+ "unstructured[docx,pdf,pptx]<0.10.18,>=0.10.16",
96
+ "sqlalchemy<3.0.0,>=2.0.19",
97
+ "psycopg2<3.0.0,>=2.9.7",
98
+ "pymysql<2.0.0,>=1.1.0",
99
+ "sentence-transformers<3.0.0,>=2.2.2",
100
+ "torch<3.0.0,>=2.0.0",
101
+ "transformers<5.0.0,>=4.40.1",
102
+ "huggingface-hub<0.22.0,>=0.21.2",
103
+ "chromadb<=0.4.23,>=0.4.21",
104
+ "metaphor-python<0.2.0,>=0.1.23",
105
+ "neo4j<6.0.0,>=5.14.1",
106
+ "python-arango<9.0.0,>=8.1.2",
107
+ "arango-datasets<2.0.0,>=1.2.2",
108
+ "litellm<2.0.0,>=1.30.1",
109
+ "chainlit<2.0.0,>=1.3.2",
110
+ "python-socketio<6.0.0,>=5.11.0",
111
+ "fastembed<0.4.0,>=0.3.1",
112
+ ]
113
+ lancedb = [
114
+ "lancedb<0.9.0,>=0.8.2",
115
+ "tantivy<0.22.0,>=0.21.0",
116
+ "pyarrow<16.0.0,>=15.0.0",
117
+ ]
118
+ pdf-parsers = [
119
+ "pdfplumber<0.11.0,>=0.10.2",
120
+ "pypdf>=5.1.0",
121
+ "pymupdf<2.0.0,>=1.23.3",
122
+ "pdf2image<2.0.0,>=1.17.0",
123
+ "pytesseract<0.4.0,>=0.3.10",
124
+ ]
125
+ docx = [
126
+ "python-docx<2.0.0,>=1.1.0",
127
+ ]
128
+ scrapy = [
129
+ "scrapy<3.0.0,>=2.11.0",
130
+ ]
131
+ hf-embeddings = [
132
+ "sentence-transformers<3.0.0,>=2.2.2",
133
+ "torch<3.0.0,>=2.0.0",
134
+ ]
135
+ transformers = [
136
+ "transformers<5.0.0,>=4.40.1",
137
+ "huggingface-hub<0.22.0,>=0.21.2",
138
+ "torch<3.0.0,>=2.0.0",
139
+ ]
140
+ unstructured = [
141
+ "unstructured[docx,pdf,pptx]<0.10.18,>=0.10.16",
142
+ ]
143
+ postgres = [
144
+ "psycopg2<3.0.0,>=2.9.7",
145
+ ]
146
+ mysql = [
147
+ "pymysql<2.0.0,>=1.1.0",
148
+ ]
149
+ sql = [
150
+ "sqlalchemy<3.0.0,>=2.0.19",
151
+ "pymysql<2.0.0,>=1.1.0",
152
+ "psycopg2<3.0.0,>=2.9.7",
153
+ ]
154
+ litellm = [
155
+ "litellm<2.0.0,>=1.30.1",
156
+ ]
157
+ neo4j = [
158
+ "neo4j<6.0.0,>=5.14.1",
159
+ ]
160
+ arango = [
161
+ "python-arango<9.0.0,>=8.1.2",
162
+ "arango-datasets<2.0.0,>=1.2.2",
163
+ ]
164
+ metaphor = [
165
+ "metaphor-python<0.2.0,>=0.1.23",
166
+ ]
167
+ chainlit = [
168
+ "chainlit<2.0.0,>=1.3.2",
169
+ "python-socketio<6.0.0,>=5.11.0",
170
+ ]
171
+ chromadb = [
172
+ "chromadb<=0.4.23,>=0.4.21",
173
+ ]
174
+ meilisearch = [
175
+ "meilisearch-python-sdk<3.0.0,>=2.2.3",
176
+ ]
177
+ momento = [
178
+ "momento<1.21.0,>=1.10.2",
179
+ ]
180
+ fastembed = [
181
+ "fastembed<0.4.0,>=0.3.1",
182
+ ]
193
183
 
184
+ [dependency-groups]
185
+ dev = [
186
+ "black[jupyter]<25.0.0,>=24.3.0",
187
+ "flake8<7.0.0,>=6.0.0",
188
+ "mypy<2.0.0,>=1.11.2",
189
+ "ruff<1.0.0,>=0.8.4",
190
+ "pre-commit<4.0.0,>=3.3.2",
191
+ "autopep8<3.0.0,>=2.0.2",
192
+ "types-redis<5.0.0.0,>=4.5.5.2",
193
+ "types-requests<3.0.0.0,>=2.31.0.1",
194
+ "types-pyyaml<7.0.0.0,>=6.0.12.20240311",
195
+ "types-pillow<11.0.0.0,>=10.2.0.20240406",
196
+ "pytest<8.0.0,>=7.3.1",
197
+ "pytest-redis<4.0.0,>=3.0.2",
198
+ "pytest-asyncio<1.0.0,>=0.21.1",
199
+ "pytest-postgresql<6.0.0,>=5.0.0",
200
+ "pytest-mysql<3.0.0,>=2.4.2",
201
+ "coverage<8.0.0,>=7.2.5",
202
+ "pytest-xdist<4.0.0,>=3.6.1",
203
+ "pytest-timeout<3.0.0,>=2.3.1",
204
+ "pytest-cov<6.0.0,>=5.0.0",
205
+ "docker<8.0.0,>=7.1.0",
206
+ "commitizen>=4.1.0",
207
+ ]
208
+ docs = [
209
+ "mkdocs<2.0.0,>=1.4.2",
210
+ "mkdocs-material<10.0.0,>=9.1.5",
211
+ "mkdocstrings[python]<1.0.0,>=0.25.2",
212
+ "mkdocs-awesome-pages-plugin<3.0.0,>=2.8.0",
213
+ "mkdocs-rss-plugin<2.0.0,>=1.8.0",
214
+ "mkdocs-gen-files<1.0.0,>=0.4.0",
215
+ "mkdocs-literate-nav<1.0.0,>=0.6.0",
216
+ "mkdocs-section-index<1.0.0,>=0.3.5",
217
+ "mkdocs-jupyter<1.0.0,>=0.24.1",
218
+ "griffe<1.0.0",
219
+ ]
194
220
 
195
- # ========================================
196
221
  [build-system]
197
- requires = ["poetry-core"]
198
- build-backend = "poetry.core.masonry.api"
222
+ requires = [
223
+ "pdm-backend",
224
+ ]
225
+ build-backend = "pdm.backend"
226
+
227
+ [tool.pdm.build]
228
+ includes = [
229
+ "pyproject.toml",
230
+ "langroid/py.typed",
231
+ ]
232
+ excludes = [
233
+ "tests/",
234
+ ]
199
235
 
200
236
  [tool.black]
201
237
  line-length = 88
202
- include = '\.pyi?$'
203
- # extend-exclude = '.*pyi$'
204
- # exclude = '^stubs/'
238
+ include = "\\.pyi?$"
205
239
 
206
240
  [tool.pytype]
207
- inputs = ["langroid"]
241
+ inputs = [
242
+ "langroid",
243
+ ]
208
244
 
209
245
  [tool.mypy]
210
246
  python_version = "3.11"
211
- #mypy_path = ["stubs"]
212
-
213
- #follow_imports = "skip"
214
- #check_untyped_defs = true
215
247
  disallow_untyped_defs = true
216
248
  ignore_missing_imports = true
217
249
  warn_unused_ignores = false
218
250
  strict = true
219
251
  exclude = [
220
- "docs", ".venv", "venv", "examples", "examples_dev", "langroid/utils/web",
252
+ "docs",
253
+ ".venv",
254
+ "venv",
255
+ "examples",
256
+ "examples_dev",
257
+ "langroid/utils/web",
221
258
  "notebooks",
222
259
  "langroid/parsing/repo_loader.py",
223
260
  "langroid/embedding_models/clustering.py",
224
261
  "langroid/agent/callbacks/chainlit.py",
225
262
  "langroid/vector_store/chromadb.py",
226
- "langroid/embedding_models/protoc" # ignore generated files
263
+ "langroid/embedding_models/protoc",
264
+ ]
265
+ files = [
266
+ "langroid/*",
227
267
  ]
228
- files=["langroid/*"]
229
268
  plugins = [
230
- "pydantic.mypy"
269
+ "pydantic.mypy",
231
270
  ]
232
271
 
233
272
  [tool.ruff]
234
273
  line-length = 88
235
- # Allow unused variables when underscore-prefixed.
236
- lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
237
- # Assume Python 3.11.
238
274
  target-version = "py311"
239
- lint.select = [
240
- "E", # pycodestyle
241
- "F", # pyflakes
242
- "I", # isort
243
- ]
244
- lint.exclude = ["docs/**", ".venv", "venv", "examples/**", "examples_dev", "langroid/utils/web", "notebooks", "__init__.py", "langroid/embedding_models/protoc/*"]
245
- lint.fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
246
- lint.unfixable = []
247
- lint.extend-ignore = ["F821", "F401"]
275
+
276
+ [tool.ruff.lint]
277
+ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
278
+ select = [
279
+ "E",
280
+ "F",
281
+ "I",
282
+ ]
283
+ exclude = [
284
+ "docs/**",
285
+ ".venv",
286
+ "venv",
287
+ "examples/**",
288
+ "examples_dev",
289
+ "langroid/utils/web",
290
+ "notebooks",
291
+ "__init__.py",
292
+ "langroid/embedding_models/protoc/*",
293
+ ]
294
+ fixable = [
295
+ "A",
296
+ "B",
297
+ "C",
298
+ "D",
299
+ "E",
300
+ "F",
301
+ "G",
302
+ "I",
303
+ "N",
304
+ "Q",
305
+ "S",
306
+ "T",
307
+ "W",
308
+ "ANN",
309
+ "ARG",
310
+ "BLE",
311
+ "COM",
312
+ "DJ",
313
+ "DTZ",
314
+ "EM",
315
+ "ERA",
316
+ "EXE",
317
+ "FBT",
318
+ "ICN",
319
+ "INP",
320
+ "ISC",
321
+ "NPY",
322
+ "PD",
323
+ "PGH",
324
+ "PIE",
325
+ "PL",
326
+ "PT",
327
+ "PTH",
328
+ "PYI",
329
+ "RET",
330
+ "RSE",
331
+ "RUF",
332
+ "SIM",
333
+ "SLF",
334
+ "TCH",
335
+ "TID",
336
+ "TRY",
337
+ "UP",
338
+ "YTT",
339
+ ]
340
+ unfixable = []
341
+ extend-ignore = [
342
+ "F821",
343
+ "F401",
344
+ ]
248
345
 
249
346
  [tool.pytest.ini_options]
250
- filterwarnings = ["ignore::DeprecationWarning"]
347
+ filterwarnings = [
348
+ "ignore::DeprecationWarning",
349
+ ]
251
350
 
351
+ [tool.commitizen]
352
+ name = "cz_conventional_commits"
353
+ tag_format = "$version"
354
+ version_scheme = "semver"
355
+ version_provider = "pep621"
356
+ major_version_zero = true
langroid/__init__.py DELETED
@@ -1,106 +0,0 @@
1
- """
2
- Main langroid package
3
- """
4
-
5
- from . import mytypes
6
- from . import utils
7
-
8
- from . import parsing
9
- from . import prompts
10
- from . import cachedb
11
-
12
- from . import language_models
13
- from . import embedding_models
14
-
15
- from . import vector_store
16
- from . import agent
17
-
18
- from .agent.base import (
19
- Agent,
20
- AgentConfig,
21
- )
22
-
23
- from .agent.batch import (
24
- run_batch_tasks,
25
- llm_response_batch,
26
- agent_response_batch,
27
- )
28
-
29
- from .agent.chat_document import (
30
- StatusCode,
31
- ChatDocument,
32
- ChatDocMetaData,
33
- )
34
-
35
- from .agent.tool_message import (
36
- ToolMessage,
37
- )
38
-
39
- from .agent.chat_agent import (
40
- ChatAgent,
41
- ChatAgentConfig,
42
- )
43
-
44
- from .agent.task import Task, TaskConfig
45
-
46
-
47
- from .mytypes import (
48
- DocMetaData,
49
- Document,
50
- Entity,
51
- )
52
-
53
- from .exceptions import InfiniteLoopException
54
- from .exceptions import LangroidImportError
55
-
56
- __all__ = [
57
- "mytypes",
58
- "exceptions",
59
- "utils",
60
- "parsing",
61
- "prompts",
62
- "cachedb",
63
- "language_models",
64
- "embedding_models",
65
- "vector_store",
66
- "agent",
67
- "Agent",
68
- "AgentConfig",
69
- "ChatAgent",
70
- "ChatAgentConfig",
71
- "StatusCode",
72
- "ChatDocument",
73
- "ChatDocMetaData",
74
- "Task",
75
- "TaskConfig",
76
- "DocMetaData",
77
- "Document",
78
- "Entity",
79
- "ToolMessage",
80
- "run_batch_tasks",
81
- "llm_response_batch",
82
- "agent_response_batch",
83
- "InfiniteLoopException",
84
- "LangroidImportError",
85
- ]
86
-
87
-
88
- try:
89
- from .agent.callbacks.chainlit import (
90
- ChainlitAgentCallbacks,
91
- ChainlitTaskCallbacks,
92
- ChainlitCallbackConfig,
93
- )
94
-
95
- ChainlitAgentCallbacks
96
- ChainlitTaskCallbacks
97
- ChainlitCallbackConfig
98
- __all__.extend(
99
- [
100
- "ChainlitAgentCallbacks",
101
- "ChainlitTaskCallbacks",
102
- "ChainlitCallbackConfig",
103
- ]
104
- )
105
- except ImportError:
106
- pass