zrb 1.0.0b5__py3-none-any.whl → 1.0.0b6__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.
@@ -3,7 +3,6 @@ import json
3
3
  import os
4
4
  import sys
5
5
 
6
- import litellm
7
6
  import ulid
8
7
 
9
8
  from zrb.config import (
@@ -30,7 +29,9 @@ def create_rag_from_directory(
30
29
  async def retrieve(query: str) -> str:
31
30
  from chromadb import PersistentClient
32
31
  from chromadb.config import Settings
32
+ from fastembed import TextEmbedding
33
33
 
34
+ embedding_model = TextEmbedding(model_name=model)
34
35
  client = PersistentClient(
35
36
  path=vector_db_path, settings=Settings(allow_reset=True)
36
37
  )
@@ -75,10 +76,8 @@ def create_rag_from_directory(
75
76
  ),
76
77
  file=sys.stderr,
77
78
  )
78
- response = await litellm.aembedding(
79
- model=model, input=[chunk]
80
- )
81
- vector = response["data"][0]["embedding"]
79
+ embedding_result = list(embedding_model.embed([chunk]))
80
+ vector = embedding_result[0]
82
81
  collection.upsert(
83
82
  ids=[chunk_id],
84
83
  embeddings=[vector],
@@ -102,9 +101,8 @@ def create_rag_from_directory(
102
101
  )
103
102
 
104
103
  print(stylize_faint("Vectorizing query"), file=sys.stderr)
105
- query_response = await litellm.aembedding(model=model, input=[query])
106
- query_vector = query_response["data"][0]["embedding"]
107
-
104
+ embedding_result = list(embedding_model.embed([query]))
105
+ query_vector = embedding_result[0]
108
106
  print(stylize_faint("Searching documents"), file=sys.stderr)
109
107
  results = collection.query(
110
108
  query_embeddings=query_vector,
zrb/config.py CHANGED
@@ -95,7 +95,10 @@ LLM_HISTORY_FILE = os.getenv(
95
95
  )
96
96
  LLM_ALLOW_ACCESS_SHELL = to_boolean(os.getenv("ZRB_LLM_ACCESS_FILE", "1"))
97
97
  LLM_ALLOW_ACCESS_INTERNET = to_boolean(os.getenv("ZRB_LLM_ACCESS_INTERNET", "1"))
98
- RAG_EMBEDDING_MODEL = os.getenv("ZRB_RAG_EMBEDDING_MODEL", "ollama/nomic-embed-text")
98
+ # noqa See: https://qdrant.github.io/fastembed/examples/Supported_Models/#supported-text-embedding-models
99
+ RAG_EMBEDDING_MODEL = os.getenv(
100
+ "ZRB_RAG_EMBEDDING_MODEL", "nomic-ai/nomic-embed-text-v1.5-Q"
101
+ )
99
102
  RAG_CHUNK_SIZE = int(os.getenv("ZRB_RAG_CHUNK_SIZE", "1024"))
100
103
  RAG_OVERLAP = int(os.getenv("ZRB_RAG_OVERLAP", "128"))
101
104
  RAG_MAX_RESULT_COUNT = int(os.getenv("ZRB_RAG_MAX_RESULT_COUNT", "5"))
zrb/task/llm_task.py CHANGED
@@ -154,8 +154,6 @@ class LLMTask(BaseTask):
154
154
  tool if isinstance(tool, Tool) else Tool(tool, takes_ctx=False)
155
155
  for tool in tools_or_callables
156
156
  ]
157
- for tool in tools:
158
- print("tool", tool)
159
157
  return Agent(
160
158
  self._get_model(ctx),
161
159
  system_prompt=self._get_system_prompt(ctx),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 1.0.0b5
3
+ Version: 1.0.0b6
4
4
  Summary: Your Automation Powerhouse
5
5
  Home-page: https://github.com/state-alchemists/zrb
6
6
  License: AGPL-3.0-or-later
@@ -19,6 +19,7 @@ Requires-Dist: beautifulsoup4 (>=4.12.3,<5.0.0)
19
19
  Requires-Dist: black (>=24.10.0,<24.11.0)
20
20
  Requires-Dist: chromadb (>=0.5.20,<0.6.0) ; extra == "rag"
21
21
  Requires-Dist: fastapi[standard] (>=0.115.6,<0.116.0)
22
+ Requires-Dist: fastembed (>=0.5.1,<0.6.0)
22
23
  Requires-Dist: isort (>=5.13.2,<5.14.0)
23
24
  Requires-Dist: libcst (>=1.5.0,<2.0.0)
24
25
  Requires-Dist: pdfplumber (>=0.11.4,<0.12.0) ; extra == "rag"
@@ -11,7 +11,7 @@ zrb/builtin/llm/llm_chat.py,sha256=vUUchYKJuHr-N_HarpKRFsV0EdQDAFZzAfbK4C0vx88,4
11
11
  zrb/builtin/llm/previous-session.js,sha256=xMKZvJoAbrwiyHS0OoPrWuaKxWYLoyR5sguePIoCjTY,816
12
12
  zrb/builtin/llm/tool/api.py,sha256=yQ3XV8O7Fx7hHssLSOcmiHDnevPhz9ktWi44HK7zTls,801
13
13
  zrb/builtin/llm/tool/cli.py,sha256=to_IjkfrMGs6eLfG0cpVN9oyADWYsJQCtyluUhUdBww,253
14
- zrb/builtin/llm/tool/rag.py,sha256=jJRLERW6824JeEzEQ_OqLMaaa3mjuNqsRcRWoL1wVx0,5192
14
+ zrb/builtin/llm/tool/rag.py,sha256=PawaLZL-ThctxtBtsQuP3XsgTxQKyCGFqrudCANPJKk,5162
15
15
  zrb/builtin/llm/tool/web.py,sha256=N2HYuXbKPUpjVAq_UnQMbUrTIE8u0Ut3TeQadZ7_NJc,2217
16
16
  zrb/builtin/md5.py,sha256=0pNlrfZA0wlZlHvFHLgyqN0JZJWGKQIF5oXxO44_OJk,949
17
17
  zrb/builtin/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -171,7 +171,7 @@ zrb/callback/callback.py,sha256=hKefB_Jd1XGjPSLQdMKDsGLHPzEGO2dqrIArLl_EmD0,848
171
171
  zrb/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
172
  zrb/cmd/cmd_result.py,sha256=L8bQJzWCpcYexIxHBNsXj2pT3BtLmWex0iJSMkvimOA,597
173
173
  zrb/cmd/cmd_val.py,sha256=7Doowyg6BK3ISSGBLt-PmlhzaEkBjWWm51cED6fAUOQ,1014
174
- zrb/config.py,sha256=vBBhSZ5xQV5S_20PQS54ShFgV-ko3Zbzxw23wDDJnbQ,4556
174
+ zrb/config.py,sha256=RB0ikM82RnCDZaarJOEBfD7GeYPfcq6jLb6F359il1s,4677
175
175
  zrb/content_transformer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
176
176
  zrb/content_transformer/any_content_transformer.py,sha256=v8ZUbcix1GGeDQwB6OKX_1TjpY__ksxWVeqibwa_iZA,850
177
177
  zrb/content_transformer/content_transformer.py,sha256=YU6Xr3G_IaCWKQGsf9z9YlCclbiwcJ7ytQv3wKpPIiI,2125
@@ -262,7 +262,7 @@ zrb/task/base_task.py,sha256=ImA0ReyB6neVUfY4nKLnL0h2EMGIJ9wvvNvIAN92-RE,21194
262
262
  zrb/task/base_trigger.py,sha256=jC722rDvodaBLeNaFghkTyv1u0QXrK6BLZUUqcmBJ7Q,4581
263
263
  zrb/task/cmd_task.py,sha256=JpClYoEmJTqKSxhuCErXd2kHLS3Hk2zXeYnl7entNeU,10378
264
264
  zrb/task/http_check.py,sha256=Gf5rOB2Se2EdizuN9rp65HpGmfZkGc-clIAlHmPVehs,2565
265
- zrb/task/llm_task.py,sha256=hU1waf3NFc41YxdIe0k9z1eKrcPDaBUo4imuEq737TU,7782
265
+ zrb/task/llm_task.py,sha256=ptXC3x9Dwn7-4JrGQyEtzOXZ4dNQATDgCeowkvwAu9U,7723
266
266
  zrb/task/make_task.py,sha256=PD3b_aYazthS8LHeJsLAhwKDEgdurQZpymJDKeN60u0,2265
267
267
  zrb/task/rsync_task.py,sha256=pVVslZ46qgcpU_EKhyTQEQie8kUOMuTsVQdbQG2L-yk,6318
268
268
  zrb/task/scaffolder.py,sha256=rME18w1HJUHXgi9eTYXx_T2G4JdqDYzBoNOkdOOo5-o,6806
@@ -303,7 +303,7 @@ zrb/util/string/name.py,sha256=8picJfUBXNpdh64GNaHv3om23QHhUZux7DguFLrXHp8,1163
303
303
  zrb/util/todo.py,sha256=1nDdwPc22oFoK_1ZTXyf3638Bg6sqE2yp_U4_-frHoc,16015
304
304
  zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
305
305
  zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
306
- zrb-1.0.0b5.dist-info/METADATA,sha256=BhCdzcbWjo2XbxLbBVo7JtQpGUAnQS1CnKyRgTkN-cM,4228
307
- zrb-1.0.0b5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
308
- zrb-1.0.0b5.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
309
- zrb-1.0.0b5.dist-info/RECORD,,
306
+ zrb-1.0.0b6.dist-info/METADATA,sha256=ZGOBMXjA82fN6lsJ3yNmJTGqwoZWJcNEKCxXtTouk68,4270
307
+ zrb-1.0.0b6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
308
+ zrb-1.0.0b6.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
309
+ zrb-1.0.0b6.dist-info/RECORD,,
File without changes