Skip to content

Commit d8e87b8

Browse files
feat(api): api update (#98)
1 parent 4d1b2f8 commit d8e87b8

File tree

8 files changed

+41
-8
lines changed

8 files changed

+41
-8
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 36
2-
openapi_spec_hash: d84beeafebbb22261946b77758a506a6
2+
openapi_spec_hash: 6a5cfa54c19b354978b1654c152b0431
33
config_hash: adbedb6317fca6f566f54564cc341846

src/codex/resources/projects/entries.py

+21-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66

77
import httpx
88

@@ -54,6 +54,7 @@ def create(
5454
*,
5555
question: str,
5656
answer: Optional[str] | NotGiven = NOT_GIVEN,
57+
client_query_metadata: Iterable[object] | NotGiven = NOT_GIVEN,
5758
draft_answer: Optional[str] | NotGiven = NOT_GIVEN,
5859
x_client_library_version: str | NotGiven = NOT_GIVEN,
5960
x_integration_type: str | NotGiven = NOT_GIVEN,
@@ -97,6 +98,7 @@ def create(
9798
{
9899
"question": question,
99100
"answer": answer,
101+
"client_query_metadata": client_query_metadata,
100102
"draft_answer": draft_answer,
101103
},
102104
entry_create_params.EntryCreateParams,
@@ -232,6 +234,7 @@ def query(
232234
project_id: str,
233235
*,
234236
question: str,
237+
client_metadata: Optional[object] | NotGiven = NOT_GIVEN,
235238
x_client_library_version: str | NotGiven = NOT_GIVEN,
236239
x_integration_type: str | NotGiven = NOT_GIVEN,
237240
x_source: str | NotGiven = NOT_GIVEN,
@@ -270,7 +273,13 @@ def query(
270273
}
271274
return self._post(
272275
f"/api/projects/{project_id}/entries/query",
273-
body=maybe_transform({"question": question}, entry_query_params.EntryQueryParams),
276+
body=maybe_transform(
277+
{
278+
"question": question,
279+
"client_metadata": client_metadata,
280+
},
281+
entry_query_params.EntryQueryParams,
282+
),
274283
options=make_request_options(
275284
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
276285
),
@@ -304,6 +313,7 @@ async def create(
304313
*,
305314
question: str,
306315
answer: Optional[str] | NotGiven = NOT_GIVEN,
316+
client_query_metadata: Iterable[object] | NotGiven = NOT_GIVEN,
307317
draft_answer: Optional[str] | NotGiven = NOT_GIVEN,
308318
x_client_library_version: str | NotGiven = NOT_GIVEN,
309319
x_integration_type: str | NotGiven = NOT_GIVEN,
@@ -347,6 +357,7 @@ async def create(
347357
{
348358
"question": question,
349359
"answer": answer,
360+
"client_query_metadata": client_query_metadata,
350361
"draft_answer": draft_answer,
351362
},
352363
entry_create_params.EntryCreateParams,
@@ -482,6 +493,7 @@ async def query(
482493
project_id: str,
483494
*,
484495
question: str,
496+
client_metadata: Optional[object] | NotGiven = NOT_GIVEN,
485497
x_client_library_version: str | NotGiven = NOT_GIVEN,
486498
x_integration_type: str | NotGiven = NOT_GIVEN,
487499
x_source: str | NotGiven = NOT_GIVEN,
@@ -520,7 +532,13 @@ async def query(
520532
}
521533
return await self._post(
522534
f"/api/projects/{project_id}/entries/query",
523-
body=await async_maybe_transform({"question": question}, entry_query_params.EntryQueryParams),
535+
body=await async_maybe_transform(
536+
{
537+
"question": question,
538+
"client_metadata": client_metadata,
539+
},
540+
entry_query_params.EntryQueryParams,
541+
),
524542
options=make_request_options(
525543
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
526544
),

src/codex/types/projects/cluster_list_response.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import List, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

@@ -26,6 +26,8 @@ class ClusterListResponse(BaseModel):
2626

2727
answered_at: Optional[datetime] = None
2828

29+
client_query_metadata: Optional[List[object]] = None
30+
2931
draft_answer: Optional[str] = None
3032

3133
draft_answer_last_edited: Optional[datetime] = None

src/codex/types/projects/entry.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import List, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

@@ -24,6 +24,8 @@ class Entry(BaseModel):
2424

2525
answered_at: Optional[datetime] = None
2626

27+
client_query_metadata: Optional[List[object]] = None
28+
2729
draft_answer: Optional[str] = None
2830

2931
draft_answer_last_edited: Optional[datetime] = None

src/codex/types/projects/entry_create_params.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66
from typing_extensions import Required, Annotated, TypedDict
77

88
from ..._utils import PropertyInfo
@@ -15,6 +15,8 @@ class EntryCreateParams(TypedDict, total=False):
1515

1616
answer: Optional[str]
1717

18+
client_query_metadata: Iterable[object]
19+
1820
draft_answer: Optional[str]
1921

2022
x_client_library_version: Annotated[str, PropertyInfo(alias="x-client-library-version")]

src/codex/types/projects/entry_query_params.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Required, Annotated, TypedDict
67

78
from ..._utils import PropertyInfo
@@ -12,6 +13,8 @@
1213
class EntryQueryParams(TypedDict, total=False):
1314
question: Required[str]
1415

16+
client_metadata: Optional[object]
17+
1518
x_client_library_version: Annotated[str, PropertyInfo(alias="x-client-library-version")]
1619

1720
x_integration_type: Annotated[str, PropertyInfo(alias="x-integration-type")]

src/codex/types/projects/entry_query_response.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import List, Optional
44

55
from ..._models import BaseModel
66

@@ -14,6 +14,8 @@ class Entry(BaseModel):
1414

1515
answer: Optional[str] = None
1616

17+
client_query_metadata: Optional[List[object]] = None
18+
1719
draft_answer: Optional[str] = None
1820

1921

tests/api_resources/projects/test_entries.py

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None:
3333
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
3434
question="question",
3535
answer="answer",
36+
client_query_metadata=[{}],
3637
draft_answer="draft_answer",
3738
x_client_library_version="x-client-library-version",
3839
x_integration_type="x-integration-type",
@@ -261,6 +262,7 @@ def test_method_query_with_all_params(self, client: Codex) -> None:
261262
entry = client.projects.entries.query(
262263
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
263264
question="question",
265+
client_metadata={},
264266
x_client_library_version="x-client-library-version",
265267
x_integration_type="x-integration-type",
266268
x_source="x-source",
@@ -325,6 +327,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) ->
325327
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
326328
question="question",
327329
answer="answer",
330+
client_query_metadata=[{}],
328331
draft_answer="draft_answer",
329332
x_client_library_version="x-client-library-version",
330333
x_integration_type="x-integration-type",
@@ -553,6 +556,7 @@ async def test_method_query_with_all_params(self, async_client: AsyncCodex) -> N
553556
entry = await async_client.projects.entries.query(
554557
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
555558
question="question",
559+
client_metadata={},
556560
x_client_library_version="x-client-library-version",
557561
x_integration_type="x-integration-type",
558562
x_source="x-source",

0 commit comments

Comments
 (0)