Skip to content

Commit 6cb72bf

Browse files
feat(api): update via SDK Studio
1 parent 73639c4 commit 6cb72bf

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ Methods:
9191
Types:
9292

9393
```python
94-
from contextual.types.applications import QueryFeedbackResponse, QueryStartResponse
94+
from contextual.types.applications import QueryResponse, QueryFeedbackResponse
9595
```
9696

9797
Methods:
9898

9999
- <code title="post /applications/{application_id}/feedback">client.applications.query.<a href="./src/contextual/resources/applications/query.py">feedback</a>(application_id, \*\*<a href="src/contextual/types/applications/query_feedback_params.py">params</a>) -> <a href="./src/contextual/types/applications/query_feedback_response.py">object</a></code>
100-
- <code title="post /applications/{application_id}/query">client.applications.query.<a href="./src/contextual/resources/applications/query.py">start</a>(application_id, \*\*<a href="src/contextual/types/applications/query_start_params.py">params</a>) -> <a href="./src/contextual/types/applications/query_start_response.py">QueryStartResponse</a></code>
100+
- <code title="post /applications/{application_id}/query">client.applications.query.<a href="./src/contextual/resources/applications/query.py">start</a>(application_id, \*\*<a href="src/contextual/types/applications/query_start_params.py">params</a>) -> <a href="./src/contextual/types/applications/query_response.py">QueryResponse</a></code>
101101

102102
## Evaluate
103103

src/contextual/resources/applications/query.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
)
2323
from ..._base_client import make_request_options
2424
from ...types.applications import query_start_params, query_feedback_params
25-
from ...types.applications.query_start_response import QueryStartResponse
25+
from ...types.applications.query_response import QueryResponse
2626

2727
__all__ = ["QueryResource", "AsyncQueryResource"]
2828

@@ -129,7 +129,7 @@ def start(
129129
extra_query: Query | None = None,
130130
extra_body: Body | None = None,
131131
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
132-
) -> QueryStartResponse:
132+
) -> QueryResponse:
133133
"""
134134
Start a conversation with an `Application` and receive its generated response,
135135
along with relevant retrieved data and attributions.
@@ -177,7 +177,7 @@ def start(
177177
timeout=timeout,
178178
query=maybe_transform({"retrievals_only": retrievals_only}, query_start_params.QueryStartParams),
179179
),
180-
cast_to=QueryStartResponse,
180+
cast_to=QueryResponse,
181181
)
182182

183183

@@ -283,7 +283,7 @@ async def start(
283283
extra_query: Query | None = None,
284284
extra_body: Body | None = None,
285285
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
286-
) -> QueryStartResponse:
286+
) -> QueryResponse:
287287
"""
288288
Start a conversation with an `Application` and receive its generated response,
289289
along with relevant retrieved data and attributions.
@@ -333,7 +333,7 @@ async def start(
333333
{"retrievals_only": retrievals_only}, query_start_params.QueryStartParams
334334
),
335335
),
336-
cast_to=QueryStartResponse,
336+
cast_to=QueryResponse,
337337
)
338338

339339

src/contextual/types/applications/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from __future__ import annotations
44

55
from .tune_response import TuneResponse as TuneResponse
6+
from .query_response import QueryResponse as QueryResponse
67
from .query_start_params import QueryStartParams as QueryStartParams
78
from .tune_create_params import TuneCreateParams as TuneCreateParams
89
from .dataset_list_params import DatasetListParams as DatasetListParams
910
from .get_dataset_response import GetDatasetResponse as GetDatasetResponse
10-
from .query_start_response import QueryStartResponse as QueryStartResponse
1111
from .dataset_create_params import DatasetCreateParams as DatasetCreateParams
1212
from .dataset_update_params import DatasetUpdateParams as DatasetUpdateParams
1313
from .list_dataset_response import ListDatasetResponse as ListDatasetResponse

src/contextual/types/applications/query_start_response.py renamed to src/contextual/types/applications/query_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from ..._models import BaseModel
77

