diff --git a/.stats.yml b/.stats.yml index 86d74db..c22765c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 36 -openapi_spec_hash: d84beeafebbb22261946b77758a506a6 +openapi_spec_hash: 6a5cfa54c19b354978b1654c152b0431 config_hash: adbedb6317fca6f566f54564cc341846 diff --git a/src/codex/resources/projects/entries.py b/src/codex/resources/projects/entries.py index 8be96b0..7df9f1f 100644 --- a/src/codex/resources/projects/entries.py +++ b/src/codex/resources/projects/entries.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Iterable, Optional import httpx @@ -54,6 +54,7 @@ def create( *, question: str, answer: Optional[str] | NotGiven = NOT_GIVEN, + client_query_metadata: Iterable[object] | NotGiven = NOT_GIVEN, draft_answer: Optional[str] | NotGiven = NOT_GIVEN, x_client_library_version: str | NotGiven = NOT_GIVEN, x_integration_type: str | NotGiven = NOT_GIVEN, @@ -97,6 +98,7 @@ def create( { "question": question, "answer": answer, + "client_query_metadata": client_query_metadata, "draft_answer": draft_answer, }, entry_create_params.EntryCreateParams, @@ -232,6 +234,7 @@ def query( project_id: str, *, question: str, + client_metadata: Optional[object] | NotGiven = NOT_GIVEN, x_client_library_version: str | NotGiven = NOT_GIVEN, x_integration_type: str | NotGiven = NOT_GIVEN, x_source: str | NotGiven = NOT_GIVEN, @@ -270,7 +273,13 @@ def query( } return self._post( f"/api/projects/{project_id}/entries/query", - body=maybe_transform({"question": question}, entry_query_params.EntryQueryParams), + body=maybe_transform( + { + "question": question, + "client_metadata": client_metadata, + }, + entry_query_params.EntryQueryParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -304,6 +313,7 @@ async def create( *, question: str, answer: Optional[str] | NotGiven = NOT_GIVEN, + client_query_metadata: Iterable[object] | NotGiven = NOT_GIVEN, draft_answer: Optional[str] | NotGiven = NOT_GIVEN, x_client_library_version: str | NotGiven = NOT_GIVEN, x_integration_type: str | NotGiven = NOT_GIVEN, @@ -347,6 +357,7 @@ async def create( { "question": question, "answer": answer, + "client_query_metadata": client_query_metadata, "draft_answer": draft_answer, }, entry_create_params.EntryCreateParams, @@ -482,6 +493,7 @@ async def query( project_id: str, *, question: str, + client_metadata: Optional[object] | NotGiven = NOT_GIVEN, x_client_library_version: str | NotGiven = NOT_GIVEN, x_integration_type: str | NotGiven = NOT_GIVEN, x_source: str | NotGiven = NOT_GIVEN, @@ -520,7 +532,13 @@ async def query( } return await self._post( f"/api/projects/{project_id}/entries/query", - body=await async_maybe_transform({"question": question}, entry_query_params.EntryQueryParams), + body=await async_maybe_transform( + { + "question": question, + "client_metadata": client_metadata, + }, + entry_query_params.EntryQueryParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/codex/types/projects/cluster_list_response.py b/src/codex/types/projects/cluster_list_response.py index 7b4ef3a..d13a5f9 100644 --- a/src/codex/types/projects/cluster_list_response.py +++ b/src/codex/types/projects/cluster_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -26,6 +26,8 @@ class ClusterListResponse(BaseModel): answered_at: Optional[datetime] = None + client_query_metadata: Optional[List[object]] = None + draft_answer: Optional[str] = None draft_answer_last_edited: Optional[datetime] = None diff --git a/src/codex/types/projects/entry.py b/src/codex/types/projects/entry.py index 442eddd..77e2ca3 100644 --- a/src/codex/types/projects/entry.py +++ b/src/codex/types/projects/entry.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal @@ -24,6 +24,8 @@ class Entry(BaseModel): answered_at: Optional[datetime] = None + client_query_metadata: Optional[List[object]] = None + draft_answer: Optional[str] = None draft_answer_last_edited: Optional[datetime] = None diff --git a/src/codex/types/projects/entry_create_params.py b/src/codex/types/projects/entry_create_params.py index 0022942..f06846b 100644 --- a/src/codex/types/projects/entry_create_params.py +++ b/src/codex/types/projects/entry_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Iterable, Optional from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -15,6 +15,8 @@ class EntryCreateParams(TypedDict, total=False): answer: Optional[str] + client_query_metadata: Iterable[object] + draft_answer: Optional[str] x_client_library_version: Annotated[str, PropertyInfo(alias="x-client-library-version")] diff --git a/src/codex/types/projects/entry_query_params.py b/src/codex/types/projects/entry_query_params.py index bc0e317..50b5f26 100644 --- a/src/codex/types/projects/entry_query_params.py +++ b/src/codex/types/projects/entry_query_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,6 +13,8 @@ class EntryQueryParams(TypedDict, total=False): question: Required[str] + client_metadata: Optional[object] + x_client_library_version: Annotated[str, PropertyInfo(alias="x-client-library-version")] x_integration_type: Annotated[str, PropertyInfo(alias="x-integration-type")] diff --git a/src/codex/types/projects/entry_query_response.py b/src/codex/types/projects/entry_query_response.py index ad106d7..766e1e2 100644 --- a/src/codex/types/projects/entry_query_response.py +++ b/src/codex/types/projects/entry_query_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from ..._models import BaseModel @@ -14,6 +14,8 @@ class Entry(BaseModel): answer: Optional[str] = None + client_query_metadata: Optional[List[object]] = None + draft_answer: Optional[str] = None diff --git a/tests/api_resources/projects/test_entries.py b/tests/api_resources/projects/test_entries.py index e8965e4..5fa5ed9 100644 --- a/tests/api_resources/projects/test_entries.py +++ b/tests/api_resources/projects/test_entries.py @@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", question="question", answer="answer", + client_query_metadata=[{}], draft_answer="draft_answer", x_client_library_version="x-client-library-version", x_integration_type="x-integration-type", @@ -261,6 +262,7 @@ def test_method_query_with_all_params(self, client: Codex) -> None: entry = client.projects.entries.query( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", question="question", + client_metadata={}, x_client_library_version="x-client-library-version", x_integration_type="x-integration-type", x_source="x-source", @@ -325,6 +327,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", question="question", answer="answer", + client_query_metadata=[{}], draft_answer="draft_answer", x_client_library_version="x-client-library-version", x_integration_type="x-integration-type", @@ -553,6 +556,7 @@ async def test_method_query_with_all_params(self, async_client: AsyncCodex) -> N entry = await async_client.projects.entries.query( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", question="question", + client_metadata={}, x_client_library_version="x-client-library-version", x_integration_type="x-integration-type", x_source="x-source",