From 376681a8589de089ec2db967f23ee19a68f997e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 20:52:29 +0000 Subject: [PATCH 1/8] chore(internal): version bump From 1472e6f83fe738c01e33e34d9eb6c7ec906d4ecc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:16:28 +0000 Subject: [PATCH 2/8] feat(api): api update --- .stats.yml | 2 +- src/codex/resources/projects/projects.py | 8 -------- src/codex/types/project_retrieve_analytics_params.py | 3 --- src/codex/types/project_retrieve_analytics_response.py | 9 ++++++++- tests/api_resources/test_projects.py | 2 -- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 230d2377..9e3b9924 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 43 -openapi_spec_hash: 62b629dd5b215c1eebc57e0c6039eea7 +openapi_spec_hash: 1d2bab7a30685ae6ba2f0a98abf2dd54 config_hash: 5e459b33c53ffa6e554087a779bdb790 diff --git a/src/codex/resources/projects/projects.py b/src/codex/resources/projects/projects.py index 6ac036c0..bd50a684 100644 --- a/src/codex/resources/projects/projects.py +++ b/src/codex/resources/projects/projects.py @@ -365,7 +365,6 @@ def retrieve_analytics( project_id: str, *, end: int | NotGiven = NOT_GIVEN, - sme_limit: int | NotGiven = NOT_GIVEN, start: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -380,8 +379,6 @@ def retrieve_analytics( Args: end: End timestamp in seconds since epoch - sme_limit: Limit the number of top SME contributors to return. - start: Start timestamp in seconds since epoch extra_headers: Send extra headers @@ -404,7 +401,6 @@ def retrieve_analytics( query=maybe_transform( { "end": end, - "sme_limit": sme_limit, "start": start, }, project_retrieve_analytics_params.ProjectRetrieveAnalyticsParams, @@ -723,7 +719,6 @@ async def retrieve_analytics( project_id: str, *, end: int | NotGiven = NOT_GIVEN, - sme_limit: int | NotGiven = NOT_GIVEN, start: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -738,8 +733,6 @@ async def retrieve_analytics( Args: end: End timestamp in seconds since epoch - sme_limit: Limit the number of top SME contributors to return. - start: Start timestamp in seconds since epoch extra_headers: Send extra headers @@ -762,7 +755,6 @@ async def retrieve_analytics( query=await async_maybe_transform( { "end": end, - "sme_limit": sme_limit, "start": start, }, project_retrieve_analytics_params.ProjectRetrieveAnalyticsParams, diff --git a/src/codex/types/project_retrieve_analytics_params.py b/src/codex/types/project_retrieve_analytics_params.py index aadb4159..c5f9a48c 100644 --- a/src/codex/types/project_retrieve_analytics_params.py +++ b/src/codex/types/project_retrieve_analytics_params.py @@ -11,8 +11,5 @@ class ProjectRetrieveAnalyticsParams(TypedDict, total=False): end: int """End timestamp in seconds since epoch""" - sme_limit: int - """Limit the number of top SME contributors to return.""" - start: int """Start timestamp in seconds since epoch""" diff --git a/src/codex/types/project_retrieve_analytics_response.py b/src/codex/types/project_retrieve_analytics_response.py index f17975ec..dce14505 100644 --- a/src/codex/types/project_retrieve_analytics_response.py +++ b/src/codex/types/project_retrieve_analytics_response.py @@ -9,6 +9,7 @@ "AnswersPublished", "AnswersPublishedAnswersByAuthor", "BadResponses", + "BadResponsesResponsesByType", "Queries", ] @@ -25,8 +26,14 @@ class AnswersPublished(BaseModel): answers_by_author: List[AnswersPublishedAnswersByAuthor] +class BadResponsesResponsesByType(BaseModel): + num_prevented: int + + total: int + + class BadResponses(BaseModel): - responses_by_type: Dict[str, int] + responses_by_type: Dict[str, BadResponsesResponsesByType] total: int diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 3a8f0ec8..772a7b29 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -374,7 +374,6 @@ def test_method_retrieve_analytics_with_all_params(self, client: Codex) -> None: project = client.projects.retrieve_analytics( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end=0, - sme_limit=1, start=0, ) assert_matches_type(ProjectRetrieveAnalyticsResponse, project, path=["response"]) @@ -769,7 +768,6 @@ async def test_method_retrieve_analytics_with_all_params(self, async_client: Asy project = await async_client.projects.retrieve_analytics( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end=0, - sme_limit=1, start=0, ) assert_matches_type(ProjectRetrieveAnalyticsResponse, project, path=["response"]) From 379fc4f90da430329961e70bdbcf06e09330585d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:12:17 +0000 Subject: [PATCH 3/8] chore(internal): minor formatting changes --- src/codex/types/health_check_response.py | 1 - .../organizations/billing/organization_billing_setup_intent.py | 1 - .../types/organizations/organization_billing_invoices_schema.py | 1 - .../types/organizations/organization_billing_usage_schema.py | 1 - .../types/projects/access_key_retrieve_project_id_response.py | 1 - src/codex/types/projects/entry_notify_sme_response.py | 1 - 6 files changed, 6 deletions(-) diff --git a/src/codex/types/health_check_response.py b/src/codex/types/health_check_response.py index 7a2655d3..b3b7958a 100644 --- a/src/codex/types/health_check_response.py +++ b/src/codex/types/health_check_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["HealthCheckResponse"] diff --git a/src/codex/types/organizations/billing/organization_billing_setup_intent.py b/src/codex/types/organizations/billing/organization_billing_setup_intent.py index dfd07d6b..25b3f553 100644 --- a/src/codex/types/organizations/billing/organization_billing_setup_intent.py +++ b/src/codex/types/organizations/billing/organization_billing_setup_intent.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ...._models import BaseModel __all__ = ["OrganizationBillingSetupIntent"] diff --git a/src/codex/types/organizations/organization_billing_invoices_schema.py b/src/codex/types/organizations/organization_billing_invoices_schema.py index e588ded0..64b2959a 100644 --- a/src/codex/types/organizations/organization_billing_invoices_schema.py +++ b/src/codex/types/organizations/organization_billing_invoices_schema.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["OrganizationBillingInvoicesSchema"] diff --git a/src/codex/types/organizations/organization_billing_usage_schema.py b/src/codex/types/organizations/organization_billing_usage_schema.py index 8369fb31..05129502 100644 --- a/src/codex/types/organizations/organization_billing_usage_schema.py +++ b/src/codex/types/organizations/organization_billing_usage_schema.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["OrganizationBillingUsageSchema"] diff --git a/src/codex/types/projects/access_key_retrieve_project_id_response.py b/src/codex/types/projects/access_key_retrieve_project_id_response.py index 22775083..e204ccbc 100644 --- a/src/codex/types/projects/access_key_retrieve_project_id_response.py +++ b/src/codex/types/projects/access_key_retrieve_project_id_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["AccessKeyRetrieveProjectIDResponse"] diff --git a/src/codex/types/projects/entry_notify_sme_response.py b/src/codex/types/projects/entry_notify_sme_response.py index dd05a6cf..b3c5b373 100644 --- a/src/codex/types/projects/entry_notify_sme_response.py +++ b/src/codex/types/projects/entry_notify_sme_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["EntryNotifySmeResponse"] From a19531fbd2d2c81db2ff7accdd4599ecc82995ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:12:45 +0000 Subject: [PATCH 4/8] chore(internal): codegen related update --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e4dab9d..cab1a968 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 7c078aa3..6ae114ba 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 2ce3cdc2..1c7b27dc 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'cleanlab/codex-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 3f37e38210905a7bccc49779dfe2fef065b49ccd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:13:10 +0000 Subject: [PATCH 5/8] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 2 +- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cab1a968..fc62f784 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/codex-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 6ae114ba..7c078aa3 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 1c7b27dc..2ce3cdc2 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'cleanlab/codex-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 60ee0e200415cc8c7d7a3ef21812ec0fd02c6821 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:14:20 +0000 Subject: [PATCH 6/8] chore: broadly detect json family of content-type headers --- src/codex/_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codex/_response.py b/src/codex/_response.py index 6e7c1cdf..e4ddf703 100644 --- a/src/codex/_response.py +++ b/src/codex/_response.py @@ -233,7 +233,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: # split is required to handle cases where additional information is included # in the response, e.g. application/json; charset=utf-8 content_type, *_ = response.headers.get("content-type", "*").split(";") - if content_type != "application/json": + if not content_type.endswith("json"): if is_basemodel(cast_to): try: data = response.json() From 78f5727b34cd29fcae1fb3c84f78f202fb68cd8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 14:16:27 +0000 Subject: [PATCH 7/8] feat(api): api update --- .stats.yml | 2 +- src/codex/resources/projects/clusters.py | 28 +++++++++++- .../project_retrieve_analytics_response.py | 2 + .../types/projects/cluster_list_params.py | 14 +++++- .../types/projects/cluster_list_response.py | 44 +++++++++++++++++++ src/codex/types/projects/entry.py | 44 +++++++++++++++++++ .../types/projects/entry_query_response.py | 40 +++++++++++++++++ tests/api_resources/projects/test_clusters.py | 2 + 8 files changed, 172 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9e3b9924..7a2f56a6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 43 -openapi_spec_hash: 1d2bab7a30685ae6ba2f0a98abf2dd54 +openapi_spec_hash: b7beefbd38b4fcdd191cdb81a18a023b config_hash: 5e459b33c53ffa6e554087a779bdb790 diff --git a/src/codex/resources/projects/clusters.py b/src/codex/resources/projects/clusters.py index 584cde18..fea7e28e 100644 --- a/src/codex/resources/projects/clusters.py +++ b/src/codex/resources/projects/clusters.py @@ -52,10 +52,21 @@ def list( *, eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]] | NotGiven = NOT_GIVEN, + instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, offset: int | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]] + sort: Optional[ + Literal[ + "created_at", + "answered_at", + "cluster_frequency_count", + "custom_rank", + "eval_score", + "html_format_score", + "content_structure_score", + ] + ] | NotGiven = NOT_GIVEN, states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -90,6 +101,7 @@ def list( query=maybe_transform( { "eval_issue_types": eval_issue_types, + "instruction_adherence_failure": instruction_adherence_failure, "limit": limit, "offset": offset, "order": order, @@ -167,10 +179,21 @@ def list( *, eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]] | NotGiven = NOT_GIVEN, + instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, offset: int | NotGiven = NOT_GIVEN, order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]] + sort: Optional[ + Literal[ + "created_at", + "answered_at", + "cluster_frequency_count", + "custom_rank", + "eval_score", + "html_format_score", + "content_structure_score", + ] + ] | NotGiven = NOT_GIVEN, states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -205,6 +228,7 @@ def list( query=maybe_transform( { "eval_issue_types": eval_issue_types, + "instruction_adherence_failure": instruction_adherence_failure, "limit": limit, "offset": offset, "order": order, diff --git a/src/codex/types/project_retrieve_analytics_response.py b/src/codex/types/project_retrieve_analytics_response.py index dce14505..b1e5d85e 100644 --- a/src/codex/types/project_retrieve_analytics_response.py +++ b/src/codex/types/project_retrieve_analytics_response.py @@ -17,6 +17,8 @@ class AnswersPublishedAnswersByAuthor(BaseModel): answers_published: int + email: str + name: str user_id: str diff --git a/src/codex/types/projects/cluster_list_params.py b/src/codex/types/projects/cluster_list_params.py index fa84a6b0..cff2b85e 100644 --- a/src/codex/types/projects/cluster_list_params.py +++ b/src/codex/types/projects/cluster_list_params.py @@ -11,12 +11,24 @@ class ClusterListParams(TypedDict, total=False): eval_issue_types: List[Literal["hallucination", "search_failure", "unhelpful", "difficult_query"]] + instruction_adherence_failure: Optional[Literal["html_format", "content_structure"]] + limit: int offset: int order: Literal["asc", "desc"] - sort: Optional[Literal["created_at", "answered_at", "cluster_frequency_count", "custom_rank", "eval_score"]] + sort: Optional[ + Literal[ + "created_at", + "answered_at", + "cluster_frequency_count", + "custom_rank", + "eval_score", + "html_format_score", + "content_structure_score", + ] + ] states: List[Literal["unanswered", "draft", "published", "published_with_draft"]] diff --git a/src/codex/types/projects/cluster_list_response.py b/src/codex/types/projects/cluster_list_response.py index c149fbdb..2e8b5426 100644 --- a/src/codex/types/projects/cluster_list_response.py +++ b/src/codex/types/projects/cluster_list_response.py @@ -9,13 +9,31 @@ __all__ = [ "ClusterListResponse", "ManagedMetadata", + "ManagedMetadataContentStructureScores", "ManagedMetadataContextSufficiency", + "ManagedMetadataHTMLFormatScores", "ManagedMetadataQueryEaseCustomized", "ManagedMetadataResponseHelpfulness", "ManagedMetadataTrustworthiness", ] +class ManagedMetadataContentStructureScores(BaseModel): + average: Optional[float] = None + """The average of all scores.""" + + latest: Optional[float] = None + """The most recent score.""" + + max: Optional[float] = None + """The maximum score.""" + + min: Optional[float] = None + """The minimum score.""" + + scores: Optional[List[float]] = None + + class ManagedMetadataContextSufficiency(BaseModel): average: Optional[float] = None """The average of all scores.""" @@ -32,6 +50,22 @@ class ManagedMetadataContextSufficiency(BaseModel): scores: Optional[List[float]] = None +class ManagedMetadataHTMLFormatScores(BaseModel): + average: Optional[float] = None + """The average of all scores.""" + + latest: Optional[float] = None + """The most recent score.""" + + max: Optional[float] = None + """The maximum score.""" + + min: Optional[float] = None + """The minimum score.""" + + scores: Optional[List[float]] = None + + class ManagedMetadataQueryEaseCustomized(BaseModel): average: Optional[float] = None """The average of all scores.""" @@ -93,6 +127,9 @@ class ManagedMetadata(BaseModel): latest_location: Optional[str] = None """The most recent location string.""" + content_structure_scores: Optional[ManagedMetadataContentStructureScores] = None + """Holds a list of scores and computes aggregate statistics.""" + context_sufficiency: Optional[ManagedMetadataContextSufficiency] = None """Holds a list of scores and computes aggregate statistics.""" @@ -100,6 +137,9 @@ class ManagedMetadata(BaseModel): entry_points: Optional[List[str]] = None + html_format_scores: Optional[ManagedMetadataHTMLFormatScores] = None + """Holds a list of scores and computes aggregate statistics.""" + llm_responses: Optional[List[str]] = None locations: Optional[List[str]] = None @@ -136,6 +176,8 @@ class ClusterListResponse(BaseModel): client_query_metadata: Optional[List[object]] = None + content_structure_score: Optional[float] = None + draft_answer: Optional[str] = None draft_answer_last_edited: Optional[datetime] = None @@ -147,4 +189,6 @@ class ClusterListResponse(BaseModel): frequency_count: Optional[int] = None """number of times the entry matched for a /query request""" + html_format_score: Optional[float] = None + representative_entry_id: Optional[str] = None diff --git a/src/codex/types/projects/entry.py b/src/codex/types/projects/entry.py index 638fe352..eb2a2217 100644 --- a/src/codex/types/projects/entry.py +++ b/src/codex/types/projects/entry.py @@ -9,13 +9,31 @@ __all__ = [ "Entry", "ManagedMetadata", + "ManagedMetadataContentStructureScores", "ManagedMetadataContextSufficiency", + "ManagedMetadataHTMLFormatScores", "ManagedMetadataQueryEaseCustomized", "ManagedMetadataResponseHelpfulness", "ManagedMetadataTrustworthiness", ] +class ManagedMetadataContentStructureScores(BaseModel): + average: Optional[float] = None + """The average of all scores.""" + + latest: Optional[float] = None + """The most recent score.""" + + max: Optional[float] = None + """The maximum score.""" + + min: Optional[float] = None + """The minimum score.""" + + scores: Optional[List[float]] = None + + class ManagedMetadataContextSufficiency(BaseModel): average: Optional[float] = None """The average of all scores.""" @@ -32,6 +50,22 @@ class ManagedMetadataContextSufficiency(BaseModel): scores: Optional[List[float]] = None +class ManagedMetadataHTMLFormatScores(BaseModel): + average: Optional[float] = None + """The average of all scores.""" + + latest: Optional[float] = None + """The most recent score.""" + + max: Optional[float] = None + """The maximum score.""" + + min: Optional[float] = None + """The minimum score.""" + + scores: Optional[List[float]] = None + + class ManagedMetadataQueryEaseCustomized(BaseModel): average: Optional[float] = None """The average of all scores.""" @@ -93,6 +127,9 @@ class ManagedMetadata(BaseModel): latest_location: Optional[str] = None """The most recent location string.""" + content_structure_scores: Optional[ManagedMetadataContentStructureScores] = None + """Holds a list of scores and computes aggregate statistics.""" + context_sufficiency: Optional[ManagedMetadataContextSufficiency] = None """Holds a list of scores and computes aggregate statistics.""" @@ -100,6 +137,9 @@ class ManagedMetadata(BaseModel): entry_points: Optional[List[str]] = None + html_format_scores: Optional[ManagedMetadataHTMLFormatScores] = None + """Holds a list of scores and computes aggregate statistics.""" + llm_responses: Optional[List[str]] = None locations: Optional[List[str]] = None @@ -134,6 +174,8 @@ class Entry(BaseModel): client_query_metadata: Optional[List[object]] = None + content_structure_score: Optional[float] = None + draft_answer: Optional[str] = None draft_answer_last_edited: Optional[datetime] = None @@ -144,3 +186,5 @@ class Entry(BaseModel): frequency_count: Optional[int] = None """number of times the entry matched for a /query request""" + + html_format_score: Optional[float] = None diff --git a/src/codex/types/projects/entry_query_response.py b/src/codex/types/projects/entry_query_response.py index 26db1d83..318636b9 100644 --- a/src/codex/types/projects/entry_query_response.py +++ b/src/codex/types/projects/entry_query_response.py @@ -8,13 +8,31 @@ "EntryQueryResponse", "Entry", "EntryManagedMetadata", + "EntryManagedMetadataContentStructureScores", "EntryManagedMetadataContextSufficiency", + "EntryManagedMetadataHTMLFormatScores", "EntryManagedMetadataQueryEaseCustomized", "EntryManagedMetadataResponseHelpfulness", "EntryManagedMetadataTrustworthiness", ] +class EntryManagedMetadataContentStructureScores(BaseModel): + average: Optional[float] = None + """The average of all scores.""" + + latest: Optional[float] = None + """The most recent score.""" + + max: Optional[float] = None + """The maximum score.""" + + min: Optional[float] = None + """The minimum score.""" + + scores: Optional[List[float]] = None + + class EntryManagedMetadataContextSufficiency(BaseModel): average: Optional[float] = None """The average of all scores.""" @@ -31,6 +49,22 @@ class EntryManagedMetadataContextSufficiency(BaseModel): scores: Optional[List[float]] = None +class EntryManagedMetadataHTMLFormatScores(BaseModel): + average: Optional[float] = None + """The average of all scores.""" + + latest: Optional[float] = None + """The most recent score.""" + + max: Optional[float] = None + """The maximum score.""" + + min: Optional[float] = None + """The minimum score.""" + + scores: Optional[List[float]] = None + + class EntryManagedMetadataQueryEaseCustomized(BaseModel): average: Optional[float] = None """The average of all scores.""" @@ -92,6 +126,9 @@ class EntryManagedMetadata(BaseModel): latest_location: Optional[str] = None """The most recent location string.""" + content_structure_scores: Optional[EntryManagedMetadataContentStructureScores] = None + """Holds a list of scores and computes aggregate statistics.""" + context_sufficiency: Optional[EntryManagedMetadataContextSufficiency] = None """Holds a list of scores and computes aggregate statistics.""" @@ -99,6 +136,9 @@ class EntryManagedMetadata(BaseModel): entry_points: Optional[List[str]] = None + html_format_scores: Optional[EntryManagedMetadataHTMLFormatScores] = None + """Holds a list of scores and computes aggregate statistics.""" + llm_responses: Optional[List[str]] = None locations: Optional[List[str]] = None diff --git a/tests/api_resources/projects/test_clusters.py b/tests/api_resources/projects/test_clusters.py index 53706c6c..496236f8 100644 --- a/tests/api_resources/projects/test_clusters.py +++ b/tests/api_resources/projects/test_clusters.py @@ -32,6 +32,7 @@ def test_method_list_with_all_params(self, client: Codex) -> None: cluster = client.projects.clusters.list( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", eval_issue_types=["hallucination"], + instruction_adherence_failure="html_format", limit=1, offset=0, order="asc", @@ -146,6 +147,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCodex) -> No cluster = await async_client.projects.clusters.list( project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", eval_issue_types=["hallucination"], + instruction_adherence_failure="html_format", limit=1, offset=0, order="asc", From ed0a32261bd06e86b5437c4d689b0b5bcfb338d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 20:54:11 +0000 Subject: [PATCH 8/8] release: 0.1.0-alpha.18 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ pyproject.toml | 2 +- src/codex/_version.py | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e2f2c074..3cf71e62 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.17" + ".": "0.1.0-alpha.18" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e462359..6fd961c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.1.0-alpha.18 (2025-04-24) + +Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.17...v0.1.0-alpha.18) + +### Features + +* **api:** api update ([78f5727](https://github.com/cleanlab/codex-python/commit/78f5727b34cd29fcae1fb3c84f78f202fb68cd8a)) +* **api:** api update ([1472e6f](https://github.com/cleanlab/codex-python/commit/1472e6f83fe738c01e33e34d9eb6c7ec906d4ecc)) + + +### Chores + +* broadly detect json family of content-type headers ([60ee0e2](https://github.com/cleanlab/codex-python/commit/60ee0e200415cc8c7d7a3ef21812ec0fd02c6821)) +* **ci:** only use depot for staging repos ([3f37e38](https://github.com/cleanlab/codex-python/commit/3f37e38210905a7bccc49779dfe2fef065b49ccd)) +* **internal:** codegen related update ([a19531f](https://github.com/cleanlab/codex-python/commit/a19531fbd2d2c81db2ff7accdd4599ecc82995ce)) +* **internal:** minor formatting changes ([379fc4f](https://github.com/cleanlab/codex-python/commit/379fc4f90da430329961e70bdbcf06e09330585d)) +* **internal:** version bump ([376681a](https://github.com/cleanlab/codex-python/commit/376681a8589de089ec2db967f23ee19a68f997e5)) + ## 0.1.0-alpha.17 (2025-04-23) Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.16...v0.1.0-alpha.17) diff --git a/pyproject.toml b/pyproject.toml index 130b32e5..6cd58eba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "codex-sdk" -version = "0.1.0-alpha.17" +version = "0.1.0-alpha.18" description = "Internal SDK used within cleanlab-codex package. Refer to https://pypi.org/project/cleanlab-codex/ instead." dynamic = ["readme"] license = "MIT" diff --git a/src/codex/_version.py b/src/codex/_version.py index 264d49e0..29c60372 100644 --- a/src/codex/_version.py +++ b/src/codex/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "codex" -__version__ = "0.1.0-alpha.17" # x-release-please-version +__version__ = "0.1.0-alpha.18" # x-release-please-version