vibe-client 0.1.0__py3-none-any.whl → 0.1.2__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.
vibe_client/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # Code generated by smithy-python-codegen DO NOT EDIT.
2
2
 
3
- __version__: str = "0.1.0"
3
+ __version__: str = "0.1.2"
@@ -128,6 +128,27 @@ INTEGER_LIST = Schema.collection(
128
128
  }
129
129
  )
130
130
 
131
+ FORBIDDEN_EXCEPTION = Schema.collection(
132
+ id=ShapeID("vibe.astar.public.api.shared#ForbiddenException"),
133
+
134
+ traits=[
135
+ Trait.new(id=ShapeID("smithy.api#error"), value="client"),
136
+ Trait.new(id=ShapeID("smithy.api#httpError"), value=403),
137
+
138
+ ],
139
+ members={
140
+ "message": {
141
+ "target": STRING,
142
+ "index": 0,
143
+ "traits": [
144
+ Trait.new(id=ShapeID("smithy.api#required")),
145
+
146
+ ],
147
+ },
148
+
149
+ }
150
+ )
151
+
131
152
  UNAUTHORIZED_EXCEPTION = Schema.collection(
132
153
  id=ShapeID("vibe.astar.public.api.shared#UnauthorizedException"),
133
154
 
@@ -12,6 +12,7 @@ from smithy_json import JSONCodec
12
12
  from .config import Config
13
13
  from .models import (
14
14
  ApiError,
15
+ ForbiddenException,
15
16
  QueryAgentOutput,
16
17
  UnauthorizedException,
17
18
  UnknownApiError,
@@ -48,6 +49,9 @@ async def _deserialize_error_query_agent(http_response: HTTPResponse, config: Co
48
49
  case "vibevalidationexception":
49
50
  return await _deserialize_error_vibe_validation_exception(http_response, config, parsed_body, message)
50
51
 
52
+ case "forbiddenexception":
53
+ return await _deserialize_error_forbidden_exception(http_response, config, parsed_body, message)
54
+
51
55
  case _:
52
56
  return UnknownApiError(f"{code}: {message}")
53
57
 
@@ -72,6 +76,27 @@ async def _deserialize_error_validation_exception(
72
76
 
73
77
  return ValidationException(**kwargs)
74
78
 
79
+ async def _deserialize_error_forbidden_exception(
80
+ http_response: HTTPResponse,
81
+ config: Config,
82
+ parsed_body: dict[str, DocumentValue] | None,
83
+ default_message: str,
84
+ ) -> ForbiddenException:
85
+ kwargs: dict[str, Any] = {"message": default_message}
86
+
87
+ if parsed_body is None:
88
+ body = await http_response.consume_body_async()
89
+ else:
90
+ body = json.dumps(parsed_body).encode('utf-8')
91
+
92
+ if body:
93
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
94
+ deserializer = codec.create_deserializer(body)
95
+ body_kwargs = ForbiddenException.deserialize_kwargs(deserializer)
96
+ kwargs.update(body_kwargs)
97
+
98
+ return ForbiddenException(**kwargs)
99
+
75
100
  async def _deserialize_error_unauthorized_exception(
76
101
  http_response: HTTPResponse,
77
102
  config: Config,
vibe_client/models.py CHANGED
@@ -14,6 +14,7 @@ from smithy_core.shapes import ShapeID
14
14
 
15
15
  from ._private.schemas import (
16
16
  ACTION_VALUE as _SCHEMA_ACTION_VALUE,
17
+ FORBIDDEN_EXCEPTION as _SCHEMA_FORBIDDEN_EXCEPTION,
17
18
  OBSERVATION_VALUE as _SCHEMA_OBSERVATION_VALUE,
18
19
  QUERY_AGENT as _SCHEMA_QUERY_AGENT,
19
20
  QUERY_AGENT_INPUT as _SCHEMA_QUERY_AGENT_INPUT,
@@ -236,6 +237,39 @@ def _deserialize_integer_list(deserializer: ShapeDeserializer, schema: Schema) -
236
237
  deserializer.read_list(schema, _read_value)
237
238
  return result
238
239
 
240
+ @dataclass(kw_only=True)
241
+ class ForbiddenException(ApiError):
242
+
243
+ code: ClassVar[str] = "ForbiddenException"
244
+ fault: ClassVar[Literal["client", "server"]] = "client"
245
+
246
+ message: str
247
+
248
+ def serialize(self, serializer: ShapeSerializer):
249
+ serializer.write_struct(_SCHEMA_FORBIDDEN_EXCEPTION, self)
250
+
251
+ def serialize_members(self, serializer: ShapeSerializer):
252
+ serializer.write_string(_SCHEMA_FORBIDDEN_EXCEPTION.members["message"], self.message)
253
+
254
+ @classmethod
255
+ def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
256
+ return cls(**cls.deserialize_kwargs(deserializer))
257
+
258
+ @classmethod
259
+ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]:
260
+ kwargs: dict[str, Any] = {}
261
+
262
+ def _consumer(schema: Schema, de: ShapeDeserializer) -> None:
263
+ match schema.expect_member_index():
264
+ case 0:
265
+ kwargs["message"] = de.read_string(_SCHEMA_FORBIDDEN_EXCEPTION.members["message"])
266
+
267
+ case _:
268
+ logger.debug("Unexpected member schema: %s", schema)
269
+
270
+ deserializer.read_struct(_SCHEMA_FORBIDDEN_EXCEPTION, consumer=_consumer)
271
+ return kwargs
272
+
239
273
  @dataclass(kw_only=True)
240
274
  class UnauthorizedException(ApiError):
241
275
 
@@ -703,6 +737,7 @@ QUERY_AGENT = APIOperation(
703
737
  ShapeID("vibe.astar.public.api.shared#UnauthorizedException"): UnauthorizedException,
704
738
  ShapeID("smithy.framework#ValidationException"): ValidationException,
705
739
  ShapeID("vibe.astar.public.api.shared#VibeValidationException"): VibeValidationException,
740
+ ShapeID("vibe.astar.public.api.shared#ForbiddenException"): ForbiddenException,
706
741
  }),
707
742
  effective_auth_schemes = [
708
743
  ShapeID("smithy.api#noAuth")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
- Name: vibe-client
3
- Version: 0.1.0
2
+ Name: vibe_client
3
+ Version: 0.1.2
4
4
  Summary: vibe client
5
5
  License: Apache-2.0
6
6
  Keywords: smithy,vibe
@@ -33,7 +33,7 @@ A Python client for the Vibe API, enabling seamless interaction with Vibe agents
33
33
  ## Installation
34
34
 
35
35
  ```bash
36
- pip install vibe
36
+ pip install vibe_client
37
37
  ```
38
38
 
39
39
  ## Features
@@ -47,8 +47,8 @@ pip install vibe
47
47
 
48
48
  ```python
49
49
  import asyncio
50
- from vibe.models import QueryAgentInput, ObservationValueBox
51
- from vibe.client import VibeClient
50
+ from vibe_client.models import QueryAgentInput, ObservationValueBox
51
+ from vibe_client.client import VibeClient
52
52
 
53
53
  async def main():
54
54
  # Initialize the client with your API key
@@ -96,7 +96,7 @@ The built documentation will be available in `docs/build/html/index.html`.
96
96
 
97
97
  ```
98
98
  vibe/
99
- ├── src/vibe/ # Main package source code
99
+ ├── src/vibe_client/ # Main package source code
100
100
  │ ├── __init__.py # Package initialization
101
101
  │ ├── client.py # API client implementation
102
102
  │ ├── config.py # Configuration utilities
@@ -0,0 +1,11 @@
1
+ vibe_client/__init__.py,sha256=6skReHbZtASuUiEyPrSGv5sl9dFKQqPMen7Bc4VJSD4,83
2
+ vibe_client/client.py,sha256=93hup4Jfqba5_NQNVCU4f5LxKq1Y5nOs0dGuP0T6Qnw,20538
3
+ vibe_client/config.py,sha256=09qiTYTuJnv0krlJl5srgWncPWnGaMA9w0dDKswnNbI,2669
4
+ vibe_client/deserialize.py,sha256=lm85B43gICgNAqAgYMNUbXyh8IeyqdDbwb7s2L8Xbas,4948
5
+ vibe_client/models.py,sha256=SglS-Zu2hHRZ1OPJW6Zvf9_dMQit62-oW4v9Z6sctMM,27404
6
+ vibe_client/serialize.py,sha256=O2ki-TARbjvwqztWYLCRZGMDzgzD15kI7uiOevjwQYY,1593
7
+ vibe_client/_private/__init__.py,sha256=DxsJq42a0KfQv9zzLrqT0JVpoXrR-IDIYFGuJe4g1Gc,55
8
+ vibe_client/_private/schemas.py,sha256=stUxYIBaNXkR3FZ8U-2HZosRebDjJiWH8xcq-xDpi0w,8260
9
+ vibe_client-0.1.2.dist-info/METADATA,sha256=oPU2hfnwsCxusJg26N0n1AVg5OyI4mqplVicYe-EmCA,3597
10
+ vibe_client-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
+ vibe_client-0.1.2.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- vibe_client/__init__.py,sha256=XekyD00QFziYRdN_E7vlH9X7nnEV6NjGWRiQ0v0NcB8,83
2
- vibe_client/client.py,sha256=93hup4Jfqba5_NQNVCU4f5LxKq1Y5nOs0dGuP0T6Qnw,20538
3
- vibe_client/config.py,sha256=09qiTYTuJnv0krlJl5srgWncPWnGaMA9w0dDKswnNbI,2669
4
- vibe_client/deserialize.py,sha256=EXgPy-O6acFNL3Vs5qR1sJqmbTWE_J4CWE6DuwLWvTE,4065
5
- vibe_client/models.py,sha256=AAaUMCA0rYtteHI_HunrL-9FaKV_yNvVuYMON3fevDk,26070
6
- vibe_client/serialize.py,sha256=O2ki-TARbjvwqztWYLCRZGMDzgzD15kI7uiOevjwQYY,1593
7
- vibe_client/_private/__init__.py,sha256=DxsJq42a0KfQv9zzLrqT0JVpoXrR-IDIYFGuJe4g1Gc,55
8
- vibe_client/_private/schemas.py,sha256=EghHfaLbHS47726W3AgRHNPyYFaGWY0ELPw9SImbhfo,7785
9
- vibe_client-0.1.0.dist-info/METADATA,sha256=EZenhgcYREALvj_NXPCPDQsGTvadvF1-gaPzfayw53c,3569
10
- vibe_client-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
- vibe_client-0.1.0.dist-info/RECORD,,