nebu 0.1.31__tar.gz → 0.1.32__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.
Files changed (32) hide show
  1. {nebu-0.1.31/src/nebu.egg-info → nebu-0.1.32}/PKG-INFO +1 -1
  2. {nebu-0.1.31 → nebu-0.1.32}/pyproject.toml +1 -1
  3. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/chatx/convert.py +14 -3
  4. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/processors/consumer.py +1 -0
  5. {nebu-0.1.31 → nebu-0.1.32/src/nebu.egg-info}/PKG-INFO +1 -1
  6. {nebu-0.1.31 → nebu-0.1.32}/LICENSE +0 -0
  7. {nebu-0.1.31 → nebu-0.1.32}/README.md +0 -0
  8. {nebu-0.1.31 → nebu-0.1.32}/setup.cfg +0 -0
  9. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/__init__.py +0 -0
  10. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/adapter.py +0 -0
  11. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/auth.py +0 -0
  12. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/cache.py +0 -0
  13. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/chatx/openai.py +0 -0
  14. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/config.py +0 -0
  15. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/containers/container.py +0 -0
  16. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/containers/decorator.py +0 -0
  17. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/containers/models.py +0 -0
  18. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/containers/server.py +0 -0
  19. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/data.py +0 -0
  20. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/meta.py +0 -0
  21. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/processors/decorate.py +0 -0
  22. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/processors/default.py +0 -0
  23. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/processors/models.py +0 -0
  24. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/processors/processor.py +0 -0
  25. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/processors/remote.py +0 -0
  26. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/redis/models.py +0 -0
  27. {nebu-0.1.31 → nebu-0.1.32}/src/nebu/services/service.py +0 -0
  28. {nebu-0.1.31 → nebu-0.1.32}/src/nebu.egg-info/SOURCES.txt +0 -0
  29. {nebu-0.1.31 → nebu-0.1.32}/src/nebu.egg-info/dependency_links.txt +0 -0
  30. {nebu-0.1.31 → nebu-0.1.32}/src/nebu.egg-info/requires.txt +0 -0
  31. {nebu-0.1.31 → nebu-0.1.32}/src/nebu.egg-info/top_level.txt +0 -0
  32. {nebu-0.1.31 → nebu-0.1.32}/tests/test_containers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nebu
3
- Version: 0.1.31
3
+ Version: 0.1.32
4
4
  Summary: A globally distributed container runtime
5
5
  Requires-Python: >=3.10.14
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nebu"
3
- version = "0.1.31"
3
+ version = "0.1.32"
4
4
  description = "A globally distributed container runtime"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10.14"
@@ -7,6 +7,11 @@ from typing import Any, Dict, List, Tuple
7
7
  import requests
8
8
  from PIL import Image, UnidentifiedImageError
9
9
 
10
+ # Define a standard User-Agent header
11
+ REQUESTS_HEADERS = {
12
+ "User-Agent": "Nebulous-py/0.1 (https://github.com/agentsea/nebulous-py; contact@agentsea.ai)"
13
+ }
14
+
10
15
 
11
16
  def convert_to_unsloth_inference(
12
17
  old_schema: List[Dict[str, Any]],
@@ -63,7 +68,7 @@ def convert_to_unsloth_inference(
63
68
  # Convert each URL into a PIL image
64
69
  for url in image_urls:
65
70
  # Download the image
66
- response = requests.get(url)
71
+ response = requests.get(url, headers=REQUESTS_HEADERS)
67
72
  response.raise_for_status()
68
73
  image_data = BytesIO(response.content)
69
74
  pil_img = Image.open(image_data).convert("RGB")
@@ -199,7 +204,11 @@ def oai_to_unsloth(
199
204
  try:
200
205
  if image_url_to_load.startswith(("http://", "https://")):
201
206
  # Handle URL
202
- response = requests.get(image_url_to_load, stream=True)
207
+ response = requests.get(
208
+ image_url_to_load,
209
+ stream=True,
210
+ headers=REQUESTS_HEADERS,
211
+ )
203
212
  response.raise_for_status() # Raise an exception for bad status codes
204
213
  pil_image = Image.open(response.raw)
205
214
  else: # Assume base64
@@ -252,7 +261,9 @@ def oai_to_unsloth(
252
261
  try:
253
262
  if image_url_top_level.startswith(("http://", "https://")):
254
263
  # Handle URL
255
- response = requests.get(image_url_top_level, stream=True)
264
+ response = requests.get(
265
+ image_url_top_level, stream=True, headers=REQUESTS_HEADERS
266
+ )
256
267
  response.raise_for_status() # Raise an exception for bad status codes
257
268
  pil_image = Image.open(response.raw)
258
269
  else:
@@ -479,6 +479,7 @@ while True:
479
479
  # Read from stream with blocking
480
480
  streams = {REDIS_STREAM: ">"} # '>' means read only new messages
481
481
  # The type checker still struggles here, but the runtime types are asserted.
482
+ print("reading from stream...")
482
483
  messages = r.xreadgroup( # type: ignore[arg-type]
483
484
  REDIS_CONSUMER_GROUP, consumer_name, streams, count=1, block=5000
484
485
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nebu
3
- Version: 0.1.31
3
+ Version: 0.1.32
4
4
  Summary: A globally distributed container runtime
5
5
  Requires-Python: >=3.10.14
6
6
  Description-Content-Type: text/markdown
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