Skip to content
This repository was archived by the owner on Nov 2, 2025. It is now read-only.

Commit e9e603a

Browse files
feat(api): manual updates
1 parent 6a35994 commit e9e603a

File tree

20 files changed

+811
-265
lines changed

20 files changed

+811
-265
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 44
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-8c144d825fdfa369cf16995bf00706fb8bef562ade8cf6948b28b737ecb6a6cb.yml
3-
openapi_spec_hash: 0131ffad8903eedaf491699b0e28351b
4-
config_hash: c0a34dbff811a8b614d969c58e58846e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-795555ec3f57171d5ad528ffee370f5d345580197b3141547d604d297109e164.yml
3+
openapi_spec_hash: a82ba2bde7cf360c8b8fee06e421be02
4+
config_hash: 91f08aa33957c420c9a7eabc6951d3ff

api.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,11 @@ Methods:
5454
Types:
5555

5656
```python
57-
from inty.types.api.v1.users import (
58-
Gender,
59-
User,
60-
ProfileRetrieveResponse,
61-
ProfileUpdateResponse,
62-
ProfileMeResponse,
63-
)
57+
from inty.types.api.v1.users import Gender, User, ProfileUpdateResponse, ProfileMeResponse
6458
```
6559

6660
Methods:
6761

68-
- <code title="get /api/v1/users/profile">client.api.v1.users.profile.<a href="./src/inty/resources/api/v1/users/profile.py">retrieve</a>() -> <a href="./src/inty/types/api/v1/users/profile_retrieve_response.py">ProfileRetrieveResponse</a></code>
6962
- <code title="put /api/v1/users/profile">client.api.v1.users.profile.<a href="./src/inty/resources/api/v1/users/profile.py">update</a>(\*\*<a href="src/inty/types/api/v1/users/profile_update_params.py">params</a>) -> <a href="./src/inty/types/api/v1/users/profile_update_response.py">ProfileUpdateResponse</a></code>
7063
- <code title="get /api/v1/users/me">client.api.v1.users.profile.<a href="./src/inty/resources/api/v1/users/profile.py">me</a>() -> <a href="./src/inty/types/api/v1/users/profile_me_response.py">ProfileMeResponse</a></code>
7164

@@ -263,3 +256,17 @@ from inty.types.api.v1 import TextToSpeechListVoicesResponse
263256
Methods:
264257

265258
- <code title="get /api/v1/text-to-speech/list-voices">client.api.v1.text_to_speech.<a href="./src/inty/resources/api/v1/text_to_speech.py">list_voices</a>(\*\*<a href="src/inty/types/api/v1/text_to_speech_list_voices_params.py">params</a>) -> <a href="./src/inty/types/api/v1/text_to_speech_list_voices_response.py">TextToSpeechListVoicesResponse</a></code>
259+
260+
# V2
261+
262+
## Chat
263+
264+
Types:
265+
266+
```python
267+
from inty.types.v2 import ChatSendMessageResponse
268+
```
269+
270+
Methods:
271+
272+
- <code title="post /api/v2/chat/completions/{agent_id}">client.v2.chat.<a href="./src/inty/resources/v2/chat.py">send_message</a>(agent_id, \*\*<a href="src/inty/types/v2/chat_send_message_params.py">params</a>) -> <a href="./src/inty/types/v2/chat_send_message_response.py">ChatSendMessageResponse</a></code>

src/inty/_client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
SyncAPIClient,
2929
AsyncAPIClient,
3030
)
31+
from .resources.v2 import v2
3132
from .resources.api import api
3233

3334
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Inty", "AsyncInty", "Client", "AsyncClient"]
3435

3536

3637
class Inty(SyncAPIClient):
3738
api: api.APIResource
39+
v2: v2.V2Resource
3840
with_raw_response: IntyWithRawResponse
3941
with_streaming_response: IntyWithStreamedResponse
4042

@@ -93,6 +95,7 @@ def __init__(
9395
)
9496

9597
self.api = api.APIResource(self)
98+
self.v2 = v2.V2Resource(self)
9699
self.with_raw_response = IntyWithRawResponse(self)
97100
self.with_streaming_response = IntyWithStreamedResponse(self)
98101

@@ -203,6 +206,7 @@ def _make_status_error(
203206

204207
class AsyncInty(AsyncAPIClient):
205208
api: api.AsyncAPIResource
209+
v2: v2.AsyncV2Resource
206210
with_raw_response: AsyncIntyWithRawResponse
207211
with_streaming_response: AsyncIntyWithStreamedResponse
208212

@@ -261,6 +265,7 @@ def __init__(
261265
)
262266

263267
self.api = api.AsyncAPIResource(self)
268+
self.v2 = v2.AsyncV2Resource(self)
264269
self.with_raw_response = AsyncIntyWithRawResponse(self)
265270
self.with_streaming_response = AsyncIntyWithStreamedResponse(self)
266271

@@ -372,21 +377,25 @@ def _make_status_error(
372377
class IntyWithRawResponse:
373378
def __init__(self, client: Inty) -> None:
374379
self.api = api.APIResourceWithRawResponse(client.api)
380+
self.v2 = v2.V2ResourceWithRawResponse(client.v2)
375381

376382

377383
class AsyncIntyWithRawResponse:
378384
def __init__(self, client: AsyncInty) -> None:
379385
self.api = api.AsyncAPIResourceWithRawResponse(client.api)
386+
self.v2 = v2.AsyncV2ResourceWithRawResponse(client.v2)
380387

381388

382389
class IntyWithStreamedResponse:
383390
def __init__(self, client: Inty) -> None:
384391
self.api = api.APIResourceWithStreamingResponse(client.api)
392+
self.v2 = v2.V2ResourceWithStreamingResponse(client.v2)
385393

386394

387395
class AsyncIntyWithStreamedResponse:
388396
def __init__(self, client: AsyncInty) -> None:
389397
self.api = api.AsyncAPIResourceWithStreamingResponse(client.api)
398+
self.v2 = v2.AsyncV2ResourceWithStreamingResponse(client.v2)
390399

391400

392401
Client = Inty

src/inty/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .v2 import (
4+
V2Resource,
5+
AsyncV2Resource,
6+
V2ResourceWithRawResponse,
7+
AsyncV2ResourceWithRawResponse,
8+
V2ResourceWithStreamingResponse,
9+
AsyncV2ResourceWithStreamingResponse,
10+
)
311
from .api import (
412
APIResource,
513
AsyncAPIResource,
@@ -16,4 +24,10 @@
1624
"AsyncAPIResourceWithRawResponse",
1725
"APIResourceWithStreamingResponse",
1826
"AsyncAPIResourceWithStreamingResponse",
27+
"V2Resource",
28+
"AsyncV2Resource",
29+
"V2ResourceWithRawResponse",
30+
"AsyncV2ResourceWithRawResponse",
31+
"V2ResourceWithStreamingResponse",
32+
"AsyncV2ResourceWithStreamingResponse",
1933
]

src/inty/resources/api/v1/chats/chats.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def delete(
172172
cast_to=Chat,
173173
)
174174

175+
@typing_extensions.deprecated("deprecated")
175176
def create_completion(
176177
self,
177178
agent_id: str,
@@ -189,8 +190,8 @@ def create_completion(
189190
timeout: float | httpx.Timeout | None | NotGiven = not_given,
190191
) -> APIResponseDict:
191192
"""
192-
基于 Agent ID 的 OpenAI 风格聊天接口如果用户还没有和该 Agent 创建会话,则自动创
193-
193+
可以处理包括图片在内的各种消息类型,媒体类型应该先上传,然后将 URL 作为索引发送
194+
到此 API
194195
195196
Args:
196197
extra_headers: Send extra headers
@@ -394,6 +395,7 @@ async def delete(
394395
cast_to=Chat,
395396
)
396397

398+
@typing_extensions.deprecated("deprecated")
397399
async def create_completion(
398400
self,
399401
agent_id: str,
@@ -411,8 +413,8 @@ async def create_completion(
411413
timeout: float | httpx.Timeout | None | NotGiven = not_given,
412414
) -> APIResponseDict:
413415
"""
414-
基于 Agent ID 的 OpenAI 风格聊天接口如果用户还没有和该 Agent 创建会话,则自动创
415-
416+
可以处理包括图片在内的各种消息类型,媒体类型应该先上传,然后将 URL 作为索引发送
417+
到此 API
416418
417419
Args:
418420
extra_headers: Send extra headers
@@ -491,8 +493,10 @@ def __init__(self, chats: ChatsResource) -> None:
491493
self.delete = to_raw_response_wrapper(
492494
chats.delete,
493495
)
494-
self.create_completion = to_raw_response_wrapper(
495-
chats.create_completion,
496+
self.create_completion = ( # pyright: ignore[reportDeprecated]
497+
to_raw_response_wrapper(
498+
chats.create_completion, # pyright: ignore[reportDeprecated],
499+
)
496500
)
497501
self.retrieve_voice = ( # pyright: ignore[reportDeprecated]
498502
to_raw_response_wrapper(
@@ -518,8 +522,10 @@ def __init__(self, chats: AsyncChatsResource) -> None:
518522
self.delete = async_to_raw_response_wrapper(
519523
chats.delete,
520524
)
521-
self.create_completion = async_to_raw_response_wrapper(
522-
chats.create_completion,
525+
self.create_completion = ( # pyright: ignore[reportDeprecated]
526+
async_to_raw_response_wrapper(
527+
chats.create_completion, # pyright: ignore[reportDeprecated],
528+
)
523529
)
524530
self.retrieve_voice = ( # pyright: ignore[reportDeprecated]
525531
async_to_raw_response_wrapper(
@@ -545,8 +551,10 @@ def __init__(self, chats: ChatsResource) -> None:
545551
self.delete = to_streamed_response_wrapper(
546552
chats.delete,
547553
)
548-
self.create_completion = to_streamed_response_wrapper(
549-
chats.create_completion,
554+
self.create_completion = ( # pyright: ignore[reportDeprecated]
555+
to_streamed_response_wrapper(
556+
chats.create_completion, # pyright: ignore[reportDeprecated],
557+
)
550558
)
551559
self.retrieve_voice = ( # pyright: ignore[reportDeprecated]
552560
to_streamed_response_wrapper(
@@ -572,8 +580,10 @@ def __init__(self, chats: AsyncChatsResource) -> None:
572580
self.delete = async_to_streamed_response_wrapper(
573581
chats.delete,
574582
)
575-
self.create_completion = async_to_streamed_response_wrapper(
576-
chats.create_completion,
583+
self.create_completion = ( # pyright: ignore[reportDeprecated]
584+
async_to_streamed_response_wrapper(
585+
chats.create_completion, # pyright: ignore[reportDeprecated],
586+
)
577587
)
578588
self.retrieve_voice = ( # pyright: ignore[reportDeprecated]
579589
async_to_streamed_response_wrapper(

src/inty/resources/api/v1/users/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def register(
5656
timeout: float | httpx.Timeout | None | NotGiven = not_given,
5757
) -> APIResponse:
5858
"""
59-
注册或更新设备 token
59+
在用户未打开 app 时向设备推送消息
6060
6161
Args:
6262
extra_headers: Send extra headers
@@ -116,7 +116,7 @@ async def register(
116116
timeout: float | httpx.Timeout | None | NotGiven = not_given,
117117
) -> APIResponse:
118118
"""
119-
注册或更新设备 token
119+
在用户未打开 app 时向设备推送消息
120120
121121
Args:
122122
extra_headers: Send extra headers

src/inty/resources/api/v1/users/profile.py

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from .....types.api.v1.users.gender import Gender
2222
from .....types.api.v1.users.profile_me_response import ProfileMeResponse
2323
from .....types.api.v1.users.profile_update_response import ProfileUpdateResponse
24-
from .....types.api.v1.users.profile_retrieve_response import ProfileRetrieveResponse
2524

2625
__all__ = ["ProfileResource", "AsyncProfileResource"]
2726

@@ -46,25 +45,6 @@ def with_streaming_response(self) -> ProfileResourceWithStreamingResponse:
4645
"""
4746
return ProfileResourceWithStreamingResponse(self)
4847

49-
def retrieve(
50-
self,
51-
*,
52-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
53-
# The extra values given here take precedence over values defined on the client or passed to this method.
54-
extra_headers: Headers | None = None,
55-
extra_query: Query | None = None,
56-
extra_body: Body | None = None,
57-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
58-
) -> ProfileRetrieveResponse:
59-
"""Get current user profile."""
60-
return self._get(
61-
"/api/v1/users/profile",
62-
options=make_request_options(
63-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
64-
),
65-
cast_to=ProfileRetrieveResponse,
66-
)
67-
6848
def update(
6949
self,
7050
*,
@@ -85,7 +65,7 @@ def update(
8565
timeout: float | httpx.Timeout | None | NotGiven = not_given,
8666
) -> ProfileUpdateResponse:
8767
"""
88-
Update current user profile.
68+
Update current user profile, support avatar update
8969
9070
Args:
9171
gender: 性别
@@ -160,25 +140,6 @@ def with_streaming_response(self) -> AsyncProfileResourceWithStreamingResponse:
160140
"""
161141
return AsyncProfileResourceWithStreamingResponse(self)
162142

163-
async def retrieve(
164-
self,
165-
*,
166-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
167-
# The extra values given here take precedence over values defined on the client or passed to this method.
168-
extra_headers: Headers | None = None,
169-
extra_query: Query | None = None,
170-
extra_body: Body | None = None,
171-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
172-
) -> ProfileRetrieveResponse:
173-
"""Get current user profile."""
174-
return await self._get(
175-
"/api/v1/users/profile",
176-
options=make_request_options(
177-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
178-
),
179-
cast_to=ProfileRetrieveResponse,
180-
)
181-
182143
async def update(
183144
self,
184145
*,
@@ -199,7 +160,7 @@ async def update(
199160
timeout: float | httpx.Timeout | None | NotGiven = not_given,
200161
) -> ProfileUpdateResponse:
201162
"""
202-
Update current user profile.
163+
Update current user profile, support avatar update
203164
204165
Args:
205166
gender: 性别
@@ -258,9 +219,6 @@ class ProfileResourceWithRawResponse:
258219
def __init__(self, profile: ProfileResource) -> None:
259220
self._profile = profile
260221

261-
self.retrieve = to_raw_response_wrapper(
262-
profile.retrieve,
263-
)
264222
self.update = to_raw_response_wrapper(
265223
profile.update,
266224
)
@@ -273,9 +231,6 @@ class AsyncProfileResourceWithRawResponse:
273231
def __init__(self, profile: AsyncProfileResource) -> None:
274232
self._profile = profile
275233

276-
self.retrieve = async_to_raw_response_wrapper(
277-
profile.retrieve,
278-
)
279234
self.update = async_to_raw_response_wrapper(
280235
profile.update,
281236
)
@@ -288,9 +243,6 @@ class ProfileResourceWithStreamingResponse:
288243
def __init__(self, profile: ProfileResource) -> None:
289244
self._profile = profile
290245

291-
self.retrieve = to_streamed_response_wrapper(
292-
profile.retrieve,
293-
)
294246
self.update = to_streamed_response_wrapper(
295247
profile.update,
296248
)
@@ -303,9 +255,6 @@ class AsyncProfileResourceWithStreamingResponse:
303255
def __init__(self, profile: AsyncProfileResource) -> None:
304256
self._profile = profile
305257

306-
self.retrieve = async_to_streamed_response_wrapper(
307-
profile.retrieve,
308-
)
309258
self.update = async_to_streamed_response_wrapper(
310259
profile.update,
311260
)

src/inty/resources/v2/__init__.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .v2 import (
4+
V2Resource,
5+
AsyncV2Resource,
6+
V2ResourceWithRawResponse,
7+
AsyncV2ResourceWithRawResponse,
8+
V2ResourceWithStreamingResponse,
9+
AsyncV2ResourceWithStreamingResponse,
10+
)
11+
from .chat import (
12+
ChatResource,
13+
AsyncChatResource,
14+
ChatResourceWithRawResponse,
15+
AsyncChatResourceWithRawResponse,
16+
ChatResourceWithStreamingResponse,
17+
AsyncChatResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"ChatResource",
22+
"AsyncChatResource",
23+
"ChatResourceWithRawResponse",
24+
"AsyncChatResourceWithRawResponse",
25+
"ChatResourceWithStreamingResponse",
26+
"AsyncChatResourceWithStreamingResponse",
27+
"V2Resource",
28+
"AsyncV2Resource",
29+
"V2ResourceWithRawResponse",
30+
"AsyncV2ResourceWithRawResponse",
31+
"V2ResourceWithStreamingResponse",
32+
"AsyncV2ResourceWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)