8-
__all__ = ["QueryStartResponse", "RetrievalContent", "Attribution", "Message"]
8+
__all__ = ["QueryResponse", "RetrievalContent", "Attribution", "Message"]
99

1010

1111
class RetrievalContent(BaseModel):
@@ -62,7 +62,7 @@ class Message(BaseModel):
6262
"""Role of sender"""
6363

6464

65-
class QueryStartResponse(BaseModel):
65+
class QueryResponse(BaseModel):
6666
conversation_id: str
6767
"""A unique identifier for the conversation.
6868

tests/api_resources/applications/test_query.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from contextual import ContextualAI, AsyncContextualAI
1111
from tests.utils import assert_matches_type
12-
from contextual.types.applications import QueryStartResponse
12+
from contextual.types.applications import QueryResponse
1313

1414
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1515

@@ -85,7 +85,7 @@ def test_method_start(self, client: ContextualAI) -> None:
8585
}
8686
],
8787
)
88-
assert_matches_type(QueryStartResponse, query, path=["response"])
88+
assert_matches_type(QueryResponse, query, path=["response"])
8989

9090
@parametrize
9191
def test_method_start_with_all_params(self, client: ContextualAI) -> None:
@@ -102,7 +102,7 @@ def test_method_start_with_all_params(self, client: ContextualAI) -> None:
102102
model_id="model_id",
103103
stream=True,
104104
)
105-
assert_matches_type(QueryStartResponse, query, path=["response"])
105+
assert_matches_type(QueryResponse, query, path=["response"])
106106

107107
@parametrize
108108
def test_raw_response_start(self, client: ContextualAI) -> None:
@@ -119,7 +119,7 @@ def test_raw_response_start(self, client: ContextualAI) -> None:
119119
assert response.is_closed is True
120120
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
121121
query = response.parse()
122-
assert_matches_type(QueryStartResponse, query, path=["response"])
122+
assert_matches_type(QueryResponse, query, path=["response"])
123123

124124
@parametrize
125125
def test_streaming_response_start(self, client: ContextualAI) -> None:
@@ -136,7 +136,7 @@ def test_streaming_response_start(self, client: ContextualAI) -> None:
136136
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
137137

138138
query = response.parse()
139-
assert_matches_type(QueryStartResponse, query, path=["response"])
139+
assert_matches_type(QueryResponse, query, path=["response"])
140140

141141
assert cast(Any, response.is_closed) is True
142142

@@ -225,7 +225,7 @@ async def test_method_start(self, async_client: AsyncContextualAI) -> None:
225225
}
226226
],
227227
)
228-
assert_matches_type(QueryStartResponse, query, path=["response"])
228+
assert_matches_type(QueryResponse, query, path=["response"])
229229

230230
@parametrize
231231
async def test_method_start_with_all_params(self, async_client: AsyncContextualAI) -> None:
@@ -242,7 +242,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncContextualA
242242
model_id="model_id",
243243
stream=True,
244244
)
245-
assert_matches_type(QueryStartResponse, query, path=["response"])
245+
assert_matches_type(QueryResponse, query, path=["response"])
246246

247247
@parametrize
248248
async def test_raw_response_start(self, async_client: AsyncContextualAI) -> None:
@@ -259,7 +259,7 @@ async def test_raw_response_start(self, async_client: AsyncContextualAI) -> None
259259
assert response.is_closed is True
260260
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
261261
query = await response.parse()
262-
assert_matches_type(QueryStartResponse, query, path=["response"])
262+
assert_matches_type(QueryResponse, query, path=["response"])
263263

264264
@parametrize
265265
async def test_streaming_response_start(self, async_client: AsyncContextualAI) -> None:
@@ -276,7 +276,7 @@ async def test_streaming_response_start(self, async_client: AsyncContextualAI) -
276276
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
277277

278278
query = await response.parse()
279-
assert_matches_type(QueryStartResponse, query, path=["response"])
279+
assert_matches_type(QueryResponse, query, path=["response"])
280280

281281
assert cast(Any, response.is_closed) is True
282282

0 commit comments

Comments
 (0)