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

Commit 2a2b19d

Browse files
feat(api): manual updates
1 parent ce499c3 commit 2a2b19d

File tree

11 files changed

+200
-135
lines changed

11 files changed

+200
-135
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 43
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-89127d31b5fad61c910a682f7f88d7252ec3fd1d202ec1d89d377061d543a600.yml
3-
openapi_spec_hash: fd18c276ce08b3119804fd5f2d27bfcc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-0ee1ca2e37cb856ecf0f045a635fdd848c7e833cfff33c51e101f3c7cea21ad5.yml
3+
openapi_spec_hash: 2c5b254f4d087de9eb52c1416d4d9e46
44
config_hash: b89b885fbfc8304f6687a90b818606b2

api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ from inty.types.api.v1.ai import (
100100
APIResponseAgent,
101101
APIResponsePaginationDataAgent,
102102
ModelConfig,
103+
AgentCreateResponse,
103104
AgentListResponse,
104105
)
105106
```
106107

107108
Methods:
108109

109-
- <code title="post /api/v1/ai/agents">client.api.v1.ai.agents.<a href="./src/inty/resources/api/v1/ai/agents.py">create</a>(\*\*<a href="src/inty/types/api/v1/ai/agent_create_params.py">params</a>) -> <a href="./src/inty/types/api/v1/ai/api_response_agent.py">APIResponseAgent</a></code>
110+
- <code title="post /api/v1/ai/agents">client.api.v1.ai.agents.<a href="./src/inty/resources/api/v1/ai/agents.py">create</a>(\*\*<a href="src/inty/types/api/v1/ai/agent_create_params.py">params</a>) -> <a href="./src/inty/types/api/v1/ai/agent_create_response.py">AgentCreateResponse</a></code>
110111
- <code title="get /api/v1/ai/agents/{agent_id}">client.api.v1.ai.agents.<a href="./src/inty/resources/api/v1/ai/agents.py">retrieve</a>(agent_id) -> <a href="./src/inty/types/api/v1/ai/agent.py">Agent</a></code>
111112
- <code title="put /api/v1/ai/agents/{agent_id}">client.api.v1.ai.agents.<a href="./src/inty/resources/api/v1/ai/agents.py">update</a>(agent_id, \*\*<a href="src/inty/types/api/v1/ai/agent_update_params.py">params</a>) -> <a href="./src/inty/types/api/v1/ai/agent.py">Agent</a></code>
112113
- <code title="get /api/v1/ai/agents/me">client.api.v1.ai.agents.<a href="./src/inty/resources/api/v1/ai/agents.py">list</a>(\*\*<a href="src/inty/types/api/v1/ai/agent_list_params.py">params</a>) -> <a href="./src/inty/types/api/v1/ai/agent_list_response.py">AgentListResponse</a></code>

src/inty/resources/api/v1/ai/agents.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from .....types.api.v1.ai.api_response_agent import APIResponseAgent
3434
from .....types.api.v1.ai.model_config_param import ModelConfigParam
3535
from .....types.api.v1.ai.agent_list_response import AgentListResponse
36+
from .....types.api.v1.ai.agent_create_response import AgentCreateResponse
3637
from .....types.api.v1.ai.agent_meta_data_param import AgentMetaDataParam
3738
from .....types.api.v1.ai.api_response_pagination_data_agent import APIResponsePaginationDataAgent
3839

@@ -98,7 +99,7 @@ def create(
9899
extra_query: Query | None = None,
99100
extra_body: Body | None = None,
100101
timeout: float | httpx.Timeout | None | NotGiven = not_given,
101-
) -> APIResponseAgent:
102+
) -> AgentCreateResponse:
102103
"""
103104
Create new AI agent, used by app and inty-eval
104105
@@ -171,7 +172,7 @@ def create(
171172
options=make_request_options(
172173
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
173174
),
174-
cast_to=APIResponseAgent,
175+
cast_to=AgentCreateResponse,
175176
)
176177

177178
def retrieve(
@@ -669,7 +670,7 @@ async def create(
669670
extra_query: Query | None = None,
670671
extra_body: Body | None = None,
671672
timeout: float | httpx.Timeout | None | NotGiven = not_given,
672-
) -> APIResponseAgent:
673+
) -> AgentCreateResponse:
673674
"""
674675
Create new AI agent, used by app and inty-eval
675676
@@ -742,7 +743,7 @@ async def create(
742743
options=make_request_options(
743744
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
744745
),
745-
cast_to=APIResponseAgent,
746+
cast_to=AgentCreateResponse,
746747
)
747748

748749
async def retrieve(

src/inty/resources/v2/chat.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing import Iterable, Optional
67

78
import httpx
@@ -43,6 +44,7 @@ def with_streaming_response(self) -> ChatResourceWithStreamingResponse:
4344
"""
4445
return ChatResourceWithStreamingResponse(self)
4546

47+
@typing_extensions.deprecated("deprecated")
4648
def send_message(
4749
self,
4850
agent_id: str,
@@ -113,6 +115,7 @@ def with_streaming_response(self) -> AsyncChatResourceWithStreamingResponse:
113115
"""
114116
return AsyncChatResourceWithStreamingResponse(self)
115117

118+
@typing_extensions.deprecated("deprecated")
116119
async def send_message(
117120
self,
118121
agent_id: str,
@@ -167,33 +170,41 @@ class ChatResourceWithRawResponse:
167170
def __init__(self, chat: ChatResource) -> None:
168171
self._chat = chat
169172

170-
self.send_message = to_raw_response_wrapper(
171-
chat.send_message,
173+
self.send_message = ( # pyright: ignore[reportDeprecated]
174+
to_raw_response_wrapper(
175+
chat.send_message, # pyright: ignore[reportDeprecated],
176+
)
172177
)
173178

174179

175180
class AsyncChatResourceWithRawResponse:
176181
def __init__(self, chat: AsyncChatResource) -> None:
177182
self._chat = chat
178183

179-
self.send_message = async_to_raw_response_wrapper(
180-
chat.send_message,
184+
self.send_message = ( # pyright: ignore[reportDeprecated]
185+
async_to_raw_response_wrapper(
186+
chat.send_message, # pyright: ignore[reportDeprecated],
187+
)
181188
)
182189

183190

184191
class ChatResourceWithStreamingResponse:
185192
def __init__(self, chat: ChatResource) -> None:
186193
self._chat = chat
187194

188-
self.send_message = to_streamed_response_wrapper(
189-
chat.send_message,
195+
self.send_message = ( # pyright: ignore[reportDeprecated]
196+
to_streamed_response_wrapper(
197+
chat.send_message, # pyright: ignore[reportDeprecated],
198+
)
190199
)
191200

192201

193202
class AsyncChatResourceWithStreamingResponse:
194203
def __init__(self, chat: AsyncChatResource) -> None:
195204
self._chat = chat
196205

197-
self.send_message = async_to_streamed_response_wrapper(
198-
chat.send_message,
206+
self.send_message = ( # pyright: ignore[reportDeprecated]
207+
async_to_streamed_response_wrapper(
208+
chat.send_message, # pyright: ignore[reportDeprecated],
209+
)
199210
)

src/inty/types/api/v1/ai/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .agent_list_response import AgentListResponse as AgentListResponse
1414
from .agent_search_params import AgentSearchParams as AgentSearchParams
1515
from .agent_update_params import AgentUpdateParams as AgentUpdateParams
16+
from .agent_create_response import AgentCreateResponse as AgentCreateResponse
1617
from .agent_meta_data_param import AgentMetaDataParam as AgentMetaDataParam
1718
from .agent_following_params import AgentFollowingParams as AgentFollowingParams
1819
from .agent_recommend_params import AgentRecommendParams as AgentRecommendParams
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Dict, Union, Optional
4+
from typing_extensions import TypeAlias
5+
6+
from .agent import Agent
7+
from ....._models import BaseModel
8+
9+
__all__ = ["AgentCreateResponse", "Data"]
10+
11+
Data: TypeAlias = Union[Agent, Dict[str, object], None]
12+
13+
14+
class AgentCreateResponse(BaseModel):
15+
code: Optional[int] = None
16+
17+
data: Optional[Data] = None
18+
"""AI 角色,在 sqlalchemy 模型基础上添加额外多表查询来的数据"""
19+
20+
message: Optional[str] = None

src/inty/types/api/v1/api_response_subscription_status.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ class Data(BaseModel):
3939
subscription_status: str
4040
"""订阅详细状态:subscribed/subscribed_expiring/unsubscribed"""
4141

42+
agent_creation_24h_limit: Optional[int] = None
43+
"""24 小时内 Agent 创建数量限制"""
44+
4245
agent_creation_limit: Optional[int] = None
43-
"""Agent 创建数量限制"""
46+
"""Agent 创建数量限制(已废弃,使用 agent_creation_24h_limit)"""
4447

4548
background_generation_limit_per_day: Optional[int] = None
46-
"""每日背景图生成次数限制"""
49+
"""每日背景图生成次数限制(已废弃,使用 image_gen_24h_limit)"""
4750

4851
chat_24h_limit: Optional[int] = None
4952
"""24 小时内聊天次数限制(免费用户)"""
@@ -66,6 +69,9 @@ class Data(BaseModel):
6669
has_ever_subscribed: Optional[bool] = None
6770
"""是否曾经有过订阅记录"""
6871

72+
image_gen_24h_limit: Optional[int] = None
73+
"""24 小时内图片生成次数限制"""
74+
6975
plan: Optional[SubscriptionPlan] = None
7076
"""订阅计划响应模型"""
7177

src/inty/types/api/v1/auth/google_login_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class DataUser(BaseModel):
2525

2626
age_group: Optional[str] = None
2727

28+
description: Optional[str] = None
29+
2830
gender: Optional[Gender] = None
2931
"""性别"""
3032

src/inty/types/api/v1/chat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ class Chat(BaseModel):
2222

2323
agent_background: Optional[str] = None
2424

25+
agent_intro: Optional[str] = None
26+
2527
agent_is_deleted: Optional[bool] = None
2628

2729
agent_name: Optional[str] = None
2830

31+
agent_opening: Optional[str] = None
32+
33+
agent_opening_audio_url: Optional[str] = None
34+
2935
last_message: Optional[str] = None
3036

3137
last_message_time: Optional[datetime] = None

tests/api_resources/api/v1/ai/test_agents.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Agent,
1515
APIResponseAgent,
1616
AgentListResponse,
17+
AgentCreateResponse,
1718
APIResponsePaginationDataAgent,
1819
)
1920

@@ -30,7 +31,7 @@ def test_method_create(self, client: Inty) -> None:
3031
gender="gender",
3132
name="name",
3233
)
33-
assert_matches_type(APIResponseAgent, agent, path=["response"])
34+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
3435

3536
@pytest.mark.skip(reason="Prism tests are disabled")
3637
@parametrize
@@ -80,7 +81,7 @@ def test_method_create_with_all_params(self, client: Inty) -> None:
8081
visibility="PUBLIC",
8182
voice_id="voice_id",
8283
)
83-
assert_matches_type(APIResponseAgent, agent, path=["response"])
84+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
8485

8586
@pytest.mark.skip(reason="Prism tests are disabled")
8687
@parametrize
@@ -93,7 +94,7 @@ def test_raw_response_create(self, client: Inty) -> None:
9394
assert response.is_closed is True
9495
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
9596
agent = response.parse()
96-
assert_matches_type(APIResponseAgent, agent, path=["response"])
97+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
9798

9899
@pytest.mark.skip(reason="Prism tests are disabled")
99100
@parametrize
@@ -106,7 +107,7 @@ def test_streaming_response_create(self, client: Inty) -> None:
106107
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
107108

108109
agent = response.parse()
109-
assert_matches_type(APIResponseAgent, agent, path=["response"])
110+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
110111

111112
assert cast(Any, response.is_closed) is True
112113

@@ -541,7 +542,7 @@ async def test_method_create(self, async_client: AsyncInty) -> None:
541542
gender="gender",
542543
name="name",
543544
)
544-
assert_matches_type(APIResponseAgent, agent, path=["response"])
545+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
545546

546547
@pytest.mark.skip(reason="Prism tests are disabled")
547548
@parametrize
@@ -591,7 +592,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncInty) -> N
591592
visibility="PUBLIC",
592593
voice_id="voice_id",
593594
)
594-
assert_matches_type(APIResponseAgent, agent, path=["response"])
595+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
595596

596597
@pytest.mark.skip(reason="Prism tests are disabled")
597598
@parametrize
@@ -604,7 +605,7 @@ async def test_raw_response_create(self, async_client: AsyncInty) -> None:
604605
assert response.is_closed is True
605606
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
606607
agent = await response.parse()
607-
assert_matches_type(APIResponseAgent, agent, path=["response"])
608+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
608609

609610
@pytest.mark.skip(reason="Prism tests are disabled")
610611
@parametrize
@@ -617,7 +618,7 @@ async def test_streaming_response_create(self, async_client: AsyncInty) -> None:
617618
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
618619

619620
agent = await response.parse()
620-
assert_matches_type(APIResponseAgent, agent, path=["response"])
621+
assert_matches_type(AgentCreateResponse, agent, path=["response"])
621622

622623
assert cast(Any, response.is_closed) is True
623624

0 commit comments

Comments
 (0)