diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7657c56..f471069 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.27" + ".": "0.1.0-alpha.28" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index feb65cb..5b7840a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 54 -openapi_spec_hash: f263c6c6d8d75a8f7c1e9c65188e7ef2 +openapi_spec_hash: 43ecb34eaf8efd3fe94b23f2c859fe05 config_hash: 04312af86542d1127f09d3f3cbe5bb50 diff --git a/CHANGELOG.md b/CHANGELOG.md index d237111..86e2b46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.28 (2025-09-19) + +Full Changelog: [v0.1.0-alpha.27...v0.1.0-alpha.28](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.27...v0.1.0-alpha.28) + +### Features + +* **api:** api update ([dc0a0cc](https://github.com/cleanlab/codex-python/commit/dc0a0ccbb4db8d43bcd36e97c11ca7c16628db2d)) + ## 0.1.0-alpha.27 (2025-09-19) Full Changelog: [v0.1.0-alpha.26...v0.1.0-alpha.27](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.26...v0.1.0-alpha.27) diff --git a/pyproject.toml b/pyproject.toml index 214e6aa..a93fd5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "codex-sdk" -version = "0.1.0-alpha.27" +version = "0.1.0-alpha.28" 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 0e64acc..82d84e8 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.27" # x-release-please-version +__version__ = "0.1.0-alpha.28" # x-release-please-version diff --git a/src/codex/resources/projects/evals.py b/src/codex/resources/projects/evals.py index 5480291..f732981 100644 --- a/src/codex/resources/projects/evals.py +++ b/src/codex/resources/projects/evals.py @@ -54,6 +54,7 @@ def create( name: str, context_identifier: Optional[str] | Omit = omit, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, is_default: bool | Omit = omit, priority: Optional[int] | Omit = omit, query_identifier: Optional[str] | Omit = omit, @@ -86,6 +87,9 @@ def create( enabled: Allows the evaluation to be disabled without removing it + guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be + guardrailed + is_default: Whether the eval is a default, built-in eval or a custom eval priority: Priority order for evals (lower number = higher priority) to determine primary @@ -124,6 +128,7 @@ def create( "name": name, "context_identifier": context_identifier, "enabled": enabled, + "guardrailed_fallback_message": guardrailed_fallback_message, "is_default": is_default, "priority": priority, "query_identifier": query_identifier, @@ -152,6 +157,7 @@ def update( name: str, context_identifier: Optional[str] | Omit = omit, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, is_default: bool | Omit = omit, priority: Optional[int] | Omit = omit, query_identifier: Optional[str] | Omit = omit, @@ -184,6 +190,9 @@ def update( enabled: Allows the evaluation to be disabled without removing it + guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be + guardrailed + is_default: Whether the eval is a default, built-in eval or a custom eval priority: Priority order for evals (lower number = higher priority) to determine primary @@ -221,6 +230,7 @@ def update( project_id: str, body_eval_key: str, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, priority: Optional[int] | Omit = omit, should_escalate: bool | Omit = omit, should_guardrail: bool | Omit = omit, @@ -242,6 +252,9 @@ def update( enabled: Allows the evaluation to be disabled without removing it + guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be + guardrailed + priority: Priority order for evals (lower number = higher priority) to determine primary eval issue to surface @@ -275,6 +288,7 @@ def update( name: str | Omit = omit, context_identifier: Optional[str] | Omit = omit, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, is_default: bool | Omit = omit, priority: Optional[int] | Omit = omit, query_identifier: Optional[str] | Omit = omit, @@ -303,6 +317,7 @@ def update( "name": name, "context_identifier": context_identifier, "enabled": enabled, + "guardrailed_fallback_message": guardrailed_fallback_message, "is_default": is_default, "priority": priority, "query_identifier": query_identifier, @@ -433,6 +448,7 @@ async def create( name: str, context_identifier: Optional[str] | Omit = omit, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, is_default: bool | Omit = omit, priority: Optional[int] | Omit = omit, query_identifier: Optional[str] | Omit = omit, @@ -465,6 +481,9 @@ async def create( enabled: Allows the evaluation to be disabled without removing it + guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be + guardrailed + is_default: Whether the eval is a default, built-in eval or a custom eval priority: Priority order for evals (lower number = higher priority) to determine primary @@ -503,6 +522,7 @@ async def create( "name": name, "context_identifier": context_identifier, "enabled": enabled, + "guardrailed_fallback_message": guardrailed_fallback_message, "is_default": is_default, "priority": priority, "query_identifier": query_identifier, @@ -531,6 +551,7 @@ async def update( name: str, context_identifier: Optional[str] | Omit = omit, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, is_default: bool | Omit = omit, priority: Optional[int] | Omit = omit, query_identifier: Optional[str] | Omit = omit, @@ -563,6 +584,9 @@ async def update( enabled: Allows the evaluation to be disabled without removing it + guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be + guardrailed + is_default: Whether the eval is a default, built-in eval or a custom eval priority: Priority order for evals (lower number = higher priority) to determine primary @@ -600,6 +624,7 @@ async def update( project_id: str, body_eval_key: str, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, priority: Optional[int] | Omit = omit, should_escalate: bool | Omit = omit, should_guardrail: bool | Omit = omit, @@ -621,6 +646,9 @@ async def update( enabled: Allows the evaluation to be disabled without removing it + guardrailed_fallback_message: Fallback message to use if this eval fails and causes the response to be + guardrailed + priority: Priority order for evals (lower number = higher priority) to determine primary eval issue to surface @@ -654,6 +682,7 @@ async def update( name: str | Omit = omit, context_identifier: Optional[str] | Omit = omit, enabled: bool | Omit = omit, + guardrailed_fallback_message: Optional[str] | Omit = omit, is_default: bool | Omit = omit, priority: Optional[int] | Omit = omit, query_identifier: Optional[str] | Omit = omit, @@ -682,6 +711,7 @@ async def update( "name": name, "context_identifier": context_identifier, "enabled": enabled, + "guardrailed_fallback_message": guardrailed_fallback_message, "is_default": is_default, "priority": priority, "query_identifier": query_identifier, diff --git a/src/codex/types/project_create_params.py b/src/codex/types/project_create_params.py index 0d4a4f5..c17be67 100644 --- a/src/codex/types/project_create_params.py +++ b/src/codex/types/project_create_params.py @@ -57,6 +57,12 @@ class ConfigEvalConfigCustomEvalsEvals(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: bool """Whether the eval is a default, built-in eval or a custom eval""" @@ -110,6 +116,12 @@ class ConfigEvalConfigDefaultEvalsContextSufficiency(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -145,6 +157,12 @@ class ConfigEvalConfigDefaultEvalsQueryEase(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -180,6 +198,12 @@ class ConfigEvalConfigDefaultEvalsResponseGroundedness(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -215,6 +239,12 @@ class ConfigEvalConfigDefaultEvalsResponseHelpfulness(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -250,6 +280,12 @@ class ConfigEvalConfigDefaultEvalsTrustworthiness(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary diff --git a/src/codex/types/project_list_response.py b/src/codex/types/project_list_response.py index db1666c..9fd609f 100644 --- a/src/codex/types/project_list_response.py +++ b/src/codex/types/project_list_response.py @@ -19,6 +19,7 @@ "ProjectConfigEvalConfigDefaultEvalsResponseGroundedness", "ProjectConfigEvalConfigDefaultEvalsResponseHelpfulness", "ProjectConfigEvalConfigDefaultEvalsTrustworthiness", + "Filters", ] @@ -47,6 +48,12 @@ class ProjectConfigEvalConfigCustomEvalsEvals(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: Optional[bool] = None """Whether the eval is a default, built-in eval or a custom eval""" @@ -100,6 +107,12 @@ class ProjectConfigEvalConfigDefaultEvalsContextSufficiency(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -135,6 +148,12 @@ class ProjectConfigEvalConfigDefaultEvalsQueryEase(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -170,6 +189,12 @@ class ProjectConfigEvalConfigDefaultEvalsResponseGroundedness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -205,6 +230,12 @@ class ProjectConfigEvalConfigDefaultEvalsResponseHelpfulness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -240,6 +271,12 @@ class ProjectConfigEvalConfigDefaultEvalsTrustworthiness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -354,7 +391,14 @@ class Project(BaseModel): unaddressed_count: Optional[int] = None +class Filters(BaseModel): + query: Optional[str] = None + + class ProjectListResponse(BaseModel): projects: List[Project] total_count: int + + filters: Optional[Filters] = None + """Applied filters for the projects list request""" diff --git a/src/codex/types/project_retrieve_response.py b/src/codex/types/project_retrieve_response.py index 19abb67..949ce25 100644 --- a/src/codex/types/project_retrieve_response.py +++ b/src/codex/types/project_retrieve_response.py @@ -46,6 +46,12 @@ class ConfigEvalConfigCustomEvalsEvals(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: Optional[bool] = None """Whether the eval is a default, built-in eval or a custom eval""" @@ -99,6 +105,12 @@ class ConfigEvalConfigDefaultEvalsContextSufficiency(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -134,6 +146,12 @@ class ConfigEvalConfigDefaultEvalsQueryEase(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -169,6 +187,12 @@ class ConfigEvalConfigDefaultEvalsResponseGroundedness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -204,6 +228,12 @@ class ConfigEvalConfigDefaultEvalsResponseHelpfulness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -239,6 +269,12 @@ class ConfigEvalConfigDefaultEvalsTrustworthiness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary diff --git a/src/codex/types/project_return_schema.py b/src/codex/types/project_return_schema.py index cb114db..cf2f3a8 100644 --- a/src/codex/types/project_return_schema.py +++ b/src/codex/types/project_return_schema.py @@ -46,6 +46,12 @@ class ConfigEvalConfigCustomEvalsEvals(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: Optional[bool] = None """Whether the eval is a default, built-in eval or a custom eval""" @@ -99,6 +105,12 @@ class ConfigEvalConfigDefaultEvalsContextSufficiency(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -134,6 +146,12 @@ class ConfigEvalConfigDefaultEvalsQueryEase(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -169,6 +187,12 @@ class ConfigEvalConfigDefaultEvalsResponseGroundedness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -204,6 +228,12 @@ class ConfigEvalConfigDefaultEvalsResponseHelpfulness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary @@ -239,6 +269,12 @@ class ConfigEvalConfigDefaultEvalsTrustworthiness(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] = None """ Priority order for evals (lower number = higher priority) to determine primary diff --git a/src/codex/types/project_update_params.py b/src/codex/types/project_update_params.py index 9b32bb6..4b4de76 100644 --- a/src/codex/types/project_update_params.py +++ b/src/codex/types/project_update_params.py @@ -55,6 +55,12 @@ class ConfigEvalConfigCustomEvalsEvals(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: bool """Whether the eval is a default, built-in eval or a custom eval""" @@ -108,6 +114,12 @@ class ConfigEvalConfigDefaultEvalsContextSufficiency(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -143,6 +155,12 @@ class ConfigEvalConfigDefaultEvalsQueryEase(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -178,6 +196,12 @@ class ConfigEvalConfigDefaultEvalsResponseGroundedness(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -213,6 +237,12 @@ class ConfigEvalConfigDefaultEvalsResponseHelpfulness(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary @@ -248,6 +278,12 @@ class ConfigEvalConfigDefaultEvalsTrustworthiness(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary diff --git a/src/codex/types/project_validate_response.py b/src/codex/types/project_validate_response.py index e56d3bc..1c0cc4a 100644 --- a/src/codex/types/project_validate_response.py +++ b/src/codex/types/project_validate_response.py @@ -12,10 +12,14 @@ class DeterministicGuardrailsResults(BaseModel): should_guardrail: bool + fallback_message: Optional[str] = None + matches: Optional[List[str]] = None class EvalScores(BaseModel): + guardrailed_fallback_message: Optional[str] = None + score: Optional[float] = None triggered: bool diff --git a/src/codex/types/projects/eval_create_params.py b/src/codex/types/projects/eval_create_params.py index aead432..5f66f6a 100644 --- a/src/codex/types/projects/eval_create_params.py +++ b/src/codex/types/projects/eval_create_params.py @@ -33,6 +33,12 @@ class EvalCreateParams(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: bool """Whether the eval is a default, built-in eval or a custom eval""" diff --git a/src/codex/types/projects/eval_list_response.py b/src/codex/types/projects/eval_list_response.py index eb2cb9a..073312d 100644 --- a/src/codex/types/projects/eval_list_response.py +++ b/src/codex/types/projects/eval_list_response.py @@ -33,6 +33,12 @@ class Eval(BaseModel): enabled: Optional[bool] = None """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] = None + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: Optional[bool] = None """Whether the eval is a default, built-in eval or a custom eval""" diff --git a/src/codex/types/projects/eval_update_params.py b/src/codex/types/projects/eval_update_params.py index 545c0b2..1cfa836 100644 --- a/src/codex/types/projects/eval_update_params.py +++ b/src/codex/types/projects/eval_update_params.py @@ -37,6 +37,12 @@ class CustomEvalCreateOrUpdateSchema(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + is_default: bool """Whether the eval is a default, built-in eval or a custom eval""" @@ -85,6 +91,12 @@ class DefaultEvalUpdateSchema(TypedDict, total=False): enabled: bool """Allows the evaluation to be disabled without removing it""" + guardrailed_fallback_message: Optional[str] + """ + Fallback message to use if this eval fails and causes the response to be + guardrailed + """ + priority: Optional[int] """ Priority order for evals (lower number = higher priority) to determine primary diff --git a/src/codex/types/projects/query_log_list_by_group_response.py b/src/codex/types/projects/query_log_list_by_group_response.py index f6156eb..fc2e904 100644 --- a/src/codex/types/projects/query_log_list_by_group_response.py +++ b/src/codex/types/projects/query_log_list_by_group_response.py @@ -95,6 +95,8 @@ class QueryLogsByGroupQueryLogDeterministicGuardrailsResults(BaseModel): should_guardrail: bool + fallback_message: Optional[str] = None + matches: Optional[List[str]] = None diff --git a/src/codex/types/projects/query_log_list_groups_response.py b/src/codex/types/projects/query_log_list_groups_response.py index 11c24b2..e61b651 100644 --- a/src/codex/types/projects/query_log_list_groups_response.py +++ b/src/codex/types/projects/query_log_list_groups_response.py @@ -92,6 +92,8 @@ class DeterministicGuardrailsResults(BaseModel): should_guardrail: bool + fallback_message: Optional[str] = None + matches: Optional[List[str]] = None diff --git a/src/codex/types/projects/query_log_list_response.py b/src/codex/types/projects/query_log_list_response.py index 098ac81..6494d83 100644 --- a/src/codex/types/projects/query_log_list_response.py +++ b/src/codex/types/projects/query_log_list_response.py @@ -92,6 +92,8 @@ class DeterministicGuardrailsResults(BaseModel): should_guardrail: bool + fallback_message: Optional[str] = None + matches: Optional[List[str]] = None diff --git a/src/codex/types/projects/query_log_retrieve_response.py b/src/codex/types/projects/query_log_retrieve_response.py index cae996c..abfaeeb 100644 --- a/src/codex/types/projects/query_log_retrieve_response.py +++ b/src/codex/types/projects/query_log_retrieve_response.py @@ -92,6 +92,8 @@ class DeterministicGuardrailsResults(BaseModel): should_guardrail: bool + fallback_message: Optional[str] = None + matches: Optional[List[str]] = None diff --git a/src/codex/types/projects/remediation_list_resolved_logs_response.py b/src/codex/types/projects/remediation_list_resolved_logs_response.py index 1ef0e6f..e2239c4 100644 --- a/src/codex/types/projects/remediation_list_resolved_logs_response.py +++ b/src/codex/types/projects/remediation_list_resolved_logs_response.py @@ -93,6 +93,8 @@ class QueryLogDeterministicGuardrailsResults(BaseModel): should_guardrail: bool + fallback_message: Optional[str] = None + matches: Optional[List[str]] = None diff --git a/tests/api_resources/projects/test_evals.py b/tests/api_resources/projects/test_evals.py index 7266751..1ccde4f 100644 --- a/tests/api_resources/projects/test_evals.py +++ b/tests/api_resources/projects/test_evals.py @@ -39,6 +39,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: name="name", context_identifier="context_identifier", enabled=True, + guardrailed_fallback_message="guardrailed_fallback_message", is_default=True, priority=0, query_identifier="query_identifier", @@ -116,6 +117,7 @@ def test_method_update_with_all_params_overload_1(self, client: Codex) -> None: name="name", context_identifier="context_identifier", enabled=True, + guardrailed_fallback_message="guardrailed_fallback_message", is_default=True, priority=0, query_identifier="query_identifier", @@ -200,6 +202,7 @@ def test_method_update_with_all_params_overload_2(self, client: Codex) -> None: project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body_eval_key="eval_key", enabled=True, + guardrailed_fallback_message="guardrailed_fallback_message", priority=0, should_escalate=True, should_guardrail=True, @@ -387,6 +390,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> name="name", context_identifier="context_identifier", enabled=True, + guardrailed_fallback_message="guardrailed_fallback_message", is_default=True, priority=0, query_identifier="query_identifier", @@ -464,6 +468,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn name="name", context_identifier="context_identifier", enabled=True, + guardrailed_fallback_message="guardrailed_fallback_message", is_default=True, priority=0, query_identifier="query_identifier", @@ -548,6 +553,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body_eval_key="eval_key", enabled=True, + guardrailed_fallback_message="guardrailed_fallback_message", priority=0, should_escalate=True, should_guardrail=True, diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 153c3aa..84ad6cd 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -49,6 +49,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: "name": "name", "context_identifier": "context_identifier", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "is_default": True, "priority": 0, "query_identifier": "query_identifier", @@ -65,6 +66,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -75,6 +77,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -85,6 +88,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -95,6 +99,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -105,6 +110,7 @@ def test_method_create_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -227,6 +233,7 @@ def test_method_update_with_all_params(self, client: Codex) -> None: "name": "name", "context_identifier": "context_identifier", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "is_default": True, "priority": 0, "query_identifier": "query_identifier", @@ -243,6 +250,7 @@ def test_method_update_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -253,6 +261,7 @@ def test_method_update_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -263,6 +272,7 @@ def test_method_update_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -273,6 +283,7 @@ def test_method_update_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -283,6 +294,7 @@ def test_method_update_with_all_params(self, client: Codex) -> None: "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -728,6 +740,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> "name": "name", "context_identifier": "context_identifier", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "is_default": True, "priority": 0, "query_identifier": "query_identifier", @@ -744,6 +757,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -754,6 +768,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -764,6 +779,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -774,6 +790,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -784,6 +801,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -906,6 +924,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> "name": "name", "context_identifier": "context_identifier", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "is_default": True, "priority": 0, "query_identifier": "query_identifier", @@ -922,6 +941,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -932,6 +952,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -942,6 +963,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -952,6 +974,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True, @@ -962,6 +985,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCodex) -> "eval_key": "eval_key", "name": "name", "enabled": True, + "guardrailed_fallback_message": "guardrailed_fallback_message", "priority": 0, "should_escalate": True, "should_guardrail": True,