nebu 0.1.24__py3-none-any.whl → 0.1.29__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.
@@ -264,9 +264,6 @@ def process_message(message_id: str, message_data: Dict[str, str]) -> None:
264
264
  # Initialize variables that need to be accessible in the except block
265
265
  return_stream = None
266
266
  user_id = None
267
-
268
- print(f"Message data inner: {message_data}")
269
-
270
267
  try:
271
268
  # Extract the JSON string payload from the 'data' field
272
269
  payload_str = message_data.get("data")
@@ -374,7 +371,7 @@ def process_message(message_id: str, message_data: Dict[str, str]) -> None:
374
371
  )
375
372
  else:
376
373
  # Just use the raw content
377
- print(f"Using raw content")
374
+ print("Using raw content")
378
375
  input_obj = local_namespace["Message"](
379
376
  kind=kind,
380
377
  id=msg_id,
@@ -798,7 +798,6 @@ def processor(
798
798
 
799
799
  processor_instance = Processor(
800
800
  name=processor_name,
801
- stream=processor_name,
802
801
  namespace=namespace,
803
802
  labels=labels,
804
803
  container=container_request,
@@ -812,6 +811,7 @@ def processor(
812
811
  print(
813
812
  f"[DEBUG Decorator] Processor instance '{processor_name}' created successfully."
814
813
  )
814
+ processor_instance.original_func = func
815
815
  return processor_instance
816
816
 
817
817
  return decorator
@@ -24,7 +24,6 @@ class Processor:
24
24
  def __init__(
25
25
  self,
26
26
  name: str,
27
- stream: str,
28
27
  namespace: Optional[str] = None,
29
28
  labels: Optional[Dict[str, str]] = None,
30
29
  container: Optional[V1ContainerRequest] = None,
@@ -48,7 +47,6 @@ class Processor:
48
47
  self.name = name
49
48
  self.namespace = namespace
50
49
  self.labels = labels
51
- self.stream = stream
52
50
  self.container = container
53
51
  self.schema_ = schema_
54
52
  self.common_schema = common_schema
@@ -123,7 +121,6 @@ class Processor:
123
121
  )
124
122
 
125
123
  update_processor = V1UpdateProcessor(
126
- stream=stream,
127
124
  container=container,
128
125
  schema_=schema_,
129
126
  common_schema=common_schema,
@@ -150,11 +147,11 @@ class Processor:
150
147
  if not self.processor or not self.processor.metadata.name:
151
148
  raise ValueError("Processor not found")
152
149
 
153
- url = f"{self.processors_url}/{self.processor.metadata.namespace}/{self.processor.metadata.name}/send"
150
+ url = f"{self.processors_url}/{self.processor.metadata.namespace}/{self.processor.metadata.name}/messages"
154
151
 
155
- response = requests.get(
152
+ response = requests.post(
156
153
  url,
157
- params=data,
154
+ json=data,
158
155
  headers={"Authorization": f"Bearer {self.api_key}"},
159
156
  )
160
157
  response.raise_for_status()
@@ -208,7 +205,6 @@ class Processor:
208
205
  out.namespace = namespace
209
206
 
210
207
  # Set specific fields from the processor
211
- out.stream = processor_v1.stream
212
208
  out.container = processor_v1.container
213
209
  out.schema_ = processor_v1.schema_
214
210
  out.common_schema = processor_v1.common_schema
@@ -0,0 +1,47 @@
1
+ from abc import ABC, abstractmethod
2
+ from typing import Any, Dict, Optional, Type, TypeVar
3
+
4
+ from pydantic import BaseModel
5
+
6
+ from nebu.config import GlobalConfig
7
+ from nebu.processors.models import V1ContainerRequest, V1Scale
8
+
9
+ from .models import Message
10
+ from .processor import Processor
11
+
12
+ I = TypeVar("I", bound=BaseModel)
13
+ O = TypeVar("O", bound=BaseModel)
14
+
15
+
16
+ class RemoteProcessor(ABC, Processor):
17
+ def __init__(
18
+ self,
19
+ name: str,
20
+ namespace: Optional[str] = None,
21
+ labels: Optional[Dict[str, str]] = None,
22
+ container: Optional[V1ContainerRequest] = None,
23
+ schema_: Optional[Any] = None,
24
+ common_schema: Optional[str] = None,
25
+ min_replicas: Optional[int] = None,
26
+ max_replicas: Optional[int] = None,
27
+ scale_config: Optional[V1Scale] = None,
28
+ config: Optional[GlobalConfig] = None,
29
+ no_delete: bool = False,
30
+ ):
31
+ super().__init__(
32
+ name,
33
+ namespace,
34
+ labels,
35
+ container,
36
+ schema_,
37
+ common_schema,
38
+ min_replicas,
39
+ max_replicas,
40
+ scale_config,
41
+ config,
42
+ no_delete,
43
+ )
44
+
45
+ @abstractmethod
46
+ def process(self, message: Message[I]) -> Type[BaseModel]:
47
+ pass
@@ -1,13 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nebu
3
- Version: 0.1.24
3
+ Version: 0.1.29
4
4
  Summary: A globally distributed container runtime
5
5
  Requires-Python: >=3.10.14
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
8
+ Requires-Dist: boto3>=1.37.30
8
9
  Requires-Dist: dill>=0.3.8
9
10
  Requires-Dist: openai>=1.68.2
11
+ Requires-Dist: pillow>=11.1.0
10
12
  Requires-Dist: pydantic>=2.10.6
13
+ Requires-Dist: pydantic-ai-slim[openai]>=0.0.55
11
14
  Requires-Dist: pysocks>=1.7.1
12
15
  Requires-Dist: pyyaml>=6.0.2
13
16
  Requires-Dist: redis[socks]>=5.0
@@ -0,0 +1,26 @@
1
+ nebu/__init__.py,sha256=5sepbzdAdoA_8TIxws60S4ugFY1apQd_savzn20a4cY,465
2
+ nebu/adapter.py,sha256=yWQCpAn2lJxXPSyQacmFpfVzAL3RrKtKgrSMws0BoT8,211
3
+ nebu/auth.py,sha256=N_v6SPFD9HU_UoRDTaouH03g2Hmo9C-xxqInE1FweXE,1471
4
+ nebu/cache.py,sha256=ngfotHgmT7cvu16kI1Y43pPBBdQt0kUMOk2s3ssNHC4,3292
5
+ nebu/config.py,sha256=aZzQltkobtOLHFCGcIkpKoE3ITn3Z11Dp0E72w84TA0,5769
6
+ nebu/data.py,sha256=kIH9-JJ1-iO7P2t28bku6Gn0Y5tgQszGeTW_rpmO03A,38725
7
+ nebu/meta.py,sha256=CzFHMND9seuewzq9zNNx9WTr6JvrCBExe7BLqDSr7lM,745
8
+ nebu/chatx/convert.py,sha256=t-8ATcIKEv0oYCMFcYzZIdOZcjDHcvdBazQZOLH7A0k,7906
9
+ nebu/chatx/openai.py,sha256=LLSPvVGnauUViAXY7OifwoWlkUGZWfgxEjxR4mjSqZg,44961
10
+ nebu/containers/container.py,sha256=yb7KaPTVXnEEAlrpdlUi4HNqF6P7z9bmwAILGlq6iqU,13502
11
+ nebu/containers/decorator.py,sha256=uFtzlAXRHYZECJ-NPusY7oN9GXvdHrHDd_JNrIGr8aQ,3244
12
+ nebu/containers/models.py,sha256=0j6NGy4yto-enRDh_4JH_ZTbHrLdSpuMOqNQPnIrwC4,6815
13
+ nebu/containers/server.py,sha256=yFa2Y9PzBn59E1HftKiv0iapPonli2rbGAiU6r-wwe0,2513
14
+ nebu/processors/consumer.py,sha256=Nd5s3C5aYCJvnj5VqhwYekIX9Gkafy1eJtWFTbVQJrM,19635
15
+ nebu/processors/decorate.py,sha256=9mf25RawOX6_6WyQcRLBIHQC3oCDtofQZijJ13aQM9E,34576
16
+ nebu/processors/default.py,sha256=W4slJenG59rvyTlJ7gRp58eFfXcNOTT2Hfi6zzJAobI,365
17
+ nebu/processors/models.py,sha256=y40HoW-MEzDWB2dm_tsYlUy3Nf3s6eiLC0iGO9BoNog,3956
18
+ nebu/processors/processor.py,sha256=STyzq2CiKD2KCnijVuNebguakNtFQHFf8ef-UTJeyBk,9548
19
+ nebu/processors/remote.py,sha256=TeAIPGEMqnDIb7H1iett26IEZrBlcbPB_-DSm6jcH1E,1285
20
+ nebu/redis/models.py,sha256=coPovAcVXnOU1Xh_fpJL4PO3QctgK9nBe5QYoqEcnxg,1230
21
+ nebu/services/service.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ nebu-0.1.29.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
+ nebu-0.1.29.dist-info/METADATA,sha256=3Wi5lrW1j5AsloJEypjpCl0RlEKOjvFQugRovKNHvyA,1786
24
+ nebu-0.1.29.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
25
+ nebu-0.1.29.dist-info/top_level.txt,sha256=uLIbEKJeGSHWOAJN5S0i5XBGwybALlF9bYoB1UhdEgQ,5
26
+ nebu-0.1.29.dist-info/RECORD,,
@@ -1,20 +0,0 @@
1
- nebu/__init__.py,sha256=Frz4LWVslmGeEE_ZjCIV5riSw8RC4ZJ-gb4iQPKCOSM,299
2
- nebu/auth.py,sha256=rApCd-7_c3GpIb7gjCB79rR7SOcmkG7MmaTE6zMbvr0,1125
3
- nebu/config.py,sha256=XBY7uKgcJX9d1HGxqqpx87o_9DuF3maUlUnKkcpUrKU,4565
4
- nebu/meta.py,sha256=CzFHMND9seuewzq9zNNx9WTr6JvrCBExe7BLqDSr7lM,745
5
- nebu/containers/container.py,sha256=yb7KaPTVXnEEAlrpdlUi4HNqF6P7z9bmwAILGlq6iqU,13502
6
- nebu/containers/decorator.py,sha256=uFtzlAXRHYZECJ-NPusY7oN9GXvdHrHDd_JNrIGr8aQ,3244
7
- nebu/containers/models.py,sha256=0j6NGy4yto-enRDh_4JH_ZTbHrLdSpuMOqNQPnIrwC4,6815
8
- nebu/containers/server.py,sha256=yFa2Y9PzBn59E1HftKiv0iapPonli2rbGAiU6r-wwe0,2513
9
- nebu/processors/consumer.py,sha256=ejGgYhOMn86aEvJxQorWp7ybHVcvmo4T3nyiv7gTnhM,19687
10
- nebu/processors/decorate.py,sha256=B2qK1B2Jm1SzO5IN9pWk32sS0z5WLqXPdJtP-y-iSO4,34563
11
- nebu/processors/default.py,sha256=W4slJenG59rvyTlJ7gRp58eFfXcNOTT2Hfi6zzJAobI,365
12
- nebu/processors/models.py,sha256=y40HoW-MEzDWB2dm_tsYlUy3Nf3s6eiLC0iGO9BoNog,3956
13
- nebu/processors/processor.py,sha256=oy2YdI-cy6qQWxrZhpZahJV46oWZlu_Im-jm811R_oo,9667
14
- nebu/redis/models.py,sha256=coPovAcVXnOU1Xh_fpJL4PO3QctgK9nBe5QYoqEcnxg,1230
15
- nebu/services/service.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- nebu-0.1.24.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
- nebu-0.1.24.dist-info/METADATA,sha256=8O-NbvrAFRRuGr3QLz2DzM08CJnbpfXi3fAIABOSho4,1678
18
- nebu-0.1.24.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
19
- nebu-0.1.24.dist-info/top_level.txt,sha256=uLIbEKJeGSHWOAJN5S0i5XBGwybALlF9bYoB1UhdEgQ,5
20
- nebu-0.1.24.dist-info/RECORD,,
File without changes