diff --git a/.stats.yml b/.stats.yml index be1ee82..69bb6fc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 36 -openapi_spec_hash: 1850a850b7e27992c6e47190db9add88 +openapi_spec_hash: 8ef89533cd58e3b2ceb53a877832f48b config_hash: adbedb6317fca6f566f54564cc341846 diff --git a/README.md b/README.md index 73c8c16..c2f168f 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,15 @@ from codex import Codex client = Codex() project_return_schema = client.projects.create( - config={"max_distance": 0}, + config={ + "clustering_use_llm_matching": True, + "llm_matching_model": "llm_matching_model", + "llm_matching_quality_preset": "llm_matching_quality_preset", + "lower_llm_match_distance_threshold": 0, + "max_distance": 0, + "query_use_llm_matching": True, + "upper_llm_match_distance_threshold": 0, + }, name="name", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) diff --git a/src/codex/resources/projects/entries.py b/src/codex/resources/projects/entries.py index 7df9f1f..f0fa39c 100644 --- a/src/codex/resources/projects/entries.py +++ b/src/codex/resources/projects/entries.py @@ -234,6 +234,7 @@ def query( project_id: str, *, question: str, + use_llm_matching: bool | NotGiven = NOT_GIVEN, client_metadata: Optional[object] | NotGiven = NOT_GIVEN, x_client_library_version: str | NotGiven = NOT_GIVEN, x_integration_type: str | NotGiven = NOT_GIVEN, @@ -281,7 +282,11 @@ def query( entry_query_params.EntryQueryParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"use_llm_matching": use_llm_matching}, entry_query_params.EntryQueryParams), ), cast_to=EntryQueryResponse, ) @@ -493,6 +498,7 @@ async def query( project_id: str, *, question: str, + use_llm_matching: bool | NotGiven = NOT_GIVEN, client_metadata: Optional[object] | NotGiven = NOT_GIVEN, x_client_library_version: str | NotGiven = NOT_GIVEN, x_integration_type: str | NotGiven = NOT_GIVEN, @@ -540,7 +546,13 @@ async def query( entry_query_params.EntryQueryParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"use_llm_matching": use_llm_matching}, entry_query_params.EntryQueryParams + ), ), cast_to=EntryQueryResponse, ) diff --git a/src/codex/types/project_create_params.py b/src/codex/types/project_create_params.py index 80882b2..ecdd194 100644 --- a/src/codex/types/project_create_params.py +++ b/src/codex/types/project_create_params.py @@ -19,4 +19,16 @@ class ProjectCreateParams(TypedDict, total=False): class Config(TypedDict, total=False): + clustering_use_llm_matching: bool + + llm_matching_model: str + + llm_matching_quality_preset: str + + lower_llm_match_distance_threshold: float + max_distance: float + + query_use_llm_matching: bool + + upper_llm_match_distance_threshold: float diff --git a/src/codex/types/project_list_response.py b/src/codex/types/project_list_response.py index 84aafa9..2b4fec4 100644 --- a/src/codex/types/project_list_response.py +++ b/src/codex/types/project_list_response.py @@ -9,8 +9,20 @@ class ProjectConfig(BaseModel): + clustering_use_llm_matching: Optional[bool] = None + + llm_matching_model: Optional[str] = None + + llm_matching_quality_preset: Optional[str] = None + + lower_llm_match_distance_threshold: Optional[float] = None + max_distance: Optional[float] = None + query_use_llm_matching: Optional[bool] = None + + upper_llm_match_distance_threshold: Optional[float] = None + class Project(BaseModel): id: str diff --git a/src/codex/types/project_return_schema.py b/src/codex/types/project_return_schema.py index 8531272..51a6c1a 100644 --- a/src/codex/types/project_return_schema.py +++ b/src/codex/types/project_return_schema.py @@ -9,8 +9,20 @@ class Config(BaseModel): + clustering_use_llm_matching: Optional[bool] = None + + llm_matching_model: Optional[str] = None + + llm_matching_quality_preset: Optional[str] = None + + lower_llm_match_distance_threshold: Optional[float] = None + max_distance: Optional[float] = None + query_use_llm_matching: Optional[bool] = None + + upper_llm_match_distance_threshold: Optional[float] = None + class ProjectReturnSchema(BaseModel): id: str diff --git a/src/codex/types/project_update_params.py b/src/codex/types/project_update_params.py index 46d747e..0a5aa54 100644 --- a/src/codex/types/project_update_params.py +++ b/src/codex/types/project_update_params.py @@ -17,4 +17,16 @@ class ProjectUpdateParams(TypedDict, total=False): class Config(TypedDict, total=False): + clustering_use_llm_matching: bool + + llm_matching_model: str + + llm_matching_quality_preset: str + + lower_llm_match_distance_threshold: float + max_distance: float + + query_use_llm_matching: bool + + upper_llm_match_distance_threshold: float diff --git a/src/codex/types/projects/entry_query_params.py b/src/codex/types/projects/entry_query_params.py index 50b5f26..d58b7bf 100644 --- a/src/codex/types/projects/entry_query_params.py +++ b/src/codex/types/projects/entry_query_params.py @@ -13,6 +13,8 @@ class EntryQueryParams(TypedDict, total=False): question: Required[str] + use_llm_matching: bool + client_metadata: Optional[object] x_client_library_version: Annotated[str, PropertyInfo(alias="x-client-library-version")] diff --git a/tests/api_resources/projects/test_entries.py b/tests/api_resources/projects/test_entries.py index 5fa5ed9..ca7eecb 100644 --- a/tests/api_resources/projects/test_entries.py +++ b/tests/api_resources/projects/test_entries.py @@ -262,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", + use_llm_matching=True, client_metadata={}, x_client_library_version="x-client-library-version", x_integration_type="x-integration-type", @@ -556,6 +557,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", + use_llm_matching=True, client_metadata={}, x_client_library_version="x-client-library-version", x_integration_type="x-integration-type", diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 10d2346..210f4e1 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -34,7 +34,15 @@ def test_method_create(self, client: Codex) -> None: @parametrize def test_method_create_with_all_params(self, client: Codex) -> None: project = client.projects.create( - config={"max_distance": 0}, + config={ + "clustering_use_llm_matching": True, + "llm_matching_model": "llm_matching_model", + "llm_matching_quality_preset": "llm_matching_quality_preset", + "lower_llm_match_distance_threshold": 0, + "max_distance": 0, + "query_use_llm_matching": True, + "upper_llm_match_distance_threshold": 0, + }, name="name", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", description="description", @@ -128,7 +136,15 @@ def test_method_update(self, client: Codex) -> None: def test_method_update_with_all_params(self, client: Codex) -> None: project = client.projects.update( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"max_distance": 0}, + config={ + "clustering_use_llm_matching": True, + "llm_matching_model": "llm_matching_model", + "llm_matching_quality_preset": "llm_matching_quality_preset", + "lower_llm_match_distance_threshold": 0, + "max_distance": 0, + "query_use_llm_matching": True, + "upper_llm_match_distance_threshold": 0, + }, name="name", description="description", ) @@ -324,7 +340,15 @@ async def test_method_create(self, async_client: AsyncCodex) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> None: project = await async_client.projects.create( - config={"max_distance": 0}, + config={ + "clustering_use_llm_matching": True, + "llm_matching_model": "llm_matching_model", + "llm_matching_quality_preset": "llm_matching_quality_preset", + "lower_llm_match_distance_threshold": 0, + "max_distance": 0, + "query_use_llm_matching": True, + "upper_llm_match_distance_threshold": 0, + }, name="name", organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", description="description", @@ -418,7 +442,15 @@ async def test_method_update(self, async_client: AsyncCodex) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> None: project = await async_client.projects.update( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"max_distance": 0}, + config={ + "clustering_use_llm_matching": True, + "llm_matching_model": "llm_matching_model", + "llm_matching_quality_preset": "llm_matching_quality_preset", + "lower_llm_match_distance_threshold": 0, + "max_distance": 0, + "query_use_llm_matching": True, + "upper_llm_match_distance_threshold": 0, + }, name="name", description="description", )