diff --git a/openapi.yaml b/openapi.yaml index 14fd3ddb..33c90ffe 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -418,9 +418,10 @@ paths: - type: string - type: 'null' description: ETag of the dataset as a version identifier. + examples: + - d89cce33-549d-4b6d-b220-afb641d859c8 title: If-Match description: ETag of the dataset as a version identifier. - example: d89cce33-549d-4b6d-b220-afb641d859c8 requestBody: required: true content: @@ -1990,392 +1991,6 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' - /projects/{project_id}/log_streams: - post: - tags: - - log_stream - summary: Create Log Stream - description: Create a new log stream for a project. - operationId: create_log_stream_projects__project_id__log_streams_post - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LogStreamCreateRequest' - examples: - - name: my_first_log_stream - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/LogStreamResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - get: - tags: - - log_stream - summary: List Log Streams - description: 'Retrieve all log streams for a project. - - - DEPRECATED in favor of `list_log_streams_paginated`.' - operationId: list_log_streams_projects__project_id__log_streams_get - deprecated: true - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - - name: include_counts - in: query - required: false - schema: - type: boolean - default: false - title: Include Counts - responses: - '200': - description: Successful Response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/LogStreamResponse' - title: Response List Log Streams Projects Project Id Log Streams - Get - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - /projects/{project_id}/log_streams/paginated: - get: - tags: - - log_stream - summary: List Log Streams Paginated - description: Retrieve all log streams for a project paginated. - operationId: list_log_streams_paginated_projects__project_id__log_streams_paginated_get - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - - name: include_counts - in: query - required: false - schema: - type: boolean - default: false - title: Include Counts - - name: starting_token - in: query - required: false - schema: - type: integer - default: 0 - title: Starting Token - - name: limit - in: query - required: false - schema: - type: integer - default: 100 - title: Limit - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/ListLogStreamResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - /projects/{project_id}/log_streams/search: - post: - tags: - - log_stream - summary: Search Log Streams - description: Search log streams for a project. - operationId: search_log_streams_projects__project_id__log_streams_search_post - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LogStreamSearchRequest' - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/ListLogStreamResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - /projects/{project_id}/log_streams/{log_stream_id}: - get: - tags: - - log_stream - summary: Get Log Stream - description: Retrieve a specific log stream. - operationId: get_log_stream_projects__project_id__log_streams__log_stream_id__get - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: log_stream_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Log Stream Id - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/LogStreamResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - put: - tags: - - log_stream - summary: Update Log Stream - description: Update a specific log stream. - operationId: update_log_stream_projects__project_id__log_streams__log_stream_id__put - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: log_stream_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Log Stream Id - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LogStreamUpdateRequest' - examples: - - name: my_first_log_stream - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/LogStreamResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - delete: - tags: - - log_stream - summary: Delete Log Stream - description: Delete a specific log stream. - operationId: delete_log_stream_projects__project_id__log_streams__log_stream_id__delete - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: log_stream_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Log Stream Id - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - responses: - '204': - description: Successful Response - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - /projects/{project_id}/log_streams/{log_stream_id}/metric_settings: - patch: - tags: - - log_stream - summary: Update Metric Settings - operationId: update_metric_settings_projects__project_id__log_streams__log_stream_id__metric_settings_patch - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - - name: log_stream_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Log Stream Id - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/MetricSettingsRequest' - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/MetricSettingsResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - get: - tags: - - log_stream - summary: Get Metric Settings - operationId: get_metric_settings_projects__project_id__log_streams__log_stream_id__metric_settings_get - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: log_stream_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Log Stream Id - - name: project_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Project Id - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/MetricSettingsResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' /projects/{project_id}/traces/aggregated: post: tags: @@ -4293,98 +3908,6 @@ paths: - APIKeyHeader: [] - OAuth2PasswordBearer: [] - HTTPBasic: [] - /scorers/{scorer_id}/version/luna: - post: - tags: - - data - - prompts - - rows - summary: Create Luna Scorer Version - operationId: create_luna_scorer_version_scorers__scorer_id__version_luna_post - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - parameters: - - name: scorer_id - in: path - required: true - schema: - type: string - format: uuid4 - title: Scorer Id - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateCustomLunaScorerVersionRequest' - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/BaseScorerVersionResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - /scorers/llm/validate: - post: - tags: - - data - - prompts - - rows - summary: Manual Llm Validate - operationId: manual_llm_validate_scorers_llm_validate_post - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/GeneratedScorerValidationResponse' - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] - /scorers/llm/validate/multipart: - post: - tags: - - data - - prompts - - rows - summary: Manual Llm Validate Multipart - operationId: manual_llm_validate_multipart_scorers_llm_validate_multipart_post - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/Body_manual_llm_validate_multipart_scorers_llm_validate_multipart_post' - required: true - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/GeneratedScorerValidationResponse' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - security: - - ClassicAPIKeyHeader: [] - - APIKeyHeader: [] - - OAuth2PasswordBearer: [] - - HTTPBasic: [] /projects/{project_id}/stages: post: tags: @@ -5426,6 +4949,7 @@ paths: - name: huggingface-pytorch-inference-2024-02-29-14-53-51-829 alias: aws_hello_world integration: aws_sagemaker + lifecycle_state: active system_supported: false input_modalities: - text @@ -7110,6 +6634,51 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' + /scorers/{scorer_id}/version/luna: + post: + tags: + - data + - prompts + - rows + summary: Create Luna Scorer Version + description: "Create a new custom Luna scorer version for the given scorer.\n\ + \nArgs:\n create_luna_scorer_version_request: LoRA/fine-tuning parameters\ + \ for the new version.\n scorer: The Luna scorer to create a new version\ + \ for.\n ctx: Async request context with the authenticated user and read\ + \ session.\n\nReturns:\n The newly created scorer version." + operationId: create_luna_scorer_version_scorers__scorer_id__version_luna_post + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: scorer_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Scorer Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCustomLunaScorerVersionRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/BaseScorerVersionResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' /scorers/list: post: tags: @@ -7504,6 +7073,69 @@ paths: - APIKeyHeader: [] - OAuth2PasswordBearer: [] - HTTPBasic: [] + /scorers/llm/validate: + post: + tags: + - data + - prompts + - rows + summary: Manual Llm Validate + description: "Validate an LLM scorer manually, with query/response passed inline\ + \ (no file uploads).\n\nArgs:\n request: Raw request; body is parsed into\ + \ a GeneratedScorerValidationRequest.\n ctx: Async request context with\ + \ the authenticated user and read session.\n\nReturns:\n A pending task\ + \ result the caller can poll for validation results." + operationId: manual_llm_validate_scorers_llm_validate_post + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/GeneratedScorerValidationResponse' + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + /scorers/llm/validate/multipart: + post: + tags: + - data + - prompts + - rows + summary: Manual Llm Validate Multipart + description: "Validate an LLM scorer manually, with optional query/response\ + \ file uploads.\n\nArgs:\n body: JSON-encoded GeneratedScorerValidationRequest.\n\ + \ query_files: Optional files attached to the query side of the validation.\n\ + \ response_files: Optional files attached to the response side of the validation.\n\ + \ ctx: Async request context with the authenticated user and read session.\n\ + \nReturns:\n A pending task result the caller can poll for validation results." + operationId: manual_llm_validate_multipart_scorers_llm_validate_multipart_post + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_manual_llm_validate_multipart_scorers_llm_validate_multipart_post' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/GeneratedScorerValidationResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] /scorers/llm/validate/log_record: post: tags: @@ -8720,7 +8352,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ExtendedSessionRecordWithChildren' + $ref: '#/components/schemas/ExtendedReadSessionRecordWithChildren' '422': description: Validation Error content: @@ -10306,6 +9938,392 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/log_streams: + post: + tags: + - log_stream + summary: Create Log Stream + description: Create a new log stream for a project. + operationId: create_log_stream_projects__project_id__log_streams_post + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamCreateRequest' + examples: + - name: my_first_log_stream + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + get: + tags: + - log_stream + summary: List Log Streams + description: 'Retrieve all log streams for a project. + + + DEPRECATED in favor of `list_log_streams_paginated`.' + operationId: list_log_streams_projects__project_id__log_streams_get + deprecated: true + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + - name: include_counts + in: query + required: false + schema: + type: boolean + default: false + title: Include Counts + responses: + '200': + description: Successful Response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LogStreamResponse' + title: Response List Log Streams Projects Project Id Log Streams + Get + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/log_streams/paginated: + get: + tags: + - log_stream + summary: List Log Streams Paginated + description: Retrieve all log streams for a project paginated. + operationId: list_log_streams_paginated_projects__project_id__log_streams_paginated_get + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + - name: include_counts + in: query + required: false + schema: + type: boolean + default: false + title: Include Counts + - name: starting_token + in: query + required: false + schema: + type: integer + default: 0 + title: Starting Token + - name: limit + in: query + required: false + schema: + type: integer + default: 100 + title: Limit + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListLogStreamResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/log_streams/search: + post: + tags: + - log_stream + summary: Search Log Streams + description: Search log streams for a project. + operationId: search_log_streams_projects__project_id__log_streams_search_post + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamSearchRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListLogStreamResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/log_streams/{log_stream_id}: + get: + tags: + - log_stream + summary: Get Log Stream + description: Retrieve a specific log stream. + operationId: get_log_stream_projects__project_id__log_streams__log_stream_id__get + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: log_stream_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Log Stream Id + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - log_stream + summary: Update Log Stream + description: Update a specific log stream. + operationId: update_log_stream_projects__project_id__log_streams__log_stream_id__put + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: log_stream_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Log Stream Id + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamUpdateRequest' + examples: + - name: my_first_log_stream + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - log_stream + summary: Delete Log Stream + description: Delete a specific log stream. + operationId: delete_log_stream_projects__project_id__log_streams__log_stream_id__delete + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: log_stream_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Log Stream Id + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + responses: + '204': + description: Successful Response + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/log_streams/{log_stream_id}/metric_settings: + patch: + tags: + - log_stream + summary: Update Metric Settings + operationId: update_metric_settings_projects__project_id__log_streams__log_stream_id__metric_settings_patch + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + - name: log_stream_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Log Stream Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSettingsRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSettingsResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + get: + tags: + - log_stream + summary: Get Metric Settings + operationId: get_metric_settings_projects__project_id__log_streams__log_stream_id__metric_settings_get + security: + - ClassicAPIKeyHeader: [] + - APIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: log_stream_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Log Stream Id + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSettingsResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' components: schemas: ActionResult: @@ -10575,6 +10593,12 @@ components: $ref: '#/components/schemas/AgentType' description: Agent type. default: default + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Name of the agent. type: object title: AgentSpan AgentType: @@ -13834,15 +13858,6 @@ components: - type: integer - type: 'null' title: Num Judges - scoreable_node_types: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Scoreable Node Types - description: List of node types that can be scored by this scorer. Defaults - to llm/chat. cot_enabled: anyOf: - type: boolean @@ -13850,18 +13865,6 @@ components: title: Cot Enabled description: Whether to enable chain of thought for this scorer. Defaults to False for llm scorers. - output_type: - anyOf: - - $ref: '#/components/schemas/OutputTypeEnum' - - type: 'null' - description: What type of output to use for model-based scorers (sessions_normalized, - trace_io_only, etc.). - input_type: - anyOf: - - $ref: '#/components/schemas/InputTypeEnum' - - type: 'null' - description: What type of input to use for model-based scorers (sessions_normalized, - trace_io_only, etc.). type: object required: - id @@ -13904,28 +13907,11 @@ components: - type: integer - type: 'null' title: Num Judges - scoreable_node_types: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Scoreable Node Types cot_enabled: anyOf: - type: boolean - type: 'null' title: Cot Enabled - output_type: - anyOf: - - $ref: '#/components/schemas/OutputTypeEnum' - - type: 'null' - input_type: - anyOf: - - $ref: '#/components/schemas/InputTypeEnum' - - type: 'null' - description: What type of input to use for model-based scorers (sessions_normalized, - trace_io_only, etc.). created_at: type: string format: date-time @@ -13938,6 +13924,17 @@ components: anyOf: - $ref: '#/components/schemas/ChainPollTemplate' - type: 'null' + scoreable_node_types: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Scoreable Node Types + output_type: + anyOf: + - $ref: '#/components/schemas/OutputTypeEnum' + - type: 'null' allowed_model: anyOf: - type: boolean @@ -15599,10 +15596,6 @@ components: - type: string - type: 'null' title: Migration Name - xray: - type: boolean - title: Xray - default: true process_existing_inference_runs: type: boolean title: Process Existing Inference Runs @@ -15662,7 +15655,7 @@ components: scorers: anyOf: - items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array - items: oneOf: @@ -15785,7 +15778,7 @@ components: - type: 'null' scorer_config: anyOf: - - $ref: '#/components/schemas/ScorerConfig' + - $ref: '#/components/schemas/RuntimeScorerConfig' - type: 'null' sub_scorers: items: @@ -15919,10 +15912,6 @@ components: - type: string - type: 'null' title: Migration Name - xray: - type: boolean - title: Xray - default: true process_existing_inference_runs: type: boolean title: Process Existing Inference Runs @@ -15982,7 +15971,7 @@ components: scorers: anyOf: - items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array - items: oneOf: @@ -16105,7 +16094,7 @@ components: - type: 'null' scorer_config: anyOf: - - $ref: '#/components/schemas/ScorerConfig' + - $ref: '#/components/schemas/RuntimeScorerConfig' - type: 'null' sub_scorers: items: @@ -16348,6 +16337,10 @@ components: anyOf: - $ref: '#/components/schemas/ScorerDefaults' - type: 'null' + invocation: + anyOf: + - $ref: '#/components/schemas/ScorerInvocationConfig' + - type: 'null' scorer_type: $ref: '#/components/schemas/ScorerTypes' deprecated: @@ -22857,7 +22850,7 @@ components: - type: 'null' scorers: items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array title: Scorers trigger: @@ -24027,6 +24020,12 @@ components: $ref: '#/components/schemas/AgentType' description: Agent type. default: default + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Name of the agent. type: object required: - id @@ -24394,6 +24393,12 @@ components: $ref: '#/components/schemas/AgentType' description: Agent type. default: default + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Name of the agent. type: object required: - id @@ -25090,36 +25095,90 @@ components: - run_id - parent_id title: ExtendedLlmSpanRecord - ExtendedRetrieverSpanRecord: + ExtendedReadSessionRecordWithChildren: properties: type: type: string - const: retriever + const: session title: Type description: Type of the trace, span or session. - default: retriever + default: session input: - type: string + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input - description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - items: - $ref: '#/components/schemas/Document' - type: array + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: $ref: '#/components/schemas/Document' type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -25183,13 +25242,14 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the session session_id: - type: string - format: uuid4 + anyOf: + - type: string + format: uuid4 + - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace (or the same - value as id for a trace) + description: Galileo ID of the session containing the trace or span or session trace_id: anyOf: - type: string @@ -25354,52 +25414,54 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: - type: string - format: uuid4 - title: Parent ID - description: Galileo ID of the parent of this span - is_complete: - type: boolean - title: Is Complete - description: Whether the parent trace is complete or not - default: true - step_number: + previous_session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Previous Session Id + num_traces: anyOf: - type: integer - type: 'null' - title: Step Number - description: Topological step number of the span. - type: object - required: - - id - - session_id - - project_id - - run_id - - parent_id - title: ExtendedRetrieverSpanRecord - ExtendedRetrieverSpanRecordWithChildren: - properties: - spans: + title: Num Traces + traces: items: oneOf: - - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' + - $ref: '#/components/schemas/ExtendedTraceRecordWithChildren' + - $ref: '#/components/schemas/StubTraceRecord' discriminator: propertyName: type mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + stub_trace: '#/components/schemas/StubTraceRecord' + trace: '#/components/schemas/ExtendedTraceRecordWithChildren' type: array - title: Spans + title: Traces + type: object + required: + - id + - project_id + - run_id + title: ExtendedReadSessionRecordWithChildren + description: 'Read-side session response that also accepts synthesized stub_trace + roots. + + + Same shape as ExtendedSessionRecordWithChildren, except `traces` allows the + + StubTraceRecord placeholder produced by create_tree_for_extended_read_session + + for spans whose TraceRecord hasn''t arrived yet. Defined independently of + + ExtendedSessionRecordWithChildren/RecordWithChildTraces rather than + + subclassing them, since widening their Sequence[ExtendedTraceRecordWithChildren] + + field to also allow StubTraceRecord in a subclass is an LSP violation mypy + + correctly rejects.' + ExtendedRetrieverSpanRecord: + properties: type: type: string const: retriever @@ -25685,91 +25747,57 @@ components: - project_id - run_id - parent_id - title: ExtendedRetrieverSpanRecordWithChildren - ExtendedSessionRecord: + title: ExtendedRetrieverSpanRecord + ExtendedRetrieverSpanRecordWithChildren: properties: + spans: + items: + oneOf: + - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord' + - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedControlSpanRecord' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + control: '#/components/schemas/ExtendedControlSpanRecord' + llm: '#/components/schemas/ExtendedLlmSpanRecord' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + type: array + title: Spans type: type: string - const: session + const: retriever title: Type description: Type of the trace, span or session. - default: session + default: retriever input: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array + type: string title: Input + description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - - type: 'null' + items: + $ref: '#/components/schemas/Document' + type: array title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: $ref: '#/components/schemas/Document' type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -25833,14 +25861,13 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session + description: Galileo ID of the session, trace or span session_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: Session ID - description: Galileo ID of the session containing the trace or span or session + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) trace_id: anyOf: - type: string @@ -26005,30 +26032,32 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - previous_session_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Previous Session Id - num_traces: + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - type: 'null' - title: Num Traces + title: Step Number + description: Topological step number of the span. type: object required: - id + - session_id - project_id - run_id - title: ExtendedSessionRecord - ExtendedSessionRecordWithChildren: + - parent_id + title: ExtendedRetrieverSpanRecordWithChildren + ExtendedSessionRecord: properties: - traces: - items: - $ref: '#/components/schemas/ExtendedTraceRecordWithChildren' - type: array - title: Traces type: type: string const: session @@ -26362,7 +26391,7 @@ components: - id - project_id - run_id - title: ExtendedSessionRecordWithChildren + title: ExtendedSessionRecord ExtendedToolSpanRecord: properties: type: @@ -31385,13 +31414,13 @@ components: - columns: - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Input to the trace or span. @@ -31406,13 +31435,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Output of the trace or span. @@ -31427,13 +31456,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Name of the trace, span or session. @@ -31448,13 +31477,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: timestamp description: Timestamp of the trace or span's creation. @@ -31469,12 +31498,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: string_list description: Tags associated with this trace or span. @@ -31489,12 +31518,12 @@ components: sortable: false - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: integer description: Status code of the trace or span. Used for logging failure @@ -31510,13 +31539,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: A user-provided session, trace or span ID. @@ -31531,12 +31560,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Input to the dataset associated with this trace @@ -31551,12 +31580,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Output from the dataset associated with this trace @@ -31571,13 +31600,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: uuid description: Galileo ID of the session, trace or span @@ -31592,12 +31621,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: uuid description: Galileo ID of the session containing the trace (or the @@ -31613,12 +31642,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: uuid description: Galileo ID of the project associated with this trace or @@ -31634,12 +31663,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: uuid description: Galileo ID of the run (log stream or experiment) associated @@ -31655,12 +31684,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: timestamp description: Timestamp of the session or trace or span's last update @@ -31675,12 +31704,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: boolean description: Whether or not this trace or span has child spans @@ -31695,13 +31724,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Runner progress text written directly to CH span @@ -31716,13 +31745,13 @@ components: sortable: true - applicable_types: - trace + - tool + - agent - session + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Runner error text written directly to CH span @@ -31737,12 +31766,12 @@ components: sortable: true - applicable_types: - trace + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: boolean description: Whether the parent trace is complete or not @@ -31757,20 +31786,20 @@ components: sortable: true - allowed_values: - trace - - control + - tool + - agent + - llm - session + - control - workflow - - llm - retriever + applicable_types: - tool - agent - applicable_types: + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: text description: Type of the trace, span or session. @@ -31784,12 +31813,12 @@ components: multi_valued: false sortable: true - applicable_types: + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: uuid description: Galileo ID of the trace containing the span (or the same @@ -31804,12 +31833,12 @@ components: multi_valued: false sortable: true - applicable_types: + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: uuid description: Galileo ID of the parent of this span @@ -31823,12 +31852,12 @@ components: multi_valued: false sortable: true - applicable_types: + - tool + - agent + - llm - control - workflow - - llm - retriever - - tool - - agent category: standard data_type: integer description: Topological step number of the span. @@ -31842,14 +31871,14 @@ components: multi_valued: false sortable: true - allowed_values: - - router + - reflection + - classifier - planner - - supervisor - default - - judge - - classifier - - reflection - react + - supervisor + - judge + - router applicable_types: - agent category: standard @@ -31864,6 +31893,21 @@ components: label: Agent Type multi_valued: false sortable: true + - applicable_types: + - control + - agent + category: standard + data_type: text + description: Normalized agent name associated with this control execution. + filter_type: text + filterable: true + group_label: Standard + id: agent_name + is_empty: false + is_optional: true + label: Agent Name + multi_valued: false + sortable: true - applicable_types: - llm category: standard @@ -31949,20 +31993,6 @@ components: label: Control Id multi_valued: false sortable: true - - applicable_types: - - control - category: standard - data_type: text - description: Normalized agent name associated with this control execution. - filter_type: text - filterable: true - group_label: Standard - id: agent_name - is_empty: false - is_optional: true - label: Agent Name - multi_valued: false - sortable: true - allowed_values: - pre - post @@ -31982,8 +32012,8 @@ components: multi_valued: false sortable: true - allowed_values: - - llm_call - tool_call + - llm_call applicable_types: - control category: standard @@ -32211,7 +32241,7 @@ components: ClickHouse query fallback. scorer_config: anyOf: - - $ref: '#/components/schemas/ScorerConfig' + - $ref: '#/components/schemas/RuntimeScorerConfig' - type: 'null' description: 'For metric columns only: Scorer config that produced the metric.' scorer_id: @@ -33012,7 +33042,7 @@ components: annotation_agreement: {} annotation_queue_ids: [] annotations: {} - created_at: '2026-07-27T17:32:35.940423Z' + created_at: '2026-08-06T02:08:46.149769Z' dataset_metadata: {} error_message: '' feedback_rating_info: {} @@ -33031,7 +33061,7 @@ components: annotation_agreement: {} annotation_queue_ids: [] annotations: {} - created_at: '2026-07-27T17:32:35.940567Z' + created_at: '2026-08-06T02:08:46.149917Z' dataset_metadata: {} error_message: '' feedback_rating_info: {} @@ -33311,7 +33341,7 @@ components: annotation_agreement: {} annotation_queue_ids: [] annotations: {} - created_at: '2026-07-27T17:32:35.934744Z' + created_at: '2026-08-06T02:08:46.143719Z' dataset_metadata: {} error_message: '' feedback_rating_info: {} @@ -33336,7 +33366,7 @@ components: annotation_agreement: {} annotation_queue_ids: [] annotations: {} - created_at: '2026-07-27T17:32:35.934923Z' + created_at: '2026-08-06T02:08:46.143895Z' dataset_metadata: {} error_message: '' feedback_rating_info: {} @@ -33669,14 +33699,14 @@ components: - log_stream_id: 00000000-0000-0000-0000-000000000000 parent_id: 11000011-0000-0000-0000-110000110000 spans: - - created_at: '2026-07-27T17:32:35.906225Z' + - created_at: '2026-08-06T02:08:46.115179Z' dataset_metadata: {} input: who is a smart LLM? metrics: {} name: '' output: I am! spans: - - created_at: '2026-07-27T17:32:35.892054Z' + - created_at: '2026-08-06T02:08:46.099803Z' dataset_metadata: {} id: 22222222-2222-4222-a222-222222222222 input: @@ -34323,14 +34353,14 @@ components: - log_stream_id: 00000000-0000-0000-0000-000000000000 session_id: 00000000-0000-0000-0000-000000000000 traces: - - created_at: '2026-07-27T17:32:35.886726Z' + - created_at: '2026-08-06T02:08:46.093635Z' dataset_metadata: {} input: who is a smart LLM? metrics: {} name: '' output: I am! spans: - - created_at: '2026-07-27T17:32:35.886684Z' + - created_at: '2026-08-06T02:08:46.093595Z' dataset_metadata: {} input: - content: 'Question: who is a smart LLM?' @@ -34348,14 +34378,14 @@ components: user_metadata: {} - experiment_id: 00000000-0000-0000-0000-000000000000 traces: - - created_at: '2026-07-27T17:32:35.887211Z' + - created_at: '2026-08-06T02:08:46.094018Z' dataset_metadata: {} input: who is a smart LLM? metrics: {} name: '' output: I am! spans: - - created_at: '2026-07-27T17:32:35.887172Z' + - created_at: '2026-08-06T02:08:46.093981Z' dataset_metadata: {} id: 11111111-1111-4111-a111-111111111111 input: @@ -35159,6 +35189,18 @@ components: type: string title: Message default: Metric not computed. + ems_error_code: + anyOf: + - type: integer + - type: 'null' + title: Ems Error Code + description: EMS error code from errors.yaml catalog for this not-computed + reason + standard_error: + anyOf: + - $ref: '#/components/schemas/StandardError' + - type: 'null' + description: Structured EMS error resolved on-the-fly from errors.yaml catalog type: object title: MetricNotComputed MetricPending: @@ -35342,7 +35384,7 @@ components: scorers: anyOf: - items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array - type: 'null' title: Scorers @@ -35361,7 +35403,7 @@ components: properties: scorers: items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array title: Scorers segment_filters: @@ -35729,6 +35771,26 @@ components: integration: $ref: '#/components/schemas/LLMIntegration' default: openai + lifecycle_state: + $ref: '#/components/schemas/ModelLifecycleState' + default: active + replacement_alias: + anyOf: + - type: string + - type: 'null' + title: Replacement Alias + deprecation_date: + anyOf: + - type: string + format: date + - type: 'null' + title: Deprecation Date + retirement_date: + anyOf: + - type: string + format: date + - type: 'null' + title: Retirement Date user_role: anyOf: - type: string @@ -35829,6 +35891,13 @@ components: - tokens - characters title: ModelCostBy + ModelLifecycleState: + type: string + enum: + - active + - deprecated + - retired + title: ModelLifecycleState ModelType: type: string enum: @@ -36679,6 +36748,12 @@ components: $ref: '#/components/schemas/AgentType' description: Agent type. default: default + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Name of the agent. type: object title: PartialExtendedAgentSpanRecord PartialExtendedControlSpanRecord: @@ -39672,8 +39747,6 @@ components: ProjectType: type: string enum: - - prompt_evaluation - - llm_monitor - protect - gen_ai title: ProjectType @@ -41403,7 +41476,7 @@ components: scorers: anyOf: - items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array - type: 'null' title: Scorers @@ -41429,7 +41502,7 @@ components: properties: scorers: items: - $ref: '#/components/schemas/ScorerConfig' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array title: Scorers segment_filters: @@ -41518,84 +41591,18 @@ components: - created_at - updated_at title: RunTagDB - ScoreAggregate: + RuntimeScorerConfig: properties: - feedback_type: - type: string - const: score - title: Feedback Type - default: score - average: - type: number - title: Average - unrated_count: - type: integer - title: Unrated Count - type: object - required: - - average - - unrated_count - title: ScoreAggregate - ScoreBucket: - properties: - min_inclusive: - type: integer - title: Min Inclusive - max_exclusive: - anyOf: - - type: integer - - type: 'null' - title: Max Exclusive - count: - type: integer - title: Count - type: object - required: - - min_inclusive - - max_exclusive - - count - title: ScoreBucket - ScoreConstraints: - properties: - annotation_type: + id: type: string - const: score - title: Annotation Type - min: - type: integer - minimum: 0.0 - title: Min - max: - type: integer - minimum: 0.0 - title: Max - type: object - required: - - annotation_type - - min - - max - title: ScoreConstraints - ScorerAction: - type: string - enum: - - update - - delete - - share - - export - - autotune_apply - title: ScorerAction - ScorerConfig: - properties: - model_name: + format: uuid4 + title: Id + scorer_version_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Model Name - num_judges: - anyOf: - - type: integer - - type: 'null' - title: Num Judges + title: Scorer Version Id filters: anyOf: - items: @@ -41613,6 +41620,35 @@ components: - type: 'null' title: Filters description: List of filters to apply to the scorer. + roll_up_method: + anyOf: + - $ref: '#/components/schemas/RollUpMethodDisplayOptions' + - type: 'null' + name: + anyOf: + - type: string + - type: 'null' + title: Name + scorer_type: + anyOf: + - $ref: '#/components/schemas/ScorerTypes' + - type: 'null' + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + num_judges: + anyOf: + - type: integer + - type: 'null' + title: Num Judges + scorer_version: + anyOf: + - $ref: '#/components/schemas/BaseScorerVersionDB' + - type: 'null' + description: ScorerVersion to use for this scorer. If not provided, the + latest version will be used. scoreable_node_types: anyOf: - items: @@ -41641,29 +41677,6 @@ components: - type: 'null' description: What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). - id: - type: string - format: uuid4 - title: Id - name: - anyOf: - - type: string - - type: 'null' - title: Name - scorer_type: - $ref: '#/components/schemas/ScorerTypes' - model_type: - anyOf: - - $ref: '#/components/schemas/ModelType' - - type: 'null' - description: Type of model to use for this scorer. slm maps to luna, and - llm maps to plus - scorer_version: - anyOf: - - $ref: '#/components/schemas/BaseScorerVersionDB' - - type: 'null' - description: ScorerVersion to use for this scorer. If not provided, the - latest version will be used. multimodal_capabilities: anyOf: - items: @@ -41673,9 +41686,9 @@ components: title: Multimodal Capabilities description: Multimodal capabilities which this scorer can utilize in its evaluation. - roll_up_method: + roll_up_config: anyOf: - - $ref: '#/components/schemas/RollUpMethodDisplayOptions' + - $ref: '#/components/schemas/BaseMetricRollUpConfigDB' - type: 'null' score_type: anyOf: @@ -41687,9 +41700,77 @@ components: type: object required: - id - - scorer_type - title: ScorerConfig - description: Used for configuring a scorer for a scorer job. + title: RuntimeScorerConfig + description: 'Hydrated scorer config used at runtime. Never persisted directly. + + + Produced by hydrate_scorer_config from a StoredScorerConfig + live DB rows.' + ScoreAggregate: + properties: + feedback_type: + type: string + const: score + title: Feedback Type + default: score + average: + type: number + title: Average + unrated_count: + type: integer + title: Unrated Count + type: object + required: + - average + - unrated_count + title: ScoreAggregate + ScoreBucket: + properties: + min_inclusive: + type: integer + title: Min Inclusive + max_exclusive: + anyOf: + - type: integer + - type: 'null' + title: Max Exclusive + count: + type: integer + title: Count + type: object + required: + - min_inclusive + - max_exclusive + - count + title: ScoreBucket + ScoreConstraints: + properties: + annotation_type: + type: string + const: score + title: Annotation Type + min: + type: integer + minimum: 0.0 + title: Min + max: + type: integer + minimum: 0.0 + title: Max + type: object + required: + - annotation_type + - min + - max + title: ScoreConstraints + ScorerAction: + type: string + enum: + - update + - delete + - share + - export + - autotune_apply + title: ScorerAction ScorerCreatedAtFilter: properties: name: @@ -41806,6 +41887,12 @@ components: - type: 'null' description: What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). + invocation: + anyOf: + - $ref: '#/components/schemas/ScorerInvocationConfig' + - type: 'null' + description: Deprecated compatibility location for direct-invocation metadata. + Use ScorerInfo.invocation or BaseScorerDB.invocation instead. type: object title: ScorerDefaults ScorerEnabledInPlaygroundSort: @@ -41926,6 +42013,32 @@ components: required: - value title: ScorerIDFilter + ScorerInvocationConfig: + properties: + required_inputs: + items: + type: string + enum: + - query + - response + type: array + uniqueItems: true + title: Required Inputs + payload_format: + $ref: '#/components/schemas/ScorerInvocationPayloadFormat' + type: object + required: + - payload_format + title: ScorerInvocationConfig + description: How the direct scorer-invoke API validates and serializes inputs. + ScorerInvocationPayloadFormat: + type: string + enum: + - query + - response + - pairwise + - node_input_output + title: ScorerInvocationPayloadFormat ScorerIsGlobalFilter: properties: name: @@ -42064,7 +42177,13 @@ components: Use ``one_of`` to match scorers whose capabilities include ANY of the given values (e.g. ``{"name": "multimodal_capabilities", "operator": "one_of", "value": - ["vision", "audio"]}``).' + ["vision", "audio"]}``). + + ``text`` is a filter-only value supplied in the ``one_of`` list + + (e.g. ``{"operator": "one_of", "value": ["text"]}``) that matches scorers + + with no multimodal capabilities.' ScorerNameFilter: properties: name: @@ -42130,12 +42249,24 @@ components: name: type: string title: Name + label: + anyOf: + - type: string + - type: 'null' + title: Label + default: '' scorer_type: $ref: '#/components/schemas/ScorerTypes' defaults: anyOf: - $ref: '#/components/schemas/ScorerDefaults' - type: 'null' + invocation: + anyOf: + - $ref: '#/components/schemas/ScorerInvocationConfig' + - type: 'null' + description: Intrinsic metadata for invoking this scorer directly with query + and response inputs. latest_version: anyOf: - $ref: '#/components/schemas/BaseScorerVersionDB' @@ -42213,12 +42344,6 @@ components: anyOf: - $ref: '#/components/schemas/BaseMetricRollUpConfigDB' - type: 'null' - label: - anyOf: - - type: string - - type: 'null' - title: Label - default: '' tags: items: type: string @@ -43272,10 +43397,17 @@ components: title: Session Id description: Session ID inferred from child spans, if all agree; otherwise None. + created_at: + type: string + format: date-time + title: Created At + description: Earliest created_at among child spans; used to order under + a session. additionalProperties: false type: object required: - id + - created_at title: StubTraceRecord description: 'Placeholder for a trace referenced by spans but not yet ingested. @@ -43552,9 +43684,6 @@ components: TaskType: type: integer enum: - - 7 - - 9 - - 12 - 13 - 15 - 16 @@ -45965,6 +46094,26 @@ components: $ref: '#/components/schemas/ContentModality' type: array title: Input Modalities + lifecycle_state: + $ref: '#/components/schemas/ModelLifecycleState' + default: active + replacement_alias: + anyOf: + - type: string + - type: 'null' + title: Replacement Alias + deprecation_date: + anyOf: + - type: string + format: date + - type: 'null' + title: Deprecation Date + retirement_date: + anyOf: + - type: string + format: date + - type: 'null' + title: Retirement Date multimodal_capabilities: items: $ref: '#/components/schemas/MultimodalCapability' @@ -46130,6 +46279,8 @@ components: - action_completion_vision - agent_efficiency - agent_flow + - agent_flow_audio + - agent_flow_vision - agentic_session_success - agentic_workflow_success - chunk_attribution_utilization @@ -46146,6 +46297,8 @@ components: - context_relevance - context_relevance_luna - conversation_quality + - conversation_quality_audio + - conversation_quality_vision - correctness - correctness_audio - correctness_vision @@ -46155,7 +46308,9 @@ components: - input_pii - input_pii_gpt - input_sexist + - input_sexist_audio - input_sexist_luna + - input_sexist_vision - input_tone - input_tone_gpt - input_toxicity @@ -46163,11 +46318,15 @@ components: - input_toxicity_luna - input_toxicity_vision - instruction_adherence + - instruction_adherence_audio + - instruction_adherence_vision - interruption_detection - output_pii - output_pii_gpt - output_sexist + - output_sexist_audio - output_sexist_luna + - output_sexist_vision - output_tone - output_tone_gpt - output_toxicity @@ -46176,7 +46335,9 @@ components: - output_toxicity_vision - precision_at_k - prompt_injection + - prompt_injection_audio - prompt_injection_luna + - prompt_injection_vision - reasoning_coherence - reasoning_coherence_audio - reasoning_coherence_vision @@ -46187,7 +46348,9 @@ components: - tool_error_rate - tool_error_rate_luna - tool_selection_quality + - tool_selection_quality_audio - tool_selection_quality_luna + - tool_selection_quality_vision - user_intent_change - user_intent_change_audio - user_intent_change_vision diff --git a/src/splunk_ao/resources/api/data/create_luna_scorer_version_scorers_scorer_id_version_luna_post.py b/src/splunk_ao/resources/api/data/create_luna_scorer_version_scorers_scorer_id_version_luna_post.py index 3b8f22bd..656b8b98 100644 --- a/src/splunk_ao/resources/api/data/create_luna_scorer_version_scorers_scorer_id_version_luna_post.py +++ b/src/splunk_ao/resources/api/data/create_luna_scorer_version_scorers_scorer_id_version_luna_post.py @@ -87,6 +87,16 @@ def sync_detailed( ) -> Response[BaseScorerVersionResponse | HTTPValidationError]: """Create Luna Scorer Version + Create a new custom Luna scorer version for the given scorer. + + Args: + create_luna_scorer_version_request: LoRA/fine-tuning parameters for the new version. + scorer: The Luna scorer to create a new version for. + ctx: Async request context with the authenticated user and read session. + + Returns: + The newly created scorer version. + Args: scorer_id (str): body (CreateCustomLunaScorerVersionRequest): @@ -111,6 +121,16 @@ def sync( ) -> Optional[BaseScorerVersionResponse | HTTPValidationError]: """Create Luna Scorer Version + Create a new custom Luna scorer version for the given scorer. + + Args: + create_luna_scorer_version_request: LoRA/fine-tuning parameters for the new version. + scorer: The Luna scorer to create a new version for. + ctx: Async request context with the authenticated user and read session. + + Returns: + The newly created scorer version. + Args: scorer_id (str): body (CreateCustomLunaScorerVersionRequest): @@ -131,6 +151,16 @@ async def asyncio_detailed( ) -> Response[BaseScorerVersionResponse | HTTPValidationError]: """Create Luna Scorer Version + Create a new custom Luna scorer version for the given scorer. + + Args: + create_luna_scorer_version_request: LoRA/fine-tuning parameters for the new version. + scorer: The Luna scorer to create a new version for. + ctx: Async request context with the authenticated user and read session. + + Returns: + The newly created scorer version. + Args: scorer_id (str): body (CreateCustomLunaScorerVersionRequest): @@ -155,6 +185,16 @@ async def asyncio( ) -> Optional[BaseScorerVersionResponse | HTTPValidationError]: """Create Luna Scorer Version + Create a new custom Luna scorer version for the given scorer. + + Args: + create_luna_scorer_version_request: LoRA/fine-tuning parameters for the new version. + scorer: The Luna scorer to create a new version for. + ctx: Async request context with the authenticated user and read session. + + Returns: + The newly created scorer version. + Args: scorer_id (str): body (CreateCustomLunaScorerVersionRequest): diff --git a/src/splunk_ao/resources/api/data/manual_llm_validate_multipart_scorers_llm_validate_multipart_post.py b/src/splunk_ao/resources/api/data/manual_llm_validate_multipart_scorers_llm_validate_multipart_post.py index 1a054c8d..f03a23c9 100644 --- a/src/splunk_ao/resources/api/data/manual_llm_validate_multipart_scorers_llm_validate_multipart_post.py +++ b/src/splunk_ao/resources/api/data/manual_llm_validate_multipart_scorers_llm_validate_multipart_post.py @@ -89,6 +89,17 @@ def sync_detailed( ) -> Response[GeneratedScorerValidationResponse | HTTPValidationError]: """Manual Llm Validate Multipart + Validate an LLM scorer manually, with optional query/response file uploads. + + Args: + body: JSON-encoded GeneratedScorerValidationRequest. + query_files: Optional files attached to the query side of the validation. + response_files: Optional files attached to the response side of the validation. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Args: body (BodyManualLlmValidateMultipartScorersLlmValidateMultipartPost): @@ -112,6 +123,17 @@ def sync( ) -> Optional[GeneratedScorerValidationResponse | HTTPValidationError]: """Manual Llm Validate Multipart + Validate an LLM scorer manually, with optional query/response file uploads. + + Args: + body: JSON-encoded GeneratedScorerValidationRequest. + query_files: Optional files attached to the query side of the validation. + response_files: Optional files attached to the response side of the validation. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Args: body (BodyManualLlmValidateMultipartScorersLlmValidateMultipartPost): @@ -131,6 +153,17 @@ async def asyncio_detailed( ) -> Response[GeneratedScorerValidationResponse | HTTPValidationError]: """Manual Llm Validate Multipart + Validate an LLM scorer manually, with optional query/response file uploads. + + Args: + body: JSON-encoded GeneratedScorerValidationRequest. + query_files: Optional files attached to the query side of the validation. + response_files: Optional files attached to the response side of the validation. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Args: body (BodyManualLlmValidateMultipartScorersLlmValidateMultipartPost): @@ -154,6 +187,17 @@ async def asyncio( ) -> Optional[GeneratedScorerValidationResponse | HTTPValidationError]: """Manual Llm Validate Multipart + Validate an LLM scorer manually, with optional query/response file uploads. + + Args: + body: JSON-encoded GeneratedScorerValidationRequest. + query_files: Optional files attached to the query side of the validation. + response_files: Optional files attached to the response side of the validation. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Args: body (BodyManualLlmValidateMultipartScorersLlmValidateMultipartPost): diff --git a/src/splunk_ao/resources/api/data/manual_llm_validate_scorers_llm_validate_post.py b/src/splunk_ao/resources/api/data/manual_llm_validate_scorers_llm_validate_post.py index 60aa2930..914f9d07 100644 --- a/src/splunk_ao/resources/api/data/manual_llm_validate_scorers_llm_validate_post.py +++ b/src/splunk_ao/resources/api/data/manual_llm_validate_scorers_llm_validate_post.py @@ -72,6 +72,15 @@ def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[ def sync_detailed(*, client: ApiClient) -> Response[GeneratedScorerValidationResponse]: """Manual Llm Validate + Validate an LLM scorer manually, with query/response passed inline (no file uploads). + + Args: + request: Raw request; body is parsed into a GeneratedScorerValidationRequest. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -90,6 +99,15 @@ def sync_detailed(*, client: ApiClient) -> Response[GeneratedScorerValidationRes def sync(*, client: ApiClient) -> Optional[GeneratedScorerValidationResponse]: """Manual Llm Validate + Validate an LLM scorer manually, with query/response passed inline (no file uploads). + + Args: + request: Raw request; body is parsed into a GeneratedScorerValidationRequest. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -104,6 +122,15 @@ def sync(*, client: ApiClient) -> Optional[GeneratedScorerValidationResponse]: async def asyncio_detailed(*, client: ApiClient) -> Response[GeneratedScorerValidationResponse]: """Manual Llm Validate + Validate an LLM scorer manually, with query/response passed inline (no file uploads). + + Args: + request: Raw request; body is parsed into a GeneratedScorerValidationRequest. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -122,6 +149,15 @@ async def asyncio_detailed(*, client: ApiClient) -> Response[GeneratedScorerVali async def asyncio(*, client: ApiClient) -> Optional[GeneratedScorerValidationResponse]: """Manual Llm Validate + Validate an LLM scorer manually, with query/response passed inline (no file uploads). + + Args: + request: Raw request; body is parsed into a GeneratedScorerValidationRequest. + ctx: Async request context with the authenticated user and read session. + + Returns: + A pending task result the caller can poll for validation results. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py b/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py index 057ac8c6..66c7584e 100644 --- a/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py +++ b/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py @@ -17,7 +17,7 @@ from splunk_ao.utils.headers_data import get_sdk_header from ... import errors -from ...models.extended_session_record_with_children import ExtendedSessionRecordWithChildren +from ...models.extended_read_session_record_with_children import ExtendedReadSessionRecordWithChildren from ...models.http_validation_error import HTTPValidationError from ...types import UNSET, Response, Unset @@ -46,9 +46,9 @@ def _get_kwargs(project_id: str, session_id: str, *, include_presigned_urls: boo def _parse_response( *, client: ApiClient, response: httpx.Response -) -> ExtendedSessionRecordWithChildren | HTTPValidationError: +) -> ExtendedReadSessionRecordWithChildren | HTTPValidationError: if response.status_code == 200: - response_200 = ExtendedSessionRecordWithChildren.from_dict(response.json()) + response_200 = ExtendedReadSessionRecordWithChildren.from_dict(response.json()) return response_200 @@ -77,7 +77,7 @@ def _parse_response( def _build_response( *, client: ApiClient, response: httpx.Response -) -> Response[ExtendedSessionRecordWithChildren | HTTPValidationError]: +) -> Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,7 +88,7 @@ def _build_response( def sync_detailed( project_id: str, session_id: str, *, client: ApiClient, include_presigned_urls: bool | Unset = False -) -> Response[ExtendedSessionRecordWithChildren | HTTPValidationError]: +) -> Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: """Get Session Args: @@ -101,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExtendedSessionRecordWithChildren | HTTPValidationError] + Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, session_id=session_id, include_presigned_urls=include_presigned_urls) @@ -113,7 +113,7 @@ def sync_detailed( def sync( project_id: str, session_id: str, *, client: ApiClient, include_presigned_urls: bool | Unset = False -) -> Optional[ExtendedSessionRecordWithChildren | HTTPValidationError]: +) -> Optional[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: """Get Session Args: @@ -126,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExtendedSessionRecordWithChildren | HTTPValidationError + ExtendedReadSessionRecordWithChildren | HTTPValidationError """ return sync_detailed( @@ -136,7 +136,7 @@ def sync( async def asyncio_detailed( project_id: str, session_id: str, *, client: ApiClient, include_presigned_urls: bool | Unset = False -) -> Response[ExtendedSessionRecordWithChildren | HTTPValidationError]: +) -> Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: """Get Session Args: @@ -149,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExtendedSessionRecordWithChildren | HTTPValidationError] + Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, session_id=session_id, include_presigned_urls=include_presigned_urls) @@ -161,7 +161,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, session_id: str, *, client: ApiClient, include_presigned_urls: bool | Unset = False -) -> Optional[ExtendedSessionRecordWithChildren | HTTPValidationError]: +) -> Optional[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: """Get Session Args: @@ -174,7 +174,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExtendedSessionRecordWithChildren | HTTPValidationError + ExtendedReadSessionRecordWithChildren | HTTPValidationError """ return ( diff --git a/src/splunk_ao/resources/models/__init__.py b/src/splunk_ao/resources/models/__init__.py index d43d4175..ef9999c9 100644 --- a/src/splunk_ao/resources/models/__init__.py +++ b/src/splunk_ao/resources/models/__init__.py @@ -529,6 +529,28 @@ from .extended_llm_span_record_metric_info_type_0 import ExtendedLlmSpanRecordMetricInfoType0 from .extended_llm_span_record_tools_type_0_item import ExtendedLlmSpanRecordToolsType0Item from .extended_llm_span_record_user_metadata import ExtendedLlmSpanRecordUserMetadata +from .extended_read_session_record_with_children import ExtendedReadSessionRecordWithChildren +from .extended_read_session_record_with_children_annotation_aggregates import ( + ExtendedReadSessionRecordWithChildrenAnnotationAggregates, +) +from .extended_read_session_record_with_children_annotation_agreement import ( + ExtendedReadSessionRecordWithChildrenAnnotationAgreement, +) +from .extended_read_session_record_with_children_annotations import ExtendedReadSessionRecordWithChildrenAnnotations +from .extended_read_session_record_with_children_annotations_additional_property import ( + ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty, +) +from .extended_read_session_record_with_children_dataset_metadata import ( + ExtendedReadSessionRecordWithChildrenDatasetMetadata, +) +from .extended_read_session_record_with_children_feedback_rating_info import ( + ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo, +) +from .extended_read_session_record_with_children_files_type_0 import ExtendedReadSessionRecordWithChildrenFilesType0 +from .extended_read_session_record_with_children_metric_info_type_0 import ( + ExtendedReadSessionRecordWithChildrenMetricInfoType0, +) +from .extended_read_session_record_with_children_user_metadata import ExtendedReadSessionRecordWithChildrenUserMetadata from .extended_retriever_span_record import ExtendedRetrieverSpanRecord from .extended_retriever_span_record_annotation_aggregates import ExtendedRetrieverSpanRecordAnnotationAggregates from .extended_retriever_span_record_annotation_agreement import ExtendedRetrieverSpanRecordAnnotationAgreement @@ -575,24 +597,6 @@ from .extended_session_record_files_type_0 import ExtendedSessionRecordFilesType0 from .extended_session_record_metric_info_type_0 import ExtendedSessionRecordMetricInfoType0 from .extended_session_record_user_metadata import ExtendedSessionRecordUserMetadata -from .extended_session_record_with_children import ExtendedSessionRecordWithChildren -from .extended_session_record_with_children_annotation_aggregates import ( - ExtendedSessionRecordWithChildrenAnnotationAggregates, -) -from .extended_session_record_with_children_annotation_agreement import ( - ExtendedSessionRecordWithChildrenAnnotationAgreement, -) -from .extended_session_record_with_children_annotations import ExtendedSessionRecordWithChildrenAnnotations -from .extended_session_record_with_children_annotations_additional_property import ( - ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty, -) -from .extended_session_record_with_children_dataset_metadata import ExtendedSessionRecordWithChildrenDatasetMetadata -from .extended_session_record_with_children_feedback_rating_info import ( - ExtendedSessionRecordWithChildrenFeedbackRatingInfo, -) -from .extended_session_record_with_children_files_type_0 import ExtendedSessionRecordWithChildrenFilesType0 -from .extended_session_record_with_children_metric_info_type_0 import ExtendedSessionRecordWithChildrenMetricInfoType0 -from .extended_session_record_with_children_user_metadata import ExtendedSessionRecordWithChildrenUserMetadata from .extended_tool_span_record import ExtendedToolSpanRecord from .extended_tool_span_record_annotation_aggregates import ExtendedToolSpanRecordAnnotationAggregates from .extended_tool_span_record_annotation_agreement import ExtendedToolSpanRecordAnnotationAgreement @@ -917,6 +921,7 @@ from .modality_filter_operator import ModalityFilterOperator from .model import Model from .model_cost_by import ModelCostBy +from .model_lifecycle_state import ModelLifecycleState from .model_properties import ModelProperties from .model_type import ModelType from .multi_modal_model_integration_config import MultiModalModelIntegrationConfig @@ -1181,12 +1186,12 @@ from .run_updated_at_filter import RunUpdatedAtFilter from .run_updated_at_filter_operator import RunUpdatedAtFilterOperator from .run_updated_at_sort import RunUpdatedAtSort +from .runtime_scorer_config import RuntimeScorerConfig from .score_aggregate import ScoreAggregate from .score_bucket import ScoreBucket from .score_constraints import ScoreConstraints from .score_rating import ScoreRating from .scorer_action import ScorerAction -from .scorer_config import ScorerConfig from .scorer_created_at_filter import ScorerCreatedAtFilter from .scorer_created_at_filter_operator import ScorerCreatedAtFilterOperator from .scorer_creator_filter import ScorerCreatorFilter @@ -1199,6 +1204,9 @@ from .scorer_health_scores_response import ScorerHealthScoresResponse from .scorer_id_filter import ScorerIDFilter from .scorer_id_filter_operator import ScorerIDFilterOperator +from .scorer_invocation_config import ScorerInvocationConfig +from .scorer_invocation_config_required_inputs_item import ScorerInvocationConfigRequiredInputsItem +from .scorer_invocation_payload_format import ScorerInvocationPayloadFormat from .scorer_is_global_filter import ScorerIsGlobalFilter from .scorer_is_global_filter_operator import ScorerIsGlobalFilterOperator from .scorer_label_filter import ScorerLabelFilter @@ -1761,6 +1769,16 @@ "ExtendedLlmSpanRecordMetricInfoType0", "ExtendedLlmSpanRecordToolsType0Item", "ExtendedLlmSpanRecordUserMetadata", + "ExtendedReadSessionRecordWithChildren", + "ExtendedReadSessionRecordWithChildrenAnnotationAggregates", + "ExtendedReadSessionRecordWithChildrenAnnotationAgreement", + "ExtendedReadSessionRecordWithChildrenAnnotations", + "ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty", + "ExtendedReadSessionRecordWithChildrenDatasetMetadata", + "ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo", + "ExtendedReadSessionRecordWithChildrenFilesType0", + "ExtendedReadSessionRecordWithChildrenMetricInfoType0", + "ExtendedReadSessionRecordWithChildrenUserMetadata", "ExtendedRetrieverSpanRecord", "ExtendedRetrieverSpanRecordAnnotationAggregates", "ExtendedRetrieverSpanRecordAnnotationAgreement", @@ -1791,16 +1809,6 @@ "ExtendedSessionRecordFilesType0", "ExtendedSessionRecordMetricInfoType0", "ExtendedSessionRecordUserMetadata", - "ExtendedSessionRecordWithChildren", - "ExtendedSessionRecordWithChildrenAnnotationAggregates", - "ExtendedSessionRecordWithChildrenAnnotationAgreement", - "ExtendedSessionRecordWithChildrenAnnotations", - "ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty", - "ExtendedSessionRecordWithChildrenDatasetMetadata", - "ExtendedSessionRecordWithChildrenFeedbackRatingInfo", - "ExtendedSessionRecordWithChildrenFilesType0", - "ExtendedSessionRecordWithChildrenMetricInfoType0", - "ExtendedSessionRecordWithChildrenUserMetadata", "ExtendedToolSpanRecord", "ExtendedToolSpanRecordAnnotationAggregates", "ExtendedToolSpanRecordAnnotationAgreement", @@ -2083,6 +2091,7 @@ "ModalityFilterOperator", "Model", "ModelCostBy", + "ModelLifecycleState", "ModelProperties", "ModelType", "MultimodalCapability", @@ -2306,6 +2315,7 @@ "RunScorerSettingsResponse", "RunTagCreateRequest", "RunTagDB", + "RuntimeScorerConfig", "RunUpdatedAtFilter", "RunUpdatedAtFilterOperator", "RunUpdatedAtSort", @@ -2314,7 +2324,6 @@ "ScoreConstraints", "ScorerAction", "ScoreRating", - "ScorerConfig", "ScorerCreatedAtFilter", "ScorerCreatedAtFilterOperator", "ScorerCreatorFilter", @@ -2327,6 +2336,9 @@ "ScorerHealthScoresResponse", "ScorerIDFilter", "ScorerIDFilterOperator", + "ScorerInvocationConfig", + "ScorerInvocationConfigRequiredInputsItem", + "ScorerInvocationPayloadFormat", "ScorerIsGlobalFilter", "ScorerIsGlobalFilterOperator", "ScorerLabelFilter", diff --git a/src/splunk_ao/resources/models/agent_span.py b/src/splunk_ao/resources/models/agent_span.py index a210089a..794705ba 100644 --- a/src/splunk_ao/resources/models/agent_span.py +++ b/src/splunk_ao/resources/models/agent_span.py @@ -59,6 +59,7 @@ class AgentSpan: parent_id (None | str | Unset): Galileo ID of the parent of this span spans (list[AgentSpan | ControlSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset): Child spans. agent_type (AgentType | Unset): + agent_name (None | str | Unset): Name of the agent. """ type_: Literal["agent"] | Unset = "agent" @@ -87,6 +88,7 @@ class AgentSpan: parent_id: None | str | Unset = UNSET spans: list[AgentSpan | ControlSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = UNSET agent_type: AgentType | Unset = UNSET + agent_name: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -300,6 +302,12 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.agent_type, Unset): agent_type = self.agent_type.value + agent_name: None | str | Unset + if isinstance(self.agent_name, Unset): + agent_name = UNSET + else: + agent_name = self.agent_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -347,6 +355,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["spans"] = spans if agent_type is not UNSET: field_dict["agent_type"] = agent_type + if agent_name is not UNSET: + field_dict["agent_name"] = agent_name return field_dict @@ -796,6 +806,15 @@ def _parse_spans_item( else: agent_type = AgentType(_agent_type) + def _parse_agent_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) + agent_span = cls( type_=type_, input_=input_, @@ -819,6 +838,7 @@ def _parse_spans_item( parent_id=parent_id, spans=spans, agent_type=agent_type, + agent_name=agent_name, ) agent_span.additional_properties = d diff --git a/src/splunk_ao/resources/models/base_scorer_version_db.py b/src/splunk_ao/resources/models/base_scorer_version_db.py index 9ab20ebe..992126b0 100644 --- a/src/splunk_ao/resources/models/base_scorer_version_db.py +++ b/src/splunk_ao/resources/models/base_scorer_version_db.py @@ -6,8 +6,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.input_type_enum import InputTypeEnum -from ..models.output_type_enum import OutputTypeEnum from ..types import UNSET, Unset if TYPE_CHECKING: @@ -32,14 +30,8 @@ class BaseScorerVersionDB: finetuned_scorer (BaseFinetunedScorerDB | None | Unset): model_name (None | str | Unset): num_judges (int | None | Unset): - scoreable_node_types (list[str] | None | Unset): List of node types that can be scored by this scorer. Defaults - to llm/chat. cot_enabled (bool | None | Unset): Whether to enable chain of thought for this scorer. Defaults to False for llm scorers. - output_type (None | OutputTypeEnum | Unset): What type of output to use for model-based scorers - (sessions_normalized, trace_io_only, etc.). - input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers - (sessions_normalized, trace_io_only, etc.). """ id: str @@ -50,10 +42,7 @@ class BaseScorerVersionDB: finetuned_scorer: BaseFinetunedScorerDB | None | Unset = UNSET model_name: None | str | Unset = UNSET num_judges: int | None | Unset = UNSET - scoreable_node_types: list[str] | None | Unset = UNSET cot_enabled: bool | None | Unset = UNSET - output_type: None | OutputTypeEnum | Unset = UNSET - input_type: InputTypeEnum | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -103,37 +92,12 @@ def to_dict(self) -> dict[str, Any]: else: num_judges = self.num_judges - scoreable_node_types: list[str] | None | Unset - if isinstance(self.scoreable_node_types, Unset): - scoreable_node_types = UNSET - elif isinstance(self.scoreable_node_types, list): - scoreable_node_types = self.scoreable_node_types - - else: - scoreable_node_types = self.scoreable_node_types - cot_enabled: bool | None | Unset if isinstance(self.cot_enabled, Unset): cot_enabled = UNSET else: cot_enabled = self.cot_enabled - output_type: None | str | Unset - if isinstance(self.output_type, Unset): - output_type = UNSET - elif isinstance(self.output_type, OutputTypeEnum): - output_type = self.output_type.value - else: - output_type = self.output_type - - input_type: None | str | Unset - if isinstance(self.input_type, Unset): - input_type = UNSET - elif isinstance(self.input_type, InputTypeEnum): - input_type = self.input_type.value - else: - input_type = self.input_type - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"id": id, "version": version, "scorer_id": scorer_id}) @@ -147,14 +111,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["model_name"] = model_name if num_judges is not UNSET: field_dict["num_judges"] = num_judges - if scoreable_node_types is not UNSET: - field_dict["scoreable_node_types"] = scoreable_node_types if cot_enabled is not UNSET: field_dict["cot_enabled"] = cot_enabled - if output_type is not UNSET: - field_dict["output_type"] = output_type - if input_type is not UNSET: - field_dict["input_type"] = input_type return field_dict @@ -240,23 +198,6 @@ def _parse_num_judges(data: object) -> int | None | Unset: num_judges = _parse_num_judges(d.pop("num_judges", UNSET)) - def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - scoreable_node_types_type_0 = cast(list[str], data) - - return scoreable_node_types_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - scoreable_node_types = _parse_scoreable_node_types(d.pop("scoreable_node_types", UNSET)) - def _parse_cot_enabled(data: object) -> bool | None | Unset: if data is None: return data @@ -266,40 +207,6 @@ def _parse_cot_enabled(data: object) -> bool | None | Unset: cot_enabled = _parse_cot_enabled(d.pop("cot_enabled", UNSET)) - def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - output_type_type_0 = OutputTypeEnum(data) - - return output_type_type_0 - except: # noqa: E722 - pass - return cast(None | OutputTypeEnum | Unset, data) - - output_type = _parse_output_type(d.pop("output_type", UNSET)) - - def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - input_type_type_0 = InputTypeEnum(data) - - return input_type_type_0 - except: # noqa: E722 - pass - return cast(InputTypeEnum | None | Unset, data) - - input_type = _parse_input_type(d.pop("input_type", UNSET)) - base_scorer_version_db = cls( id=id, version=version, @@ -309,10 +216,7 @@ def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: finetuned_scorer=finetuned_scorer, model_name=model_name, num_judges=num_judges, - scoreable_node_types=scoreable_node_types, cot_enabled=cot_enabled, - output_type=output_type, - input_type=input_type, ) base_scorer_version_db.additional_properties = d diff --git a/src/splunk_ao/resources/models/base_scorer_version_response.py b/src/splunk_ao/resources/models/base_scorer_version_response.py index b36eb344..e17f7723 100644 --- a/src/splunk_ao/resources/models/base_scorer_version_response.py +++ b/src/splunk_ao/resources/models/base_scorer_version_response.py @@ -7,7 +7,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.input_type_enum import InputTypeEnum from ..models.output_type_enum import OutputTypeEnum from ..types import UNSET, Unset @@ -35,12 +34,10 @@ class BaseScorerVersionResponse: finetuned_scorer (FineTunedScorerResponse | None | Unset): model_name (None | str | Unset): num_judges (int | None | Unset): - scoreable_node_types (list[str] | None | Unset): cot_enabled (bool | None | Unset): - output_type (None | OutputTypeEnum | Unset): - input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers - (sessions_normalized, trace_io_only, etc.). chain_poll_template (ChainPollTemplate | None | Unset): + scoreable_node_types (list[str] | None | Unset): + output_type (None | OutputTypeEnum | Unset): allowed_model (bool | None | Unset): created_by (None | str | Unset): """ @@ -55,11 +52,10 @@ class BaseScorerVersionResponse: finetuned_scorer: FineTunedScorerResponse | None | Unset = UNSET model_name: None | str | Unset = UNSET num_judges: int | None | Unset = UNSET - scoreable_node_types: list[str] | None | Unset = UNSET cot_enabled: bool | None | Unset = UNSET - output_type: None | OutputTypeEnum | Unset = UNSET - input_type: InputTypeEnum | None | Unset = UNSET chain_poll_template: ChainPollTemplate | None | Unset = UNSET + scoreable_node_types: list[str] | None | Unset = UNSET + output_type: None | OutputTypeEnum | Unset = UNSET allowed_model: bool | None | Unset = UNSET created_by: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -116,6 +112,20 @@ def to_dict(self) -> dict[str, Any]: else: num_judges = self.num_judges + cot_enabled: bool | None | Unset + if isinstance(self.cot_enabled, Unset): + cot_enabled = UNSET + else: + cot_enabled = self.cot_enabled + + chain_poll_template: dict[str, Any] | None | Unset + if isinstance(self.chain_poll_template, Unset): + chain_poll_template = UNSET + elif isinstance(self.chain_poll_template, ChainPollTemplate): + chain_poll_template = self.chain_poll_template.to_dict() + else: + chain_poll_template = self.chain_poll_template + scoreable_node_types: list[str] | None | Unset if isinstance(self.scoreable_node_types, Unset): scoreable_node_types = UNSET @@ -125,12 +135,6 @@ def to_dict(self) -> dict[str, Any]: else: scoreable_node_types = self.scoreable_node_types - cot_enabled: bool | None | Unset - if isinstance(self.cot_enabled, Unset): - cot_enabled = UNSET - else: - cot_enabled = self.cot_enabled - output_type: None | str | Unset if isinstance(self.output_type, Unset): output_type = UNSET @@ -139,22 +143,6 @@ def to_dict(self) -> dict[str, Any]: else: output_type = self.output_type - input_type: None | str | Unset - if isinstance(self.input_type, Unset): - input_type = UNSET - elif isinstance(self.input_type, InputTypeEnum): - input_type = self.input_type.value - else: - input_type = self.input_type - - chain_poll_template: dict[str, Any] | None | Unset - if isinstance(self.chain_poll_template, Unset): - chain_poll_template = UNSET - elif isinstance(self.chain_poll_template, ChainPollTemplate): - chain_poll_template = self.chain_poll_template.to_dict() - else: - chain_poll_template = self.chain_poll_template - allowed_model: bool | None | Unset if isinstance(self.allowed_model, Unset): allowed_model = UNSET @@ -182,16 +170,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["model_name"] = model_name if num_judges is not UNSET: field_dict["num_judges"] = num_judges - if scoreable_node_types is not UNSET: - field_dict["scoreable_node_types"] = scoreable_node_types if cot_enabled is not UNSET: field_dict["cot_enabled"] = cot_enabled - if output_type is not UNSET: - field_dict["output_type"] = output_type - if input_type is not UNSET: - field_dict["input_type"] = input_type if chain_poll_template is not UNSET: field_dict["chain_poll_template"] = chain_poll_template + if scoreable_node_types is not UNSET: + field_dict["scoreable_node_types"] = scoreable_node_types + if output_type is not UNSET: + field_dict["output_type"] = output_type if allowed_model is not UNSET: field_dict["allowed_model"] = allowed_model if created_by is not UNSET: @@ -286,23 +272,6 @@ def _parse_num_judges(data: object) -> int | None | Unset: num_judges = _parse_num_judges(d.pop("num_judges", UNSET)) - def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - scoreable_node_types_type_0 = cast(list[str], data) - - return scoreable_node_types_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - scoreable_node_types = _parse_scoreable_node_types(d.pop("scoreable_node_types", UNSET)) - def _parse_cot_enabled(data: object) -> bool | None | Unset: if data is None: return data @@ -312,56 +281,56 @@ def _parse_cot_enabled(data: object) -> bool | None | Unset: cot_enabled = _parse_cot_enabled(d.pop("cot_enabled", UNSET)) - def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: + def _parse_chain_poll_template(data: object) -> ChainPollTemplate | None | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, str): + if not isinstance(data, dict): raise TypeError() - output_type_type_0 = OutputTypeEnum(data) + chain_poll_template_type_0 = ChainPollTemplate.from_dict(data) - return output_type_type_0 + return chain_poll_template_type_0 except: # noqa: E722 pass - return cast(None | OutputTypeEnum | Unset, data) + return cast(ChainPollTemplate | None | Unset, data) - output_type = _parse_output_type(d.pop("output_type", UNSET)) + chain_poll_template = _parse_chain_poll_template(d.pop("chain_poll_template", UNSET)) - def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: + def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, str): + if not isinstance(data, list): raise TypeError() - input_type_type_0 = InputTypeEnum(data) + scoreable_node_types_type_0 = cast(list[str], data) - return input_type_type_0 + return scoreable_node_types_type_0 except: # noqa: E722 pass - return cast(InputTypeEnum | None | Unset, data) + return cast(list[str] | None | Unset, data) - input_type = _parse_input_type(d.pop("input_type", UNSET)) + scoreable_node_types = _parse_scoreable_node_types(d.pop("scoreable_node_types", UNSET)) - def _parse_chain_poll_template(data: object) -> ChainPollTemplate | None | Unset: + def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, dict): + if not isinstance(data, str): raise TypeError() - chain_poll_template_type_0 = ChainPollTemplate.from_dict(data) + output_type_type_0 = OutputTypeEnum(data) - return chain_poll_template_type_0 + return output_type_type_0 except: # noqa: E722 pass - return cast(ChainPollTemplate | None | Unset, data) + return cast(None | OutputTypeEnum | Unset, data) - chain_poll_template = _parse_chain_poll_template(d.pop("chain_poll_template", UNSET)) + output_type = _parse_output_type(d.pop("output_type", UNSET)) def _parse_allowed_model(data: object) -> bool | None | Unset: if data is None: @@ -392,11 +361,10 @@ def _parse_created_by(data: object) -> None | str | Unset: finetuned_scorer=finetuned_scorer, model_name=model_name, num_judges=num_judges, - scoreable_node_types=scoreable_node_types, cot_enabled=cot_enabled, - output_type=output_type, - input_type=input_type, chain_poll_template=chain_poll_template, + scoreable_node_types=scoreable_node_types, + output_type=output_type, allowed_model=allowed_model, created_by=created_by, ) diff --git a/src/splunk_ao/resources/models/core_scorer_name.py b/src/splunk_ao/resources/models/core_scorer_name.py index 77a72c45..280f8e38 100644 --- a/src/splunk_ao/resources/models/core_scorer_name.py +++ b/src/splunk_ao/resources/models/core_scorer_name.py @@ -10,6 +10,8 @@ class CoreScorerName(str, Enum): AGENTIC_WORKFLOW_SUCCESS = "agentic_workflow_success" AGENT_EFFICIENCY = "agent_efficiency" AGENT_FLOW = "agent_flow" + AGENT_FLOW_AUDIO = "agent_flow_audio" + AGENT_FLOW_VISION = "agent_flow_vision" CHUNK_ATTRIBUTION_UTILIZATION = "chunk_attribution_utilization" CHUNK_ATTRIBUTION_UTILIZATION_LUNA = "chunk_attribution_utilization_luna" CHUNK_RELEVANCE = "chunk_relevance" @@ -24,6 +26,8 @@ class CoreScorerName(str, Enum): CONTEXT_RELEVANCE = "context_relevance" CONTEXT_RELEVANCE_LUNA = "context_relevance_luna" CONVERSATION_QUALITY = "conversation_quality" + CONVERSATION_QUALITY_AUDIO = "conversation_quality_audio" + CONVERSATION_QUALITY_VISION = "conversation_quality_vision" CORRECTNESS = "correctness" CORRECTNESS_AUDIO = "correctness_audio" CORRECTNESS_VISION = "correctness_vision" @@ -33,7 +37,9 @@ class CoreScorerName(str, Enum): INPUT_PII = "input_pii" INPUT_PII_GPT = "input_pii_gpt" INPUT_SEXIST = "input_sexist" + INPUT_SEXIST_AUDIO = "input_sexist_audio" INPUT_SEXIST_LUNA = "input_sexist_luna" + INPUT_SEXIST_VISION = "input_sexist_vision" INPUT_TONE = "input_tone" INPUT_TONE_GPT = "input_tone_gpt" INPUT_TOXICITY = "input_toxicity" @@ -41,11 +47,15 @@ class CoreScorerName(str, Enum): INPUT_TOXICITY_LUNA = "input_toxicity_luna" INPUT_TOXICITY_VISION = "input_toxicity_vision" INSTRUCTION_ADHERENCE = "instruction_adherence" + INSTRUCTION_ADHERENCE_AUDIO = "instruction_adherence_audio" + INSTRUCTION_ADHERENCE_VISION = "instruction_adherence_vision" INTERRUPTION_DETECTION = "interruption_detection" OUTPUT_PII = "output_pii" OUTPUT_PII_GPT = "output_pii_gpt" OUTPUT_SEXIST = "output_sexist" + OUTPUT_SEXIST_AUDIO = "output_sexist_audio" OUTPUT_SEXIST_LUNA = "output_sexist_luna" + OUTPUT_SEXIST_VISION = "output_sexist_vision" OUTPUT_TONE = "output_tone" OUTPUT_TONE_GPT = "output_tone_gpt" OUTPUT_TOXICITY = "output_toxicity" @@ -54,7 +64,9 @@ class CoreScorerName(str, Enum): OUTPUT_TOXICITY_VISION = "output_toxicity_vision" PRECISION_AT_K = "precision_at_k" PROMPT_INJECTION = "prompt_injection" + PROMPT_INJECTION_AUDIO = "prompt_injection_audio" PROMPT_INJECTION_LUNA = "prompt_injection_luna" + PROMPT_INJECTION_VISION = "prompt_injection_vision" REASONING_COHERENCE = "reasoning_coherence" REASONING_COHERENCE_AUDIO = "reasoning_coherence_audio" REASONING_COHERENCE_VISION = "reasoning_coherence_vision" @@ -65,7 +77,9 @@ class CoreScorerName(str, Enum): TOOL_ERROR_RATE = "tool_error_rate" TOOL_ERROR_RATE_LUNA = "tool_error_rate_luna" TOOL_SELECTION_QUALITY = "tool_selection_quality" + TOOL_SELECTION_QUALITY_AUDIO = "tool_selection_quality_audio" TOOL_SELECTION_QUALITY_LUNA = "tool_selection_quality_luna" + TOOL_SELECTION_QUALITY_VISION = "tool_selection_quality_vision" USER_INTENT_CHANGE = "user_intent_change" USER_INTENT_CHANGE_AUDIO = "user_intent_change_audio" USER_INTENT_CHANGE_VISION = "user_intent_change_vision" diff --git a/src/splunk_ao/resources/models/create_job_request.py b/src/splunk_ao/resources/models/create_job_request.py index cf729392..4669f0f4 100644 --- a/src/splunk_ao/resources/models/create_job_request.py +++ b/src/splunk_ao/resources/models/create_job_request.py @@ -51,7 +51,7 @@ from ..models.prompt_injection_scorer import PromptInjectionScorer from ..models.prompt_run_settings import PromptRunSettings from ..models.registered_scorer import RegisteredScorer - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.scorers_configuration import ScorersConfiguration from ..models.segment_filter import SegmentFilter from ..models.task_resource_limits import TaskResourceLimits @@ -79,7 +79,6 @@ class CreateJobRequest: tasks (list[str] | None | Unset): non_inference_logged (bool | Unset): Default: False. migration_name (None | str | Unset): - xray (bool | Unset): Default: True. process_existing_inference_runs (bool | Unset): Default: False. feature_names (list[str] | None | Unset): prompt_dataset_id (None | str | Unset): @@ -94,8 +93,8 @@ class CreateJobRequest: CompletenessScorer | ContextAdherenceScorer | ContextRelevanceScorer | CorrectnessScorer | GroundTruthAdherenceScorer | InputPIIScorer | InputSexistScorer | InputToneScorer | InputToxicityScorer | InstructionAdherenceScorer | OutputPIIScorer | OutputSexistScorer | OutputToneScorer | OutputToxicityScorer | - PromptInjectionScorer | ToolErrorRateScorer | ToolSelectionQualityScorer] | list[ScorerConfig] | None | Unset): - For G2.0 we send all scorers as ScorerConfig, for G1.0 we send preset scorers as GalileoScorer + PromptInjectionScorer | ToolErrorRateScorer | ToolSelectionQualityScorer] | list[RuntimeScorerConfig] | None | + Unset): For G2.0 we send all scorers as ScorerConfig, for G1.0 we send preset scorers as GalileoScorer prompt_registered_scorers_configuration (list[RegisteredScorer] | None | Unset): prompt_generated_scorers_configuration (list[str] | None | Unset): prompt_finetuned_scorers_configuration (list[FineTunedScorer] | None | Unset): @@ -108,7 +107,7 @@ class CreateJobRequest: CustomizedToolErrorRateGPTScorer | CustomizedToolSelectionQualityGPTScorer | CustomizedToxicityGPTScorer] | None | Unset): prompt_scorer_settings (BaseScorer | None | Unset): - scorer_config (None | ScorerConfig | Unset): + scorer_config (None | RuntimeScorerConfig | Unset): sub_scorers (list[ScorerName] | Unset): luna_model (None | str | Unset): segment_filters (list[SegmentFilter] | None | Unset): @@ -135,7 +134,6 @@ class CreateJobRequest: tasks: list[str] | None | Unset = UNSET non_inference_logged: bool | Unset = False migration_name: None | str | Unset = UNSET - xray: bool | Unset = True process_existing_inference_runs: bool | Unset = False feature_names: list[str] | None | Unset = UNSET prompt_dataset_id: None | str | Unset = UNSET @@ -169,7 +167,7 @@ class CreateJobRequest: | ToolErrorRateScorer | ToolSelectionQualityScorer ] - | list[ScorerConfig] + | list[RuntimeScorerConfig] | None | Unset ) = UNSET @@ -199,7 +197,7 @@ class CreateJobRequest: | Unset ) = UNSET prompt_scorer_settings: BaseScorer | None | Unset = UNSET - scorer_config: None | ScorerConfig | Unset = UNSET + scorer_config: None | RuntimeScorerConfig | Unset = UNSET sub_scorers: list[ScorerName] | Unset = UNSET luna_model: None | str | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET @@ -251,7 +249,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.output_toxicity_scorer import OutputToxicityScorer from ..models.prompt_injection_scorer import PromptInjectionScorer from ..models.prompt_run_settings import PromptRunSettings - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.scorers_configuration import ScorersConfiguration from ..models.task_resource_limits import TaskResourceLimits from ..models.tool_error_rate_scorer import ToolErrorRateScorer @@ -331,8 +329,6 @@ def to_dict(self) -> dict[str, Any]: else: migration_name = self.migration_name - xray = self.xray - process_existing_inference_runs = self.process_existing_inference_runs feature_names: list[str] | None | Unset @@ -611,7 +607,7 @@ def to_dict(self) -> dict[str, Any]: scorer_config: dict[str, Any] | None | Unset if isinstance(self.scorer_config, Unset): scorer_config = UNSET - elif isinstance(self.scorer_config, ScorerConfig): + elif isinstance(self.scorer_config, RuntimeScorerConfig): scorer_config = self.scorer_config.to_dict() else: scorer_config = self.scorer_config @@ -694,8 +690,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["non_inference_logged"] = non_inference_logged if migration_name is not UNSET: field_dict["migration_name"] = migration_name - if xray is not UNSET: - field_dict["xray"] = xray if process_existing_inference_runs is not UNSET: field_dict["process_existing_inference_runs"] = process_existing_inference_runs if feature_names is not UNSET: @@ -799,7 +793,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.prompt_injection_scorer import PromptInjectionScorer from ..models.prompt_run_settings import PromptRunSettings from ..models.registered_scorer import RegisteredScorer - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.scorers_configuration import ScorersConfiguration from ..models.segment_filter import SegmentFilter from ..models.task_resource_limits import TaskResourceLimits @@ -936,8 +930,6 @@ def _parse_migration_name(data: object) -> None | str | Unset: migration_name = _parse_migration_name(d.pop("migration_name", UNSET)) - xray = d.pop("xray", UNSET) - process_existing_inference_runs = d.pop("process_existing_inference_runs", UNSET) def _parse_feature_names(data: object) -> list[str] | None | Unset: @@ -1062,7 +1054,7 @@ def _parse_scorers( | ToolErrorRateScorer | ToolSelectionQualityScorer ] - | list[ScorerConfig] + | list[RuntimeScorerConfig] | None | Unset ): @@ -1076,7 +1068,7 @@ def _parse_scorers( scorers_type_0 = [] _scorers_type_0 = data for scorers_type_0_item_data in _scorers_type_0: - scorers_type_0_item = ScorerConfig.from_dict(scorers_type_0_item_data) + scorers_type_0_item = RuntimeScorerConfig.from_dict(scorers_type_0_item_data) scorers_type_0.append(scorers_type_0_item) @@ -1302,7 +1294,7 @@ def _parse_scorers_type_1_item( | ToolErrorRateScorer | ToolSelectionQualityScorer ] - | list[ScorerConfig] + | list[RuntimeScorerConfig] | None | Unset, data, @@ -1666,7 +1658,7 @@ def _parse_prompt_scorer_settings(data: object) -> BaseScorer | None | Unset: prompt_scorer_settings = _parse_prompt_scorer_settings(d.pop("prompt_scorer_settings", UNSET)) - def _parse_scorer_config(data: object) -> None | ScorerConfig | Unset: + def _parse_scorer_config(data: object) -> None | RuntimeScorerConfig | Unset: if data is None: return data if isinstance(data, Unset): @@ -1674,12 +1666,12 @@ def _parse_scorer_config(data: object) -> None | ScorerConfig | Unset: try: if not isinstance(data, dict): raise TypeError() - scorer_config_type_0 = ScorerConfig.from_dict(data) + scorer_config_type_0 = RuntimeScorerConfig.from_dict(data) return scorer_config_type_0 except: # noqa: E722 pass - return cast(None | ScorerConfig | Unset, data) + return cast(None | RuntimeScorerConfig | Unset, data) scorer_config = _parse_scorer_config(d.pop("scorer_config", UNSET)) @@ -1775,7 +1767,6 @@ def _parse_validation_config(data: object) -> CreateJobRequestValidationConfigTy tasks=tasks, non_inference_logged=non_inference_logged, migration_name=migration_name, - xray=xray, process_existing_inference_runs=process_existing_inference_runs, feature_names=feature_names, prompt_dataset_id=prompt_dataset_id, diff --git a/src/splunk_ao/resources/models/create_job_response.py b/src/splunk_ao/resources/models/create_job_response.py index 16f60906..84d69abd 100644 --- a/src/splunk_ao/resources/models/create_job_response.py +++ b/src/splunk_ao/resources/models/create_job_response.py @@ -51,7 +51,7 @@ from ..models.prompt_injection_scorer import PromptInjectionScorer from ..models.prompt_run_settings import PromptRunSettings from ..models.registered_scorer import RegisteredScorer - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.scorers_configuration import ScorersConfiguration from ..models.segment_filter import SegmentFilter from ..models.task_resource_limits import TaskResourceLimits @@ -81,7 +81,6 @@ class CreateJobResponse: tasks (list[str] | None | Unset): non_inference_logged (bool | Unset): Default: False. migration_name (None | str | Unset): - xray (bool | Unset): Default: True. process_existing_inference_runs (bool | Unset): Default: False. feature_names (list[str] | None | Unset): prompt_dataset_id (None | str | Unset): @@ -96,8 +95,8 @@ class CreateJobResponse: CompletenessScorer | ContextAdherenceScorer | ContextRelevanceScorer | CorrectnessScorer | GroundTruthAdherenceScorer | InputPIIScorer | InputSexistScorer | InputToneScorer | InputToxicityScorer | InstructionAdherenceScorer | OutputPIIScorer | OutputSexistScorer | OutputToneScorer | OutputToxicityScorer | - PromptInjectionScorer | ToolErrorRateScorer | ToolSelectionQualityScorer] | list[ScorerConfig] | None | Unset): - For G2.0 we send all scorers as ScorerConfig, for G1.0 we send preset scorers as GalileoScorer + PromptInjectionScorer | ToolErrorRateScorer | ToolSelectionQualityScorer] | list[RuntimeScorerConfig] | None | + Unset): For G2.0 we send all scorers as ScorerConfig, for G1.0 we send preset scorers as GalileoScorer prompt_registered_scorers_configuration (list[RegisteredScorer] | None | Unset): prompt_generated_scorers_configuration (list[str] | None | Unset): prompt_finetuned_scorers_configuration (list[FineTunedScorer] | None | Unset): @@ -110,7 +109,7 @@ class CreateJobResponse: CustomizedToolErrorRateGPTScorer | CustomizedToolSelectionQualityGPTScorer | CustomizedToxicityGPTScorer] | None | Unset): prompt_scorer_settings (BaseScorer | None | Unset): - scorer_config (None | ScorerConfig | Unset): + scorer_config (None | RuntimeScorerConfig | Unset): sub_scorers (list[ScorerName] | Unset): luna_model (None | str | Unset): segment_filters (list[SegmentFilter] | None | Unset): @@ -139,7 +138,6 @@ class CreateJobResponse: tasks: list[str] | None | Unset = UNSET non_inference_logged: bool | Unset = False migration_name: None | str | Unset = UNSET - xray: bool | Unset = True process_existing_inference_runs: bool | Unset = False feature_names: list[str] | None | Unset = UNSET prompt_dataset_id: None | str | Unset = UNSET @@ -173,7 +171,7 @@ class CreateJobResponse: | ToolErrorRateScorer | ToolSelectionQualityScorer ] - | list[ScorerConfig] + | list[RuntimeScorerConfig] | None | Unset ) = UNSET @@ -203,7 +201,7 @@ class CreateJobResponse: | Unset ) = UNSET prompt_scorer_settings: BaseScorer | None | Unset = UNSET - scorer_config: None | ScorerConfig | Unset = UNSET + scorer_config: None | RuntimeScorerConfig | Unset = UNSET sub_scorers: list[ScorerName] | Unset = UNSET luna_model: None | str | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET @@ -255,7 +253,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.output_toxicity_scorer import OutputToxicityScorer from ..models.prompt_injection_scorer import PromptInjectionScorer from ..models.prompt_run_settings import PromptRunSettings - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.scorers_configuration import ScorersConfiguration from ..models.task_resource_limits import TaskResourceLimits from ..models.tool_error_rate_scorer import ToolErrorRateScorer @@ -339,8 +337,6 @@ def to_dict(self) -> dict[str, Any]: else: migration_name = self.migration_name - xray = self.xray - process_existing_inference_runs = self.process_existing_inference_runs feature_names: list[str] | None | Unset @@ -619,7 +615,7 @@ def to_dict(self) -> dict[str, Any]: scorer_config: dict[str, Any] | None | Unset if isinstance(self.scorer_config, Unset): scorer_config = UNSET - elif isinstance(self.scorer_config, ScorerConfig): + elif isinstance(self.scorer_config, RuntimeScorerConfig): scorer_config = self.scorer_config.to_dict() else: scorer_config = self.scorer_config @@ -702,8 +698,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["non_inference_logged"] = non_inference_logged if migration_name is not UNSET: field_dict["migration_name"] = migration_name - if xray is not UNSET: - field_dict["xray"] = xray if process_existing_inference_runs is not UNSET: field_dict["process_existing_inference_runs"] = process_existing_inference_runs if feature_names is not UNSET: @@ -807,7 +801,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.prompt_injection_scorer import PromptInjectionScorer from ..models.prompt_run_settings import PromptRunSettings from ..models.registered_scorer import RegisteredScorer - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.scorers_configuration import ScorersConfiguration from ..models.segment_filter import SegmentFilter from ..models.task_resource_limits import TaskResourceLimits @@ -948,8 +942,6 @@ def _parse_migration_name(data: object) -> None | str | Unset: migration_name = _parse_migration_name(d.pop("migration_name", UNSET)) - xray = d.pop("xray", UNSET) - process_existing_inference_runs = d.pop("process_existing_inference_runs", UNSET) def _parse_feature_names(data: object) -> list[str] | None | Unset: @@ -1074,7 +1066,7 @@ def _parse_scorers( | ToolErrorRateScorer | ToolSelectionQualityScorer ] - | list[ScorerConfig] + | list[RuntimeScorerConfig] | None | Unset ): @@ -1088,7 +1080,7 @@ def _parse_scorers( scorers_type_0 = [] _scorers_type_0 = data for scorers_type_0_item_data in _scorers_type_0: - scorers_type_0_item = ScorerConfig.from_dict(scorers_type_0_item_data) + scorers_type_0_item = RuntimeScorerConfig.from_dict(scorers_type_0_item_data) scorers_type_0.append(scorers_type_0_item) @@ -1314,7 +1306,7 @@ def _parse_scorers_type_1_item( | ToolErrorRateScorer | ToolSelectionQualityScorer ] - | list[ScorerConfig] + | list[RuntimeScorerConfig] | None | Unset, data, @@ -1678,7 +1670,7 @@ def _parse_prompt_scorer_settings(data: object) -> BaseScorer | None | Unset: prompt_scorer_settings = _parse_prompt_scorer_settings(d.pop("prompt_scorer_settings", UNSET)) - def _parse_scorer_config(data: object) -> None | ScorerConfig | Unset: + def _parse_scorer_config(data: object) -> None | RuntimeScorerConfig | Unset: if data is None: return data if isinstance(data, Unset): @@ -1686,12 +1678,12 @@ def _parse_scorer_config(data: object) -> None | ScorerConfig | Unset: try: if not isinstance(data, dict): raise TypeError() - scorer_config_type_0 = ScorerConfig.from_dict(data) + scorer_config_type_0 = RuntimeScorerConfig.from_dict(data) return scorer_config_type_0 except: # noqa: E722 pass - return cast(None | ScorerConfig | Unset, data) + return cast(None | RuntimeScorerConfig | Unset, data) scorer_config = _parse_scorer_config(d.pop("scorer_config", UNSET)) @@ -1789,7 +1781,6 @@ def _parse_validation_config(data: object) -> CreateJobResponseValidationConfigT tasks=tasks, non_inference_logged=non_inference_logged, migration_name=migration_name, - xray=xray, process_existing_inference_runs=process_existing_inference_runs, feature_names=feature_names, prompt_dataset_id=prompt_dataset_id, diff --git a/src/splunk_ao/resources/models/create_scorer_request.py b/src/splunk_ao/resources/models/create_scorer_request.py index 05274eac..f4993d14 100644 --- a/src/splunk_ao/resources/models/create_scorer_request.py +++ b/src/splunk_ao/resources/models/create_scorer_request.py @@ -20,6 +20,7 @@ from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_invocation_config import ScorerInvocationConfig T = TypeVar("T", bound="CreateScorerRequest") @@ -36,6 +37,7 @@ class CreateScorerRequest: description (None | str | Unset): Default: ''. tags (list[str] | Unset): defaults (None | ScorerDefaults | Unset): + invocation (None | ScorerInvocationConfig | Unset): deprecated (bool | None | Unset): model_type (ModelType | None | Unset): ground_truth (bool | None | Unset): @@ -61,6 +63,7 @@ class CreateScorerRequest: description: None | str | Unset = "" tags: list[str] | Unset = UNSET defaults: None | ScorerDefaults | Unset = UNSET + invocation: None | ScorerInvocationConfig | Unset = UNSET deprecated: bool | None | Unset = UNSET model_type: ModelType | None | Unset = UNSET ground_truth: bool | None | Unset = UNSET @@ -91,6 +94,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_invocation_config import ScorerInvocationConfig name = self.name @@ -126,6 +130,14 @@ def to_dict(self) -> dict[str, Any]: else: defaults = self.defaults + invocation: dict[str, Any] | None | Unset + if isinstance(self.invocation, Unset): + invocation = UNSET + elif isinstance(self.invocation, ScorerInvocationConfig): + invocation = self.invocation.to_dict() + else: + invocation = self.invocation + deprecated: bool | None | Unset if isinstance(self.deprecated, Unset): deprecated = UNSET @@ -258,6 +270,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["tags"] = tags if defaults is not UNSET: field_dict["defaults"] = defaults + if invocation is not UNSET: + field_dict["invocation"] = invocation if deprecated is not UNSET: field_dict["deprecated"] = deprecated if model_type is not UNSET: @@ -298,6 +312,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_invocation_config import ScorerInvocationConfig d = dict(src_dict) name = d.pop("name") @@ -350,6 +365,23 @@ def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: defaults = _parse_defaults(d.pop("defaults", UNSET)) + def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + invocation_type_0 = ScorerInvocationConfig.from_dict(data) + + return invocation_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerInvocationConfig | Unset, data) + + invocation = _parse_invocation(d.pop("invocation", UNSET)) + def _parse_deprecated(data: object) -> bool | None | Unset: if data is None: return data @@ -604,6 +636,7 @@ def _parse_is_global(data: object) -> bool | None | Unset: description=description, tags=tags, defaults=defaults, + invocation=invocation, deprecated=deprecated, model_type=model_type, ground_truth=ground_truth, diff --git a/src/splunk_ao/resources/models/experiment_create_request.py b/src/splunk_ao/resources/models/experiment_create_request.py index 35dca17d..3bde54fb 100644 --- a/src/splunk_ao/resources/models/experiment_create_request.py +++ b/src/splunk_ao/resources/models/experiment_create_request.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: from ..models.experiment_dataset_request import ExperimentDatasetRequest from ..models.prompt_run_settings import PromptRunSettings - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig T = TypeVar("T", bound="ExperimentCreateRequest") @@ -28,7 +28,7 @@ class ExperimentCreateRequest: dataset (ExperimentDatasetRequest | None | Unset): playground_prompt_id (None | str | Unset): prompt_settings (None | PromptRunSettings | Unset): - scorers (list[ScorerConfig] | Unset): + scorers (list[RuntimeScorerConfig] | Unset): trigger (bool | Unset): Default: False. experiment_group_id (None | str | Unset): experiment_group_name (None | str | Unset): @@ -41,7 +41,7 @@ class ExperimentCreateRequest: dataset: ExperimentDatasetRequest | None | Unset = UNSET playground_prompt_id: None | str | Unset = UNSET prompt_settings: None | PromptRunSettings | Unset = UNSET - scorers: list[ScorerConfig] | Unset = UNSET + scorers: list[RuntimeScorerConfig] | Unset = UNSET trigger: bool | Unset = False experiment_group_id: None | str | Unset = UNSET experiment_group_name: None | str | Unset = UNSET @@ -144,7 +144,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.experiment_dataset_request import ExperimentDatasetRequest from ..models.prompt_run_settings import PromptRunSettings - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig d = dict(src_dict) name = d.pop("name") @@ -225,11 +225,11 @@ def _parse_prompt_settings(data: object) -> None | PromptRunSettings | Unset: prompt_settings = _parse_prompt_settings(d.pop("prompt_settings", UNSET)) _scorers = d.pop("scorers", UNSET) - scorers: list[ScorerConfig] | Unset = UNSET + scorers: list[RuntimeScorerConfig] | Unset = UNSET if _scorers is not UNSET: scorers = [] for scorers_item_data in _scorers: - scorers_item = ScorerConfig.from_dict(scorers_item_data) + scorers_item = RuntimeScorerConfig.from_dict(scorers_item_data) scorers.append(scorers_item) diff --git a/src/splunk_ao/resources/models/extended_agent_span_record.py b/src/splunk_ao/resources/models/extended_agent_span_record.py index cde71f19..43d11321 100644 --- a/src/splunk_ao/resources/models/extended_agent_span_record.py +++ b/src/splunk_ao/resources/models/extended_agent_span_record.py @@ -87,6 +87,7 @@ class ExtendedAgentSpanRecord: is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. agent_type (AgentType | Unset): + agent_name (None | str | Unset): Name of the agent. """ id: str @@ -134,6 +135,7 @@ class ExtendedAgentSpanRecord: is_complete: bool | Unset = True step_number: int | None | Unset = UNSET agent_type: AgentType | Unset = UNSET + agent_name: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -408,6 +410,12 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.agent_type, Unset): agent_type = self.agent_type.value + agent_name: None | str | Unset + if isinstance(self.agent_name, Unset): + agent_name = UNSET + else: + agent_name = self.agent_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -485,6 +493,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["step_number"] = step_number if agent_type is not UNSET: field_dict["agent_type"] = agent_type + if agent_name is not UNSET: + field_dict["agent_name"] = agent_name return field_dict @@ -1116,6 +1126,15 @@ def _parse_step_number(data: object) -> int | None | Unset: else: agent_type = AgentType(_agent_type) + def _parse_agent_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) + extended_agent_span_record = cls( id=id, session_id=session_id, @@ -1158,6 +1177,7 @@ def _parse_step_number(data: object) -> int | None | Unset: is_complete=is_complete, step_number=step_number, agent_type=agent_type, + agent_name=agent_name, ) extended_agent_span_record.additional_properties = d diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py index 8ea68b4e..eb5a6100 100644 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py +++ b/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py @@ -113,6 +113,7 @@ class ExtendedAgentSpanRecordWithChildren: is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. agent_type (AgentType | Unset): + agent_name (None | str | Unset): Name of the agent. """ id: str @@ -171,6 +172,7 @@ class ExtendedAgentSpanRecordWithChildren: is_complete: bool | Unset = True step_number: int | None | Unset = UNSET agent_type: AgentType | Unset = UNSET + agent_name: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -473,6 +475,12 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.agent_type, Unset): agent_type = self.agent_type.value + agent_name: None | str | Unset + if isinstance(self.agent_name, Unset): + agent_name = UNSET + else: + agent_name = self.agent_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -552,6 +560,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["step_number"] = step_number if agent_type is not UNSET: field_dict["agent_type"] = agent_type + if agent_name is not UNSET: + field_dict["agent_name"] = agent_name return field_dict @@ -1347,6 +1357,15 @@ def _parse_step_number(data: object) -> int | None | Unset: else: agent_type = AgentType(_agent_type) + def _parse_agent_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) + extended_agent_span_record_with_children = cls( id=id, session_id=session_id, @@ -1390,6 +1409,7 @@ def _parse_step_number(data: object) -> int | None | Unset: is_complete=is_complete, step_number=step_number, agent_type=agent_type, + agent_name=agent_name, ) extended_agent_span_record_with_children.additional_properties = d diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children.py similarity index 70% rename from src/splunk_ao/resources/models/extended_session_record_with_children.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children.py index 20fcbd17..dfeda743 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children.py @@ -13,98 +13,111 @@ if TYPE_CHECKING: from ..models.control_result import ControlResult from ..models.document import Document - from ..models.extended_session_record_with_children_annotation_aggregates import ( - ExtendedSessionRecordWithChildrenAnnotationAggregates, + from ..models.extended_read_session_record_with_children_annotation_aggregates import ( + ExtendedReadSessionRecordWithChildrenAnnotationAggregates, ) - from ..models.extended_session_record_with_children_annotation_agreement import ( - ExtendedSessionRecordWithChildrenAnnotationAgreement, + from ..models.extended_read_session_record_with_children_annotation_agreement import ( + ExtendedReadSessionRecordWithChildrenAnnotationAgreement, ) - from ..models.extended_session_record_with_children_annotations import ExtendedSessionRecordWithChildrenAnnotations - from ..models.extended_session_record_with_children_dataset_metadata import ( - ExtendedSessionRecordWithChildrenDatasetMetadata, + from ..models.extended_read_session_record_with_children_annotations import ( + ExtendedReadSessionRecordWithChildrenAnnotations, ) - from ..models.extended_session_record_with_children_feedback_rating_info import ( - ExtendedSessionRecordWithChildrenFeedbackRatingInfo, + from ..models.extended_read_session_record_with_children_dataset_metadata import ( + ExtendedReadSessionRecordWithChildrenDatasetMetadata, ) - from ..models.extended_session_record_with_children_files_type_0 import ExtendedSessionRecordWithChildrenFilesType0 - from ..models.extended_session_record_with_children_metric_info_type_0 import ( - ExtendedSessionRecordWithChildrenMetricInfoType0, + from ..models.extended_read_session_record_with_children_feedback_rating_info import ( + ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo, ) - from ..models.extended_session_record_with_children_user_metadata import ( - ExtendedSessionRecordWithChildrenUserMetadata, + from ..models.extended_read_session_record_with_children_files_type_0 import ( + ExtendedReadSessionRecordWithChildrenFilesType0, + ) + from ..models.extended_read_session_record_with_children_metric_info_type_0 import ( + ExtendedReadSessionRecordWithChildrenMetricInfoType0, + ) + from ..models.extended_read_session_record_with_children_user_metadata import ( + ExtendedReadSessionRecordWithChildrenUserMetadata, ) from ..models.extended_trace_record_with_children import ExtendedTraceRecordWithChildren from ..models.file_content_part import FileContentPart from ..models.message import Message from ..models.metrics import Metrics + from ..models.stub_trace_record import StubTraceRecord from ..models.text_content_part import TextContentPart -T = TypeVar("T", bound="ExtendedSessionRecordWithChildren") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildren") @_attrs_define -class ExtendedSessionRecordWithChildren: - """ - Attributes: - id (str): Galileo ID of the session - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - traces (list[ExtendedTraceRecordWithChildren] | Unset): - type_ (Literal['session'] | Unset): Type of the trace, span or session. Default: 'session'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedSessionRecordWithChildrenUserMetadata | Unset): Metadata associated with this trace or - span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedSessionRecordWithChildrenDatasetMetadata | Unset): Metadata from the dataset - associated with this trace - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedSessionRecordWithChildrenFeedbackRatingInfo | Unset): Feedback information related - to the record - annotations (ExtendedSessionRecordWithChildrenAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedSessionRecordWithChildrenAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (ExtendedSessionRecordWithChildrenAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedSessionRecordWithChildrenMetricInfoType0 | None | Unset): Detailed information about the - metrics associated with this trace or span - files (ExtendedSessionRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files - associated with this record - previous_session_id (None | str | Unset): - num_traces (int | None | Unset): +class ExtendedReadSessionRecordWithChildren: + """Read-side session response that also accepts synthesized stub_trace roots. + + Same shape as ExtendedSessionRecordWithChildren, except `traces` allows the + StubTraceRecord placeholder produced by create_tree_for_extended_read_session + for spans whose TraceRecord hasn't arrived yet. Defined independently of + ExtendedSessionRecordWithChildren/RecordWithChildTraces rather than + subclassing them, since widening their Sequence[ExtendedTraceRecordWithChildren] + field to also allow StubTraceRecord in a subclass is an LSP violation mypy + correctly rejects. + + Attributes: + id (str): Galileo ID of the session + project_id (str): Galileo ID of the project associated with this trace or span + run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span + type_ (Literal['session'] | Unset): Type of the trace, span or session. Default: 'session'. + input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Default: ''. + redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of + the trace or span. + output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | + Unset): Output of the trace or span. + redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str + | Unset): Redacted output of the trace or span. + name (str | Unset): Name of the trace, span or session. Default: ''. + created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. + user_metadata (ExtendedReadSessionRecordWithChildrenUserMetadata | Unset): Metadata associated with this trace + or span. + tags (list[str] | Unset): Tags associated with this trace or span. + status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. + metrics (Metrics | Unset): + external_id (None | str | Unset): A user-provided session, trace or span ID. + dataset_input (None | str | Unset): Input to the dataset associated with this trace + dataset_output (None | str | Unset): Output from the dataset associated with this trace + dataset_metadata (ExtendedReadSessionRecordWithChildrenDatasetMetadata | Unset): Metadata from the dataset + associated with this trace + session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session + trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) + updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update + has_children (bool | None | Unset): Whether or not this trace or span has child spans + metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span + session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span + feedback_rating_info (ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo | Unset): Feedback information + related to the record + annotations (ExtendedReadSessionRecordWithChildrenAnnotations | Unset): Annotations keyed by template ID and + annotator ID + file_ids (list[str] | Unset): IDs of files associated with this record + file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record + annotation_aggregates (ExtendedReadSessionRecordWithChildrenAnnotationAggregates | Unset): Annotation aggregate + information keyed by template ID + annotation_agreement (ExtendedReadSessionRecordWithChildrenAnnotationAgreement | Unset): Annotation agreement + scores keyed by template ID + overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the + queue + annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in + fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue + progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. + error_message (str | Unset): Runner error text written directly to CH span Default: ''. + metric_info (ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset): Detailed information about + the metrics associated with this trace or span + files (ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files + associated with this record + previous_session_id (None | str | Unset): + num_traces (int | None | Unset): + traces (list[ExtendedTraceRecordWithChildren | StubTraceRecord] | Unset): """ id: str project_id: str run_id: str - traces: list[ExtendedTraceRecordWithChildren] | Unset = UNSET type_: Literal["session"] | Unset = "session" input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET @@ -116,45 +129,47 @@ class ExtendedSessionRecordWithChildren: ) = UNSET name: str | Unset = "" created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedSessionRecordWithChildrenUserMetadata | Unset = UNSET + user_metadata: ExtendedReadSessionRecordWithChildrenUserMetadata | Unset = UNSET tags: list[str] | Unset = UNSET status_code: int | None | Unset = UNSET metrics: Metrics | Unset = UNSET external_id: None | str | Unset = UNSET dataset_input: None | str | Unset = UNSET dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedSessionRecordWithChildrenDatasetMetadata | Unset = UNSET + dataset_metadata: ExtendedReadSessionRecordWithChildrenDatasetMetadata | Unset = UNSET session_id: None | str | Unset = UNSET trace_id: None | str | Unset = UNSET updated_at: datetime.datetime | None | Unset = UNSET has_children: bool | None | Unset = UNSET metrics_batch_id: None | str | Unset = UNSET session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedSessionRecordWithChildrenFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedSessionRecordWithChildrenAnnotations | Unset = UNSET + feedback_rating_info: ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo | Unset = UNSET + annotations: ExtendedReadSessionRecordWithChildrenAnnotations | Unset = UNSET file_ids: list[str] | Unset = UNSET file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedSessionRecordWithChildrenAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedSessionRecordWithChildrenAnnotationAgreement | Unset = UNSET + annotation_aggregates: ExtendedReadSessionRecordWithChildrenAnnotationAggregates | Unset = UNSET + annotation_agreement: ExtendedReadSessionRecordWithChildrenAnnotationAgreement | Unset = UNSET overall_annotation_agreement: float | None | Unset = UNSET annotation_queue_ids: list[str] | Unset = UNSET fully_annotated: bool | None | Unset = UNSET progress_message: str | Unset = "" error_message: str | Unset = "" - metric_info: ExtendedSessionRecordWithChildrenMetricInfoType0 | None | Unset = UNSET - files: ExtendedSessionRecordWithChildrenFilesType0 | None | Unset = UNSET + metric_info: ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset = UNSET + files: ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset = UNSET previous_session_id: None | str | Unset = UNSET num_traces: int | None | Unset = UNSET + traces: list[ExtendedTraceRecordWithChildren | StubTraceRecord] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.control_result import ControlResult - from ..models.extended_session_record_with_children_files_type_0 import ( - ExtendedSessionRecordWithChildrenFilesType0, + from ..models.extended_read_session_record_with_children_files_type_0 import ( + ExtendedReadSessionRecordWithChildrenFilesType0, ) - from ..models.extended_session_record_with_children_metric_info_type_0 import ( - ExtendedSessionRecordWithChildrenMetricInfoType0, + from ..models.extended_read_session_record_with_children_metric_info_type_0 import ( + ExtendedReadSessionRecordWithChildrenMetricInfoType0, ) + from ..models.extended_trace_record_with_children import ExtendedTraceRecordWithChildren from ..models.message import Message from ..models.text_content_part import TextContentPart @@ -164,13 +179,6 @@ def to_dict(self) -> dict[str, Any]: run_id = self.run_id - traces: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.traces, Unset): - traces = [] - for traces_item_data in self.traces: - traces_item = traces_item_data.to_dict() - traces.append(traces_item) - type_ = self.type_ input_: list[dict[str, Any]] | str | Unset @@ -407,7 +415,7 @@ def to_dict(self) -> dict[str, Any]: metric_info: dict[str, Any] | None | Unset if isinstance(self.metric_info, Unset): metric_info = UNSET - elif isinstance(self.metric_info, ExtendedSessionRecordWithChildrenMetricInfoType0): + elif isinstance(self.metric_info, ExtendedReadSessionRecordWithChildrenMetricInfoType0): metric_info = self.metric_info.to_dict() else: metric_info = self.metric_info @@ -415,7 +423,7 @@ def to_dict(self) -> dict[str, Any]: files: dict[str, Any] | None | Unset if isinstance(self.files, Unset): files = UNSET - elif isinstance(self.files, ExtendedSessionRecordWithChildrenFilesType0): + elif isinstance(self.files, ExtendedReadSessionRecordWithChildrenFilesType0): files = self.files.to_dict() else: files = self.files @@ -432,11 +440,21 @@ def to_dict(self) -> dict[str, Any]: else: num_traces = self.num_traces + traces: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.traces, Unset): + traces = [] + for traces_item_data in self.traces: + traces_item: dict[str, Any] + if isinstance(traces_item_data, ExtendedTraceRecordWithChildren): + traces_item = traces_item_data.to_dict() + else: + traces_item = traces_item_data.to_dict() + + traces.append(traces_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"id": id, "project_id": project_id, "run_id": run_id}) - if traces is not UNSET: - field_dict["traces"] = traces if type_ is not UNSET: field_dict["type"] = type_ if input_ is not UNSET: @@ -509,6 +527,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["previous_session_id"] = previous_session_id if num_traces is not UNSET: field_dict["num_traces"] = num_traces + if traces is not UNSET: + field_dict["traces"] = traces return field_dict @@ -516,34 +536,35 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.control_result import ControlResult from ..models.document import Document - from ..models.extended_session_record_with_children_annotation_aggregates import ( - ExtendedSessionRecordWithChildrenAnnotationAggregates, + from ..models.extended_read_session_record_with_children_annotation_aggregates import ( + ExtendedReadSessionRecordWithChildrenAnnotationAggregates, ) - from ..models.extended_session_record_with_children_annotation_agreement import ( - ExtendedSessionRecordWithChildrenAnnotationAgreement, + from ..models.extended_read_session_record_with_children_annotation_agreement import ( + ExtendedReadSessionRecordWithChildrenAnnotationAgreement, ) - from ..models.extended_session_record_with_children_annotations import ( - ExtendedSessionRecordWithChildrenAnnotations, + from ..models.extended_read_session_record_with_children_annotations import ( + ExtendedReadSessionRecordWithChildrenAnnotations, ) - from ..models.extended_session_record_with_children_dataset_metadata import ( - ExtendedSessionRecordWithChildrenDatasetMetadata, + from ..models.extended_read_session_record_with_children_dataset_metadata import ( + ExtendedReadSessionRecordWithChildrenDatasetMetadata, ) - from ..models.extended_session_record_with_children_feedback_rating_info import ( - ExtendedSessionRecordWithChildrenFeedbackRatingInfo, + from ..models.extended_read_session_record_with_children_feedback_rating_info import ( + ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo, ) - from ..models.extended_session_record_with_children_files_type_0 import ( - ExtendedSessionRecordWithChildrenFilesType0, + from ..models.extended_read_session_record_with_children_files_type_0 import ( + ExtendedReadSessionRecordWithChildrenFilesType0, ) - from ..models.extended_session_record_with_children_metric_info_type_0 import ( - ExtendedSessionRecordWithChildrenMetricInfoType0, + from ..models.extended_read_session_record_with_children_metric_info_type_0 import ( + ExtendedReadSessionRecordWithChildrenMetricInfoType0, ) - from ..models.extended_session_record_with_children_user_metadata import ( - ExtendedSessionRecordWithChildrenUserMetadata, + from ..models.extended_read_session_record_with_children_user_metadata import ( + ExtendedReadSessionRecordWithChildrenUserMetadata, ) from ..models.extended_trace_record_with_children import ExtendedTraceRecordWithChildren from ..models.file_content_part import FileContentPart from ..models.message import Message from ..models.metrics import Metrics + from ..models.stub_trace_record import StubTraceRecord from ..models.text_content_part import TextContentPart d = dict(src_dict) @@ -553,15 +574,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: run_id = d.pop("run_id") - _traces = d.pop("traces", UNSET) - traces: list[ExtendedTraceRecordWithChildren] | Unset = UNSET - if _traces is not UNSET: - traces = [] - for traces_item_data in _traces: - traces_item = ExtendedTraceRecordWithChildren.from_dict(traces_item_data) - - traces.append(traces_item) - type_ = cast(Literal["session"] | Unset, d.pop("type", UNSET)) if type_ != "session" and not isinstance(type_, Unset): raise ValueError(f"type must match const 'session', got '{type_}'") @@ -822,11 +834,11 @@ def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextCo created_at = datetime.datetime.fromisoformat(_created_at) _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedSessionRecordWithChildrenUserMetadata | Unset + user_metadata: ExtendedReadSessionRecordWithChildrenUserMetadata | Unset if isinstance(_user_metadata, Unset): user_metadata = UNSET else: - user_metadata = ExtendedSessionRecordWithChildrenUserMetadata.from_dict(_user_metadata) + user_metadata = ExtendedReadSessionRecordWithChildrenUserMetadata.from_dict(_user_metadata) tags = cast(list[str], d.pop("tags", UNSET)) @@ -874,11 +886,11 @@ def _parse_dataset_output(data: object) -> None | str | Unset: dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedSessionRecordWithChildrenDatasetMetadata | Unset + dataset_metadata: ExtendedReadSessionRecordWithChildrenDatasetMetadata | Unset if isinstance(_dataset_metadata, Unset): dataset_metadata = UNSET else: - dataset_metadata = ExtendedSessionRecordWithChildrenDatasetMetadata.from_dict(_dataset_metadata) + dataset_metadata = ExtendedReadSessionRecordWithChildrenDatasetMetadata.from_dict(_dataset_metadata) def _parse_session_id(data: object) -> None | str | Unset: if data is None: @@ -943,18 +955,20 @@ def _parse_session_batch_id(data: object) -> None | str | Unset: session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedSessionRecordWithChildrenFeedbackRatingInfo | Unset + feedback_rating_info: ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo | Unset if isinstance(_feedback_rating_info, Unset): feedback_rating_info = UNSET else: - feedback_rating_info = ExtendedSessionRecordWithChildrenFeedbackRatingInfo.from_dict(_feedback_rating_info) + feedback_rating_info = ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo.from_dict( + _feedback_rating_info + ) _annotations = d.pop("annotations", UNSET) - annotations: ExtendedSessionRecordWithChildrenAnnotations | Unset + annotations: ExtendedReadSessionRecordWithChildrenAnnotations | Unset if isinstance(_annotations, Unset): annotations = UNSET else: - annotations = ExtendedSessionRecordWithChildrenAnnotations.from_dict(_annotations) + annotations = ExtendedReadSessionRecordWithChildrenAnnotations.from_dict(_annotations) file_ids = cast(list[str], d.pop("file_ids", UNSET)) @@ -968,20 +982,22 @@ def _parse_session_batch_id(data: object) -> None | str | Unset: file_modalities.append(file_modalities_item) _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedSessionRecordWithChildrenAnnotationAggregates | Unset + annotation_aggregates: ExtendedReadSessionRecordWithChildrenAnnotationAggregates | Unset if isinstance(_annotation_aggregates, Unset): annotation_aggregates = UNSET else: - annotation_aggregates = ExtendedSessionRecordWithChildrenAnnotationAggregates.from_dict( + annotation_aggregates = ExtendedReadSessionRecordWithChildrenAnnotationAggregates.from_dict( _annotation_aggregates ) _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedSessionRecordWithChildrenAnnotationAgreement | Unset + annotation_agreement: ExtendedReadSessionRecordWithChildrenAnnotationAgreement | Unset if isinstance(_annotation_agreement, Unset): annotation_agreement = UNSET else: - annotation_agreement = ExtendedSessionRecordWithChildrenAnnotationAgreement.from_dict(_annotation_agreement) + annotation_agreement = ExtendedReadSessionRecordWithChildrenAnnotationAgreement.from_dict( + _annotation_agreement + ) def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: if data is None: @@ -1007,7 +1023,7 @@ def _parse_fully_annotated(data: object) -> bool | None | Unset: error_message = d.pop("error_message", UNSET) - def _parse_metric_info(data: object) -> ExtendedSessionRecordWithChildrenMetricInfoType0 | None | Unset: + def _parse_metric_info(data: object) -> ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1015,16 +1031,16 @@ def _parse_metric_info(data: object) -> ExtendedSessionRecordWithChildrenMetricI try: if not isinstance(data, dict): raise TypeError() - metric_info_type_0 = ExtendedSessionRecordWithChildrenMetricInfoType0.from_dict(data) + metric_info_type_0 = ExtendedReadSessionRecordWithChildrenMetricInfoType0.from_dict(data) return metric_info_type_0 except: # noqa: E722 pass - return cast(ExtendedSessionRecordWithChildrenMetricInfoType0 | None | Unset, data) + return cast(ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset, data) metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - def _parse_files(data: object) -> ExtendedSessionRecordWithChildrenFilesType0 | None | Unset: + def _parse_files(data: object) -> ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1032,12 +1048,12 @@ def _parse_files(data: object) -> ExtendedSessionRecordWithChildrenFilesType0 | try: if not isinstance(data, dict): raise TypeError() - files_type_0 = ExtendedSessionRecordWithChildrenFilesType0.from_dict(data) + files_type_0 = ExtendedReadSessionRecordWithChildrenFilesType0.from_dict(data) return files_type_0 except: # noqa: E722 pass - return cast(ExtendedSessionRecordWithChildrenFilesType0 | None | Unset, data) + return cast(ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset, data) files = _parse_files(d.pop("files", UNSET)) @@ -1059,11 +1075,99 @@ def _parse_num_traces(data: object) -> int | None | Unset: num_traces = _parse_num_traces(d.pop("num_traces", UNSET)) - extended_session_record_with_children = cls( + _traces = d.pop("traces", UNSET) + traces: list[ExtendedTraceRecordWithChildren | StubTraceRecord] | Unset = UNSET + if _traces is not UNSET: + traces = [] + for traces_item_data in _traces: + + def _parse_traces_item(data: object) -> ExtendedTraceRecordWithChildren | StubTraceRecord: + # Discriminator-aware parsing for Extended*Record types + if isinstance(data, dict) and "type" in data: + type_value = data.get("type") + + # Hardcoded discriminator mapping for Extended*Record types + if type_value == "trace": + try: + from ..models.extended_trace_record import ExtendedTraceRecord + + return ExtendedTraceRecord.from_dict(data) + except: # noqa: E722 + pass + elif type_value == "agent": + try: + from ..models.extended_agent_span_record import ExtendedAgentSpanRecord + + return ExtendedAgentSpanRecord.from_dict(data) + except: # noqa: E722 + pass + elif type_value == "workflow": + try: + from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord + + return ExtendedWorkflowSpanRecord.from_dict(data) + except: # noqa: E722 + pass + elif type_value == "llm": + try: + from ..models.extended_llm_span_record import ExtendedLlmSpanRecord + + return ExtendedLlmSpanRecord.from_dict(data) + except: # noqa: E722 + pass + elif type_value == "tool": + try: + from ..models.extended_tool_span_record import ExtendedToolSpanRecord + + return ExtendedToolSpanRecord.from_dict(data) + except: # noqa: E722 + pass + elif type_value == "retriever": + try: + from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord + + return ExtendedRetrieverSpanRecord.from_dict(data) + except: # noqa: E722 + pass + elif type_value == "session": + try: + from ..models.extended_session_record import ExtendedSessionRecord + + return ExtendedSessionRecord.from_dict(data) + except: # noqa: E722 + pass + + # Fallback to standard union parsing + try: + if not isinstance(data, dict): + raise TypeError() + traces_item_type_0 = ExtendedTraceRecordWithChildren.from_dict(data) + + return traces_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + traces_item_type_1 = StubTraceRecord.from_dict(data) + + return traces_item_type_1 + except: # noqa: E722 + pass + # If we reach here, none of the parsers succeeded + discriminator_info = ( + f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" + ) + raise ValueError(f"Could not parse union type for traces_item{discriminator_info}") + + traces_item = _parse_traces_item(traces_item_data) + + traces.append(traces_item) + + extended_read_session_record_with_children = cls( id=id, project_id=project_id, run_id=run_id, - traces=traces, type_=type_, input_=input_, redacted_input=redacted_input, @@ -1100,10 +1204,11 @@ def _parse_num_traces(data: object) -> int | None | Unset: files=files, previous_session_id=previous_session_id, num_traces=num_traces, + traces=traces, ) - extended_session_record_with_children.additional_properties = d - return extended_session_record_with_children + extended_read_session_record_with_children.additional_properties = d + return extended_read_session_record_with_children @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py similarity index 79% rename from src/splunk_ao/resources/models/extended_session_record_with_children_annotation_aggregates.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py index 130bb475..6af26898 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_annotation_aggregates.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py @@ -10,11 +10,11 @@ from ..models.annotation_aggregate import AnnotationAggregate -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenAnnotationAggregates") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotationAggregates") @_attrs_define -class ExtendedSessionRecordWithChildrenAnnotationAggregates: +class ExtendedReadSessionRecordWithChildrenAnnotationAggregates: """Annotation aggregate information keyed by template ID""" additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) @@ -32,7 +32,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.annotation_aggregate import AnnotationAggregate d = dict(src_dict) - extended_session_record_with_children_annotation_aggregates = cls() + extended_read_session_record_with_children_annotation_aggregates = cls() additional_properties = {} for prop_name, prop_dict in d.items(): @@ -40,8 +40,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties[prop_name] = additional_property - extended_session_record_with_children_annotation_aggregates.additional_properties = additional_properties - return extended_session_record_with_children_annotation_aggregates + extended_read_session_record_with_children_annotation_aggregates.additional_properties = additional_properties + return extended_read_session_record_with_children_annotation_aggregates @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_annotation_agreement.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py similarity index 73% rename from src/splunk_ao/resources/models/extended_session_record_with_children_annotation_agreement.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py index 682353bd..4ed59025 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_annotation_agreement.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenAnnotationAgreement") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotationAgreement") @_attrs_define -class ExtendedSessionRecordWithChildrenAnnotationAgreement: +class ExtendedReadSessionRecordWithChildrenAnnotationAgreement: """Annotation agreement scores keyed by template ID""" additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - extended_session_record_with_children_annotation_agreement = cls() + extended_read_session_record_with_children_annotation_agreement = cls() - extended_session_record_with_children_annotation_agreement.additional_properties = d - return extended_session_record_with_children_annotation_agreement + extended_read_session_record_with_children_annotation_agreement.additional_properties = d + return extended_read_session_record_with_children_annotation_agreement @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_annotations.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py similarity index 50% rename from src/splunk_ao/resources/models/extended_session_record_with_children_annotations.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py index 863897ab..9c525559 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_annotations.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py @@ -7,19 +7,19 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.extended_session_record_with_children_annotations_additional_property import ( - ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty, + from ..models.extended_read_session_record_with_children_annotations_additional_property import ( + ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty, ) -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenAnnotations") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotations") @_attrs_define -class ExtendedSessionRecordWithChildrenAnnotations: +class ExtendedReadSessionRecordWithChildrenAnnotations: """Annotations keyed by template ID and annotator ID""" - additional_properties: dict[str, ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty] = _attrs_field( + additional_properties: dict[str, ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty] = _attrs_field( init=False, factory=dict ) @@ -33,30 +33,32 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_session_record_with_children_annotations_additional_property import ( - ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty, + from ..models.extended_read_session_record_with_children_annotations_additional_property import ( + ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty, ) d = dict(src_dict) - extended_session_record_with_children_annotations = cls() + extended_read_session_record_with_children_annotations = cls() additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty.from_dict(prop_dict) + additional_property = ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty.from_dict( + prop_dict + ) additional_properties[prop_name] = additional_property - extended_session_record_with_children_annotations.additional_properties = additional_properties - return extended_session_record_with_children_annotations + extended_read_session_record_with_children_annotations.additional_properties = additional_properties + return extended_read_session_record_with_children_annotations @property def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty: + def __getitem__(self, key: str) -> ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty: return self.additional_properties[key] - def __setitem__(self, key: str, value: ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty) -> None: + def __setitem__(self, key: str, value: ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py similarity index 78% rename from src/splunk_ao/resources/models/extended_session_record_with_children_annotations_additional_property.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py index 9de3018a..f0e63581 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_annotations_additional_property.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py @@ -10,11 +10,11 @@ from ..models.annotation_rating_info import AnnotationRatingInfo -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty") @_attrs_define -class ExtendedSessionRecordWithChildrenAnnotationsAdditionalProperty: +class ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty: """ """ additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) @@ -32,7 +32,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.annotation_rating_info import AnnotationRatingInfo d = dict(src_dict) - extended_session_record_with_children_annotations_additional_property = cls() + extended_read_session_record_with_children_annotations_additional_property = cls() additional_properties = {} for prop_name, prop_dict in d.items(): @@ -40,10 +40,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties[prop_name] = additional_property - extended_session_record_with_children_annotations_additional_property.additional_properties = ( + extended_read_session_record_with_children_annotations_additional_property.additional_properties = ( additional_properties ) - return extended_session_record_with_children_annotations_additional_property + return extended_read_session_record_with_children_annotations_additional_property @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_dataset_metadata.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py similarity index 74% rename from src/splunk_ao/resources/models/extended_session_record_with_children_dataset_metadata.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py index 11bbdccb..8998fd1e 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_dataset_metadata.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenDatasetMetadata") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenDatasetMetadata") @_attrs_define -class ExtendedSessionRecordWithChildrenDatasetMetadata: +class ExtendedReadSessionRecordWithChildrenDatasetMetadata: """Metadata from the dataset associated with this trace""" additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - extended_session_record_with_children_dataset_metadata = cls() + extended_read_session_record_with_children_dataset_metadata = cls() - extended_session_record_with_children_dataset_metadata.additional_properties = d - return extended_session_record_with_children_dataset_metadata + extended_read_session_record_with_children_dataset_metadata.additional_properties = d + return extended_read_session_record_with_children_dataset_metadata @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py similarity index 79% rename from src/splunk_ao/resources/models/extended_session_record_with_children_feedback_rating_info.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py index d62f1b30..bd469b72 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_feedback_rating_info.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py @@ -10,11 +10,11 @@ from ..models.feedback_rating_info import FeedbackRatingInfo -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenFeedbackRatingInfo") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo") @_attrs_define -class ExtendedSessionRecordWithChildrenFeedbackRatingInfo: +class ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo: """Feedback information related to the record""" additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) @@ -32,7 +32,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.feedback_rating_info import FeedbackRatingInfo d = dict(src_dict) - extended_session_record_with_children_feedback_rating_info = cls() + extended_read_session_record_with_children_feedback_rating_info = cls() additional_properties = {} for prop_name, prop_dict in d.items(): @@ -40,8 +40,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties[prop_name] = additional_property - extended_session_record_with_children_feedback_rating_info.additional_properties = additional_properties - return extended_session_record_with_children_feedback_rating_info + extended_read_session_record_with_children_feedback_rating_info.additional_properties = additional_properties + return extended_read_session_record_with_children_feedback_rating_info @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_files_type_0.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py similarity index 80% rename from src/splunk_ao/resources/models/extended_session_record_with_children_files_type_0.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py index 584c4e0c..2dca0a64 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_files_type_0.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py @@ -10,11 +10,11 @@ from ..models.file_metadata import FileMetadata -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenFilesType0") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenFilesType0") @_attrs_define -class ExtendedSessionRecordWithChildrenFilesType0: +class ExtendedReadSessionRecordWithChildrenFilesType0: """ """ additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) @@ -32,7 +32,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.file_metadata import FileMetadata d = dict(src_dict) - extended_session_record_with_children_files_type_0 = cls() + extended_read_session_record_with_children_files_type_0 = cls() additional_properties = {} for prop_name, prop_dict in d.items(): @@ -40,8 +40,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties[prop_name] = additional_property - extended_session_record_with_children_files_type_0.additional_properties = additional_properties - return extended_session_record_with_children_files_type_0 + extended_read_session_record_with_children_files_type_0.additional_properties = additional_properties + return extended_read_session_record_with_children_files_type_0 @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py similarity index 94% rename from src/splunk_ao/resources/models/extended_session_record_with_children_metric_info_type_0.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py index 2cce9130..b4e5bdd7 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_metric_info_type_0.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py @@ -17,11 +17,11 @@ from ..models.metric_success import MetricSuccess -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenMetricInfoType0") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenMetricInfoType0") @_attrs_define -class ExtendedSessionRecordWithChildrenMetricInfoType0: +class ExtendedReadSessionRecordWithChildrenMetricInfoType0: """ """ additional_properties: dict[ @@ -78,7 +78,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metric_success import MetricSuccess d = dict(src_dict) - extended_session_record_with_children_metric_info_type_0 = cls() + extended_read_session_record_with_children_metric_info_type_0 = cls() additional_properties = {} for prop_name, prop_dict in d.items(): @@ -161,8 +161,8 @@ def _parse_additional_property( additional_properties[prop_name] = additional_property - extended_session_record_with_children_metric_info_type_0.additional_properties = additional_properties - return extended_session_record_with_children_metric_info_type_0 + extended_read_session_record_with_children_metric_info_type_0.additional_properties = additional_properties + return extended_read_session_record_with_children_metric_info_type_0 @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/extended_session_record_with_children_user_metadata.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py similarity index 75% rename from src/splunk_ao/resources/models/extended_session_record_with_children_user_metadata.py rename to src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py index b9b99187..4413ae65 100644 --- a/src/splunk_ao/resources/models/extended_session_record_with_children_user_metadata.py +++ b/src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="ExtendedSessionRecordWithChildrenUserMetadata") +T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenUserMetadata") @_attrs_define -class ExtendedSessionRecordWithChildrenUserMetadata: +class ExtendedReadSessionRecordWithChildrenUserMetadata: """Metadata associated with this trace or span.""" additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - extended_session_record_with_children_user_metadata = cls() + extended_read_session_record_with_children_user_metadata = cls() - extended_session_record_with_children_user_metadata.additional_properties = d - return extended_session_record_with_children_user_metadata + extended_read_session_record_with_children_user_metadata.additional_properties = d + return extended_read_session_record_with_children_user_metadata @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/log_records_column_info.py b/src/splunk_ao/resources/models/log_records_column_info.py index a6d4b783..eab95bcb 100644 --- a/src/splunk_ao/resources/models/log_records_column_info.py +++ b/src/splunk_ao/resources/models/log_records_column_info.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: from ..models.metric_threshold import MetricThreshold - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig T = TypeVar("T", bound="LogRecordsColumnInfo") @@ -46,7 +46,8 @@ class LogRecordsColumnInfo: 'average'). metric_key_alias (None | str | Unset): Alternate metric key for this column. When scorer UUIDs are used as column IDs, this holds the legacy metric_name string for dual-key ClickHouse query fallback. - scorer_config (None | ScorerConfig | Unset): For metric columns only: Scorer config that produced the metric. + scorer_config (None | RuntimeScorerConfig | Unset): For metric columns only: Scorer config that produced the + metric. scorer_id (None | str | Unset): For metric columns only: Scorer id that produced the metric. This is deprecated and will be removed in future versions. insight_type (InsightType | None | Unset): Insight type. @@ -72,7 +73,7 @@ class LogRecordsColumnInfo: is_optional: bool | Unset = False roll_up_method: None | str | Unset = UNSET metric_key_alias: None | str | Unset = UNSET - scorer_config: None | ScorerConfig | Unset = UNSET + scorer_config: None | RuntimeScorerConfig | Unset = UNSET scorer_id: None | str | Unset = UNSET insight_type: InsightType | None | Unset = UNSET filter_type: LogRecordsFilterType | None | Unset = UNSET @@ -82,7 +83,7 @@ class LogRecordsColumnInfo: def to_dict(self) -> dict[str, Any]: from ..models.metric_threshold import MetricThreshold - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig id = self.id @@ -161,7 +162,7 @@ def to_dict(self) -> dict[str, Any]: scorer_config: dict[str, Any] | None | Unset if isinstance(self.scorer_config, Unset): scorer_config = UNSET - elif isinstance(self.scorer_config, ScorerConfig): + elif isinstance(self.scorer_config, RuntimeScorerConfig): scorer_config = self.scorer_config.to_dict() else: scorer_config = self.scorer_config @@ -251,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metric_threshold import MetricThreshold - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig d = dict(src_dict) id = d.pop("id") @@ -371,7 +372,7 @@ def _parse_metric_key_alias(data: object) -> None | str | Unset: metric_key_alias = _parse_metric_key_alias(d.pop("metric_key_alias", UNSET)) - def _parse_scorer_config(data: object) -> None | ScorerConfig | Unset: + def _parse_scorer_config(data: object) -> None | RuntimeScorerConfig | Unset: if data is None: return data if isinstance(data, Unset): @@ -379,12 +380,12 @@ def _parse_scorer_config(data: object) -> None | ScorerConfig | Unset: try: if not isinstance(data, dict): raise TypeError() - scorer_config_type_0 = ScorerConfig.from_dict(data) + scorer_config_type_0 = RuntimeScorerConfig.from_dict(data) return scorer_config_type_0 except: # noqa: E722 pass - return cast(None | ScorerConfig | Unset, data) + return cast(None | RuntimeScorerConfig | Unset, data) scorer_config = _parse_scorer_config(d.pop("scorer_config", UNSET)) diff --git a/src/splunk_ao/resources/models/metric_not_computed.py b/src/splunk_ao/resources/models/metric_not_computed.py index fb7b0f03..4847f286 100644 --- a/src/splunk_ao/resources/models/metric_not_computed.py +++ b/src/splunk_ao/resources/models/metric_not_computed.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Literal, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -9,6 +9,10 @@ from ..models.scorer_type import ScorerType from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.standard_error import StandardError + + T = TypeVar("T", bound="MetricNotComputed") @@ -20,15 +24,21 @@ class MetricNotComputed: scorer_type (None | ScorerType | Unset): metric_key_alias (None | str | Unset): message (str | Unset): Default: 'Metric not computed.'. + ems_error_code (int | None | Unset): EMS error code from errors.yaml catalog for this not-computed reason + standard_error (None | StandardError | Unset): Structured EMS error resolved on-the-fly from errors.yaml catalog """ status_type: Literal["not_computed"] | Unset = "not_computed" scorer_type: None | ScorerType | Unset = UNSET metric_key_alias: None | str | Unset = UNSET message: str | Unset = "Metric not computed." + ems_error_code: int | None | Unset = UNSET + standard_error: None | StandardError | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.standard_error import StandardError + status_type = self.status_type scorer_type: None | str | Unset @@ -47,6 +57,20 @@ def to_dict(self) -> dict[str, Any]: message = self.message + ems_error_code: int | None | Unset + if isinstance(self.ems_error_code, Unset): + ems_error_code = UNSET + else: + ems_error_code = self.ems_error_code + + standard_error: dict[str, Any] | None | Unset + if isinstance(self.standard_error, Unset): + standard_error = UNSET + elif isinstance(self.standard_error, StandardError): + standard_error = self.standard_error.to_dict() + else: + standard_error = self.standard_error + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -58,11 +82,17 @@ def to_dict(self) -> dict[str, Any]: field_dict["metric_key_alias"] = metric_key_alias if message is not UNSET: field_dict["message"] = message + if ems_error_code is not UNSET: + field_dict["ems_error_code"] = ems_error_code + if standard_error is not UNSET: + field_dict["standard_error"] = standard_error return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.standard_error import StandardError + d = dict(src_dict) status_type = cast(Literal["not_computed"] | Unset, d.pop("status_type", UNSET)) if status_type != "not_computed" and not isinstance(status_type, Unset): @@ -96,8 +126,39 @@ def _parse_metric_key_alias(data: object) -> None | str | Unset: message = d.pop("message", UNSET) + def _parse_ems_error_code(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + ems_error_code = _parse_ems_error_code(d.pop("ems_error_code", UNSET)) + + def _parse_standard_error(data: object) -> None | StandardError | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + standard_error_type_0 = StandardError.from_dict(data) + + return standard_error_type_0 + except: # noqa: E722 + pass + return cast(None | StandardError | Unset, data) + + standard_error = _parse_standard_error(d.pop("standard_error", UNSET)) + metric_not_computed = cls( - status_type=status_type, scorer_type=scorer_type, metric_key_alias=metric_key_alias, message=message + status_type=status_type, + scorer_type=scorer_type, + metric_key_alias=metric_key_alias, + message=message, + ems_error_code=ems_error_code, + standard_error=standard_error, ) metric_not_computed.additional_properties = d diff --git a/src/splunk_ao/resources/models/metric_settings_request.py b/src/splunk_ao/resources/models/metric_settings_request.py index 2888ed0a..dd0b652a 100644 --- a/src/splunk_ao/resources/models/metric_settings_request.py +++ b/src/splunk_ao/resources/models/metric_settings_request.py @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter @@ -20,11 +20,11 @@ class MetricSettingsRequest: """ Attributes: - scorers (list[ScorerConfig] | None | Unset): List of Galileo scorers to enable. + scorers (list[RuntimeScorerConfig] | None | Unset): List of Galileo scorers to enable. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. """ - scorers: list[ScorerConfig] | None | Unset = UNSET + scorers: list[RuntimeScorerConfig] | None | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -65,12 +65,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter d = dict(src_dict) - def _parse_scorers(data: object) -> list[ScorerConfig] | None | Unset: + def _parse_scorers(data: object) -> list[RuntimeScorerConfig] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -81,14 +81,14 @@ def _parse_scorers(data: object) -> list[ScorerConfig] | None | Unset: scorers_type_0 = [] _scorers_type_0 = data for scorers_type_0_item_data in _scorers_type_0: - scorers_type_0_item = ScorerConfig.from_dict(scorers_type_0_item_data) + scorers_type_0_item = RuntimeScorerConfig.from_dict(scorers_type_0_item_data) scorers_type_0.append(scorers_type_0_item) return scorers_type_0 except: # noqa: E722 pass - return cast(list[ScorerConfig] | None | Unset, data) + return cast(list[RuntimeScorerConfig] | None | Unset, data) scorers = _parse_scorers(d.pop("scorers", UNSET)) diff --git a/src/splunk_ao/resources/models/metric_settings_response.py b/src/splunk_ao/resources/models/metric_settings_response.py index a26761be..a2119c84 100644 --- a/src/splunk_ao/resources/models/metric_settings_response.py +++ b/src/splunk_ao/resources/models/metric_settings_response.py @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter @@ -20,11 +20,11 @@ class MetricSettingsResponse: """ Attributes: - scorers (list[ScorerConfig]): + scorers (list[RuntimeScorerConfig]): segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. """ - scorers: list[ScorerConfig] + scorers: list[RuntimeScorerConfig] segment_filters: list[SegmentFilter] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,14 +56,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter d = dict(src_dict) scorers = [] _scorers = d.pop("scorers") for scorers_item_data in _scorers: - scorers_item = ScorerConfig.from_dict(scorers_item_data) + scorers_item = RuntimeScorerConfig.from_dict(scorers_item_data) scorers.append(scorers_item) diff --git a/src/splunk_ao/resources/models/model.py b/src/splunk_ao/resources/models/model.py index ee196bb5..05eaff50 100644 --- a/src/splunk_ao/resources/models/model.py +++ b/src/splunk_ao/resources/models/model.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -9,6 +10,7 @@ from ..models.content_modality import ContentModality from ..models.llm_integration import LLMIntegration from ..models.model_cost_by import ModelCostBy +from ..models.model_lifecycle_state import ModelLifecycleState from ..types import UNSET, Unset if TYPE_CHECKING: @@ -27,6 +29,10 @@ class Model: name (str): alias (str): integration (LLMIntegration | Unset): + lifecycle_state (ModelLifecycleState | Unset): + replacement_alias (None | str | Unset): + deprecation_date (datetime.date | None | Unset): + retirement_date (datetime.date | None | Unset): user_role (None | str | Unset): assistant_role (None | str | Unset): system_supported (bool | Unset): Default: False. @@ -55,6 +61,10 @@ class Model: name: str alias: str integration: LLMIntegration | Unset = UNSET + lifecycle_state: ModelLifecycleState | Unset = UNSET + replacement_alias: None | str | Unset = UNSET + deprecation_date: datetime.date | None | Unset = UNSET + retirement_date: datetime.date | None | Unset = UNSET user_role: None | str | Unset = UNSET assistant_role: None | str | Unset = UNSET system_supported: bool | Unset = False @@ -89,6 +99,32 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.integration, Unset): integration = self.integration.value + lifecycle_state: str | Unset = UNSET + if not isinstance(self.lifecycle_state, Unset): + lifecycle_state = self.lifecycle_state.value + + replacement_alias: None | str | Unset + if isinstance(self.replacement_alias, Unset): + replacement_alias = UNSET + else: + replacement_alias = self.replacement_alias + + deprecation_date: None | str | Unset + if isinstance(self.deprecation_date, Unset): + deprecation_date = UNSET + elif isinstance(self.deprecation_date, datetime.date): + deprecation_date = self.deprecation_date.isoformat() + else: + deprecation_date = self.deprecation_date + + retirement_date: None | str | Unset + if isinstance(self.retirement_date, Unset): + retirement_date = UNSET + elif isinstance(self.retirement_date, datetime.date): + retirement_date = self.retirement_date.isoformat() + else: + retirement_date = self.retirement_date + user_role: None | str | Unset if isinstance(self.user_role, Unset): user_role = UNSET @@ -185,6 +221,14 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({"name": name, "alias": alias}) if integration is not UNSET: field_dict["integration"] = integration + if lifecycle_state is not UNSET: + field_dict["lifecycle_state"] = lifecycle_state + if replacement_alias is not UNSET: + field_dict["replacement_alias"] = replacement_alias + if deprecation_date is not UNSET: + field_dict["deprecation_date"] = deprecation_date + if retirement_date is not UNSET: + field_dict["retirement_date"] = retirement_date if user_role is not UNSET: field_dict["user_role"] = user_role if assistant_role is not UNSET: @@ -246,6 +290,56 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: integration = LLMIntegration(_integration) + _lifecycle_state = d.pop("lifecycle_state", UNSET) + lifecycle_state: ModelLifecycleState | Unset + if isinstance(_lifecycle_state, Unset): + lifecycle_state = UNSET + else: + lifecycle_state = ModelLifecycleState(_lifecycle_state) + + def _parse_replacement_alias(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + replacement_alias = _parse_replacement_alias(d.pop("replacement_alias", UNSET)) + + def _parse_deprecation_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + deprecation_date_type_0 = datetime.date.fromisoformat(data) + + return deprecation_date_type_0 + except: # noqa: E722 + pass + return cast(datetime.date | None | Unset, data) + + deprecation_date = _parse_deprecation_date(d.pop("deprecation_date", UNSET)) + + def _parse_retirement_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + retirement_date_type_0 = datetime.date.fromisoformat(data) + + return retirement_date_type_0 + except: # noqa: E722 + pass + return cast(datetime.date | None | Unset, data) + + retirement_date = _parse_retirement_date(d.pop("retirement_date", UNSET)) + def _parse_user_role(data: object) -> None | str | Unset: if data is None: return data @@ -386,6 +480,10 @@ def _parse_input_map(data: object) -> InputMap | None | Unset: name=name, alias=alias, integration=integration, + lifecycle_state=lifecycle_state, + replacement_alias=replacement_alias, + deprecation_date=deprecation_date, + retirement_date=retirement_date, user_role=user_role, assistant_role=assistant_role, system_supported=system_supported, diff --git a/src/splunk_ao/resources/models/model_lifecycle_state.py b/src/splunk_ao/resources/models/model_lifecycle_state.py new file mode 100644 index 00000000..e59c0349 --- /dev/null +++ b/src/splunk_ao/resources/models/model_lifecycle_state.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ModelLifecycleState(str, Enum): + ACTIVE = "active" + DEPRECATED = "deprecated" + RETIRED = "retired" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/model_properties.py b/src/splunk_ao/resources/models/model_properties.py index cf6660e1..46f7ad04 100644 --- a/src/splunk_ao/resources/models/model_properties.py +++ b/src/splunk_ao/resources/models/model_properties.py @@ -1,12 +1,14 @@ from __future__ import annotations +import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..models.content_modality import ContentModality +from ..models.model_lifecycle_state import ModelLifecycleState from ..models.multimodal_capability import MultimodalCapability from ..types import UNSET, Unset @@ -20,12 +22,20 @@ class ModelProperties: alias (str): name (str): input_modalities (list[ContentModality]): + lifecycle_state (ModelLifecycleState | Unset): + replacement_alias (None | str | Unset): + deprecation_date (datetime.date | None | Unset): + retirement_date (datetime.date | None | Unset): multimodal_capabilities (list[MultimodalCapability] | Unset): """ alias: str name: str input_modalities: list[ContentModality] + lifecycle_state: ModelLifecycleState | Unset = UNSET + replacement_alias: None | str | Unset = UNSET + deprecation_date: datetime.date | None | Unset = UNSET + retirement_date: datetime.date | None | Unset = UNSET multimodal_capabilities: list[MultimodalCapability] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -39,6 +49,32 @@ def to_dict(self) -> dict[str, Any]: input_modalities_item = input_modalities_item_data.value input_modalities.append(input_modalities_item) + lifecycle_state: str | Unset = UNSET + if not isinstance(self.lifecycle_state, Unset): + lifecycle_state = self.lifecycle_state.value + + replacement_alias: None | str | Unset + if isinstance(self.replacement_alias, Unset): + replacement_alias = UNSET + else: + replacement_alias = self.replacement_alias + + deprecation_date: None | str | Unset + if isinstance(self.deprecation_date, Unset): + deprecation_date = UNSET + elif isinstance(self.deprecation_date, datetime.date): + deprecation_date = self.deprecation_date.isoformat() + else: + deprecation_date = self.deprecation_date + + retirement_date: None | str | Unset + if isinstance(self.retirement_date, Unset): + retirement_date = UNSET + elif isinstance(self.retirement_date, datetime.date): + retirement_date = self.retirement_date.isoformat() + else: + retirement_date = self.retirement_date + multimodal_capabilities: list[str] | Unset = UNSET if not isinstance(self.multimodal_capabilities, Unset): multimodal_capabilities = [] @@ -49,6 +85,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"alias": alias, "name": name, "input_modalities": input_modalities}) + if lifecycle_state is not UNSET: + field_dict["lifecycle_state"] = lifecycle_state + if replacement_alias is not UNSET: + field_dict["replacement_alias"] = replacement_alias + if deprecation_date is not UNSET: + field_dict["deprecation_date"] = deprecation_date + if retirement_date is not UNSET: + field_dict["retirement_date"] = retirement_date if multimodal_capabilities is not UNSET: field_dict["multimodal_capabilities"] = multimodal_capabilities @@ -68,6 +112,56 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: input_modalities.append(input_modalities_item) + _lifecycle_state = d.pop("lifecycle_state", UNSET) + lifecycle_state: ModelLifecycleState | Unset + if isinstance(_lifecycle_state, Unset): + lifecycle_state = UNSET + else: + lifecycle_state = ModelLifecycleState(_lifecycle_state) + + def _parse_replacement_alias(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + replacement_alias = _parse_replacement_alias(d.pop("replacement_alias", UNSET)) + + def _parse_deprecation_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + deprecation_date_type_0 = datetime.date.fromisoformat(data) + + return deprecation_date_type_0 + except: # noqa: E722 + pass + return cast(datetime.date | None | Unset, data) + + deprecation_date = _parse_deprecation_date(d.pop("deprecation_date", UNSET)) + + def _parse_retirement_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + retirement_date_type_0 = datetime.date.fromisoformat(data) + + return retirement_date_type_0 + except: # noqa: E722 + pass + return cast(datetime.date | None | Unset, data) + + retirement_date = _parse_retirement_date(d.pop("retirement_date", UNSET)) + _multimodal_capabilities = d.pop("multimodal_capabilities", UNSET) multimodal_capabilities: list[MultimodalCapability] | Unset = UNSET if _multimodal_capabilities is not UNSET: @@ -78,7 +172,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: multimodal_capabilities.append(multimodal_capabilities_item) model_properties = cls( - alias=alias, name=name, input_modalities=input_modalities, multimodal_capabilities=multimodal_capabilities + alias=alias, + name=name, + input_modalities=input_modalities, + lifecycle_state=lifecycle_state, + replacement_alias=replacement_alias, + deprecation_date=deprecation_date, + retirement_date=retirement_date, + multimodal_capabilities=multimodal_capabilities, ) model_properties.additional_properties = d diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record.py index 9e43f42f..c71f9110 100644 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record.py +++ b/src/splunk_ao/resources/models/partial_extended_agent_span_record.py @@ -101,6 +101,7 @@ class PartialExtendedAgentSpanRecord: is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. agent_type (AgentType | Unset): + agent_name (None | str | Unset): Name of the agent. """ type_: Literal["agent"] | Unset = "agent" @@ -148,6 +149,7 @@ class PartialExtendedAgentSpanRecord: is_complete: bool | Unset = True step_number: int | None | Unset = UNSET agent_type: AgentType | Unset = UNSET + agent_name: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -454,6 +456,12 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.agent_type, Unset): agent_type = self.agent_type.value + agent_name: None | str | Unset + if isinstance(self.agent_name, Unset): + agent_name = UNSET + else: + agent_name = self.agent_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -539,6 +547,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["step_number"] = step_number if agent_type is not UNSET: field_dict["agent_type"] = agent_type + if agent_name is not UNSET: + field_dict["agent_name"] = agent_name return field_dict @@ -1253,6 +1263,15 @@ def _parse_step_number(data: object) -> int | None | Unset: else: agent_type = AgentType(_agent_type) + def _parse_agent_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) + partial_extended_agent_span_record = cls( type_=type_, input_=input_, @@ -1295,6 +1314,7 @@ def _parse_step_number(data: object) -> int | None | Unset: is_complete=is_complete, step_number=step_number, agent_type=agent_type, + agent_name=agent_name, ) partial_extended_agent_span_record.additional_properties = d diff --git a/src/splunk_ao/resources/models/project_type.py b/src/splunk_ao/resources/models/project_type.py index 84df5f94..b9303182 100644 --- a/src/splunk_ao/resources/models/project_type.py +++ b/src/splunk_ao/resources/models/project_type.py @@ -3,8 +3,6 @@ class ProjectType(str, Enum): GEN_AI = "gen_ai" - LLM_MONITOR = "llm_monitor" - PROMPT_EVALUATION = "prompt_evaluation" PROTECT = "protect" def __str__(self) -> str: diff --git a/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py b/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py index 3e8187d6..73329977 100644 --- a/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py +++ b/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter @@ -21,12 +21,12 @@ class RunScorerSettingsPatchRequest: """ Attributes: run_id (str): ID of the run. - scorers (list[ScorerConfig] | None | Unset): List of Galileo scorers to enable. + scorers (list[RuntimeScorerConfig] | None | Unset): List of Galileo scorers to enable. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. """ run_id: str - scorers: list[ScorerConfig] | None | Unset = UNSET + scorers: list[RuntimeScorerConfig] | None | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -69,13 +69,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter d = dict(src_dict) run_id = d.pop("run_id") - def _parse_scorers(data: object) -> list[ScorerConfig] | None | Unset: + def _parse_scorers(data: object) -> list[RuntimeScorerConfig] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -86,14 +86,14 @@ def _parse_scorers(data: object) -> list[ScorerConfig] | None | Unset: scorers_type_0 = [] _scorers_type_0 = data for scorers_type_0_item_data in _scorers_type_0: - scorers_type_0_item = ScorerConfig.from_dict(scorers_type_0_item_data) + scorers_type_0_item = RuntimeScorerConfig.from_dict(scorers_type_0_item_data) scorers_type_0.append(scorers_type_0_item) return scorers_type_0 except: # noqa: E722 pass - return cast(list[ScorerConfig] | None | Unset, data) + return cast(list[RuntimeScorerConfig] | None | Unset, data) scorers = _parse_scorers(d.pop("scorers", UNSET)) diff --git a/src/splunk_ao/resources/models/run_scorer_settings_response.py b/src/splunk_ao/resources/models/run_scorer_settings_response.py index 39e86f83..7a745302 100644 --- a/src/splunk_ao/resources/models/run_scorer_settings_response.py +++ b/src/splunk_ao/resources/models/run_scorer_settings_response.py @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter @@ -20,12 +20,12 @@ class RunScorerSettingsResponse: """ Attributes: - scorers (list[ScorerConfig]): + scorers (list[RuntimeScorerConfig]): run_id (str): ID of the run. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. """ - scorers: list[ScorerConfig] + scorers: list[RuntimeScorerConfig] run_id: str segment_filters: list[SegmentFilter] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -60,14 +60,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.scorer_config import ScorerConfig + from ..models.runtime_scorer_config import RuntimeScorerConfig from ..models.segment_filter import SegmentFilter d = dict(src_dict) scorers = [] _scorers = d.pop("scorers") for scorers_item_data in _scorers: - scorers_item = ScorerConfig.from_dict(scorers_item_data) + scorers_item = RuntimeScorerConfig.from_dict(scorers_item_data) scorers.append(scorers_item) diff --git a/src/splunk_ao/resources/models/scorer_config.py b/src/splunk_ao/resources/models/runtime_scorer_config.py similarity index 76% rename from src/splunk_ao/resources/models/scorer_config.py rename to src/splunk_ao/resources/models/runtime_scorer_config.py index 1c52cc08..9b20ed33 100644 --- a/src/splunk_ao/resources/models/scorer_config.py +++ b/src/splunk_ao/resources/models/runtime_scorer_config.py @@ -7,7 +7,6 @@ from attrs import field as _attrs_field from ..models.input_type_enum import InputTypeEnum -from ..models.model_type import ModelType from ..models.multimodal_capability import MultimodalCapability from ..models.output_type_enum import OutputTypeEnum from ..models.roll_up_method_display_options import RollUpMethodDisplayOptions @@ -15,82 +14,79 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.base_metric_roll_up_config_db import BaseMetricRollUpConfigDB from ..models.base_scorer_version_db import BaseScorerVersionDB from ..models.metadata_filter import MetadataFilter from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter -T = TypeVar("T", bound="ScorerConfig") +T = TypeVar("T", bound="RuntimeScorerConfig") @_attrs_define -class ScorerConfig: - """Used for configuring a scorer for a scorer job. - - Attributes: - id (str): - scorer_type (ScorerTypes): - model_name (None | str | Unset): - num_judges (int | None | Unset): - filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): List of filters to apply to the - scorer. - scoreable_node_types (list[str] | None | Unset): List of node types that can be scored by this scorer. Defaults - to llm/chat. - cot_enabled (bool | None | Unset): Whether to enable chain of thought for this scorer. Defaults to False for llm - scorers. - output_type (None | OutputTypeEnum | Unset): What type of output to use for model-based scorers (boolean, - categorical, etc.). - input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers - (sessions_normalized, trace_io_only, etc..). - name (None | str | Unset): - model_type (ModelType | None | Unset): Type of model to use for this scorer. slm maps to luna, and llm maps to - plus - scorer_version (BaseScorerVersionDB | None | Unset): ScorerVersion to use for this scorer. If not provided, the - latest version will be used. - multimodal_capabilities (list[MultimodalCapability] | None | Unset): Multimodal capabilities which this scorer - can utilize in its evaluation. - roll_up_method (None | RollUpMethodDisplayOptions | Unset): - score_type (None | str | Unset): Return type of code scorers (e.g., 'bool', 'int', 'float', 'str'). +class RuntimeScorerConfig: + """Hydrated scorer config used at runtime. Never persisted directly. + + Produced by hydrate_scorer_config from a StoredScorerConfig + live DB rows. + + Attributes: + id (str): + scorer_version_id (None | str | Unset): + filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): List of filters to apply to the + scorer. + roll_up_method (None | RollUpMethodDisplayOptions | Unset): + name (None | str | Unset): + scorer_type (None | ScorerTypes | Unset): + model_name (None | str | Unset): + num_judges (int | None | Unset): + scorer_version (BaseScorerVersionDB | None | Unset): ScorerVersion to use for this scorer. If not provided, the + latest version will be used. + scoreable_node_types (list[str] | None | Unset): List of node types that can be scored by this scorer. Defaults + to llm/chat. + cot_enabled (bool | None | Unset): Whether to enable chain of thought for this scorer. Defaults to False for llm + scorers. + output_type (None | OutputTypeEnum | Unset): What type of output to use for model-based scorers (boolean, + categorical, etc.). + input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers + (sessions_normalized, trace_io_only, etc..). + multimodal_capabilities (list[MultimodalCapability] | None | Unset): Multimodal capabilities which this scorer + can utilize in its evaluation. + roll_up_config (BaseMetricRollUpConfigDB | None | Unset): + score_type (None | str | Unset): Return type of code scorers (e.g., 'bool', 'int', 'float', 'str'). """ id: str - scorer_type: ScorerTypes + scorer_version_id: None | str | Unset = UNSET + filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET + roll_up_method: None | RollUpMethodDisplayOptions | Unset = UNSET + name: None | str | Unset = UNSET + scorer_type: None | ScorerTypes | Unset = UNSET model_name: None | str | Unset = UNSET num_judges: int | None | Unset = UNSET - filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET + scorer_version: BaseScorerVersionDB | None | Unset = UNSET scoreable_node_types: list[str] | None | Unset = UNSET cot_enabled: bool | None | Unset = UNSET output_type: None | OutputTypeEnum | Unset = UNSET input_type: InputTypeEnum | None | Unset = UNSET - name: None | str | Unset = UNSET - model_type: ModelType | None | Unset = UNSET - scorer_version: BaseScorerVersionDB | None | Unset = UNSET multimodal_capabilities: list[MultimodalCapability] | None | Unset = UNSET - roll_up_method: None | RollUpMethodDisplayOptions | Unset = UNSET + roll_up_config: BaseMetricRollUpConfigDB | None | Unset = UNSET score_type: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.base_metric_roll_up_config_db import BaseMetricRollUpConfigDB from ..models.base_scorer_version_db import BaseScorerVersionDB from ..models.metadata_filter import MetadataFilter from ..models.node_name_filter import NodeNameFilter id = self.id - scorer_type = self.scorer_type.value - - model_name: None | str | Unset - if isinstance(self.model_name, Unset): - model_name = UNSET + scorer_version_id: None | str | Unset + if isinstance(self.scorer_version_id, Unset): + scorer_version_id = UNSET else: - model_name = self.model_name - - num_judges: int | None | Unset - if isinstance(self.num_judges, Unset): - num_judges = UNSET - else: - num_judges = self.num_judges + scorer_version_id = self.scorer_version_id filters: list[dict[str, Any]] | None | Unset if isinstance(self.filters, Unset): @@ -111,6 +107,48 @@ def to_dict(self) -> dict[str, Any]: else: filters = self.filters + roll_up_method: None | str | Unset + if isinstance(self.roll_up_method, Unset): + roll_up_method = UNSET + elif isinstance(self.roll_up_method, RollUpMethodDisplayOptions): + roll_up_method = self.roll_up_method.value + else: + roll_up_method = self.roll_up_method + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + scorer_type: None | str | Unset + if isinstance(self.scorer_type, Unset): + scorer_type = UNSET + elif isinstance(self.scorer_type, ScorerTypes): + scorer_type = self.scorer_type.value + else: + scorer_type = self.scorer_type + + model_name: None | str | Unset + if isinstance(self.model_name, Unset): + model_name = UNSET + else: + model_name = self.model_name + + num_judges: int | None | Unset + if isinstance(self.num_judges, Unset): + num_judges = UNSET + else: + num_judges = self.num_judges + + scorer_version: dict[str, Any] | None | Unset + if isinstance(self.scorer_version, Unset): + scorer_version = UNSET + elif isinstance(self.scorer_version, BaseScorerVersionDB): + scorer_version = self.scorer_version.to_dict() + else: + scorer_version = self.scorer_version + scoreable_node_types: list[str] | None | Unset if isinstance(self.scoreable_node_types, Unset): scoreable_node_types = UNSET @@ -142,28 +180,6 @@ def to_dict(self) -> dict[str, Any]: else: input_type = self.input_type - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - model_type: None | str | Unset - if isinstance(self.model_type, Unset): - model_type = UNSET - elif isinstance(self.model_type, ModelType): - model_type = self.model_type.value - else: - model_type = self.model_type - - scorer_version: dict[str, Any] | None | Unset - if isinstance(self.scorer_version, Unset): - scorer_version = UNSET - elif isinstance(self.scorer_version, BaseScorerVersionDB): - scorer_version = self.scorer_version.to_dict() - else: - scorer_version = self.scorer_version - multimodal_capabilities: list[str] | None | Unset if isinstance(self.multimodal_capabilities, Unset): multimodal_capabilities = UNSET @@ -176,13 +192,13 @@ def to_dict(self) -> dict[str, Any]: else: multimodal_capabilities = self.multimodal_capabilities - roll_up_method: None | str | Unset - if isinstance(self.roll_up_method, Unset): - roll_up_method = UNSET - elif isinstance(self.roll_up_method, RollUpMethodDisplayOptions): - roll_up_method = self.roll_up_method.value + roll_up_config: dict[str, Any] | None | Unset + if isinstance(self.roll_up_config, Unset): + roll_up_config = UNSET + elif isinstance(self.roll_up_config, BaseMetricRollUpConfigDB): + roll_up_config = self.roll_up_config.to_dict() else: - roll_up_method = self.roll_up_method + roll_up_config = self.roll_up_config score_type: None | str | Unset if isinstance(self.score_type, Unset): @@ -192,13 +208,23 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({"id": id, "scorer_type": scorer_type}) + field_dict.update({"id": id}) + if scorer_version_id is not UNSET: + field_dict["scorer_version_id"] = scorer_version_id + if filters is not UNSET: + field_dict["filters"] = filters + if roll_up_method is not UNSET: + field_dict["roll_up_method"] = roll_up_method + if name is not UNSET: + field_dict["name"] = name + if scorer_type is not UNSET: + field_dict["scorer_type"] = scorer_type if model_name is not UNSET: field_dict["model_name"] = model_name if num_judges is not UNSET: field_dict["num_judges"] = num_judges - if filters is not UNSET: - field_dict["filters"] = filters + if scorer_version is not UNSET: + field_dict["scorer_version"] = scorer_version if scoreable_node_types is not UNSET: field_dict["scoreable_node_types"] = scoreable_node_types if cot_enabled is not UNSET: @@ -207,16 +233,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["output_type"] = output_type if input_type is not UNSET: field_dict["input_type"] = input_type - if name is not UNSET: - field_dict["name"] = name - if model_type is not UNSET: - field_dict["model_type"] = model_type - if scorer_version is not UNSET: - field_dict["scorer_version"] = scorer_version if multimodal_capabilities is not UNSET: field_dict["multimodal_capabilities"] = multimodal_capabilities - if roll_up_method is not UNSET: - field_dict["roll_up_method"] = roll_up_method + if roll_up_config is not UNSET: + field_dict["roll_up_config"] = roll_up_config if score_type is not UNSET: field_dict["score_type"] = score_type @@ -224,6 +244,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.base_metric_roll_up_config_db import BaseMetricRollUpConfigDB from ..models.base_scorer_version_db import BaseScorerVersionDB from ..models.metadata_filter import MetadataFilter from ..models.modality_filter import ModalityFilter @@ -232,25 +253,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") - scorer_type = ScorerTypes(d.pop("scorer_type")) - - def _parse_model_name(data: object) -> None | str | Unset: + def _parse_scorer_version_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data return cast(None | str | Unset, data) - model_name = _parse_model_name(d.pop("model_name", UNSET)) - - def _parse_num_judges(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - num_judges = _parse_num_judges(d.pop("num_judges", UNSET)) + scorer_version_id = _parse_scorer_version_id(d.pop("scorer_version_id", UNSET)) def _parse_filters(data: object) -> list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset: if data is None: @@ -298,33 +308,33 @@ def _parse_filters_type_0_item(data: object) -> MetadataFilter | ModalityFilter filters = _parse_filters(d.pop("filters", UNSET)) - def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: + def _parse_roll_up_method(data: object) -> None | RollUpMethodDisplayOptions | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, list): + if not isinstance(data, str): raise TypeError() - scoreable_node_types_type_0 = cast(list[str], data) + roll_up_method_type_0 = RollUpMethodDisplayOptions(data) - return scoreable_node_types_type_0 + return roll_up_method_type_0 except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(None | RollUpMethodDisplayOptions | Unset, data) - scoreable_node_types = _parse_scoreable_node_types(d.pop("scoreable_node_types", UNSET)) + roll_up_method = _parse_roll_up_method(d.pop("roll_up_method", UNSET)) - def _parse_cot_enabled(data: object) -> bool | None | Unset: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(None | str | Unset, data) - cot_enabled = _parse_cot_enabled(d.pop("cot_enabled", UNSET)) + name = _parse_name(d.pop("name", UNSET)) - def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: + def _parse_scorer_type(data: object) -> None | ScorerTypes | Unset: if data is None: return data if isinstance(data, Unset): @@ -332,42 +342,77 @@ def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: try: if not isinstance(data, str): raise TypeError() - output_type_type_0 = OutputTypeEnum(data) + scorer_type_type_0 = ScorerTypes(data) - return output_type_type_0 + return scorer_type_type_0 except: # noqa: E722 pass - return cast(None | OutputTypeEnum | Unset, data) + return cast(None | ScorerTypes | Unset, data) - output_type = _parse_output_type(d.pop("output_type", UNSET)) + scorer_type = _parse_scorer_type(d.pop("scorer_type", UNSET)) - def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: + def _parse_model_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + model_name = _parse_model_name(d.pop("model_name", UNSET)) + + def _parse_num_judges(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + num_judges = _parse_num_judges(d.pop("num_judges", UNSET)) + + def _parse_scorer_version(data: object) -> BaseScorerVersionDB | None | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, str): + if not isinstance(data, dict): raise TypeError() - input_type_type_0 = InputTypeEnum(data) + scorer_version_type_0 = BaseScorerVersionDB.from_dict(data) - return input_type_type_0 + return scorer_version_type_0 except: # noqa: E722 pass - return cast(InputTypeEnum | None | Unset, data) + return cast(BaseScorerVersionDB | None | Unset, data) - input_type = _parse_input_type(d.pop("input_type", UNSET)) + scorer_version = _parse_scorer_version(d.pop("scorer_version", UNSET)) - def _parse_name(data: object) -> None | str | Unset: + def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + try: + if not isinstance(data, list): + raise TypeError() + scoreable_node_types_type_0 = cast(list[str], data) - name = _parse_name(d.pop("name", UNSET)) + return scoreable_node_types_type_0 + except: # noqa: E722 + pass + return cast(list[str] | None | Unset, data) - def _parse_model_type(data: object) -> ModelType | None | Unset: + scoreable_node_types = _parse_scoreable_node_types(d.pop("scoreable_node_types", UNSET)) + + def _parse_cot_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + cot_enabled = _parse_cot_enabled(d.pop("cot_enabled", UNSET)) + + def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: if data is None: return data if isinstance(data, Unset): @@ -375,31 +420,31 @@ def _parse_model_type(data: object) -> ModelType | None | Unset: try: if not isinstance(data, str): raise TypeError() - model_type_type_0 = ModelType(data) + output_type_type_0 = OutputTypeEnum(data) - return model_type_type_0 + return output_type_type_0 except: # noqa: E722 pass - return cast(ModelType | None | Unset, data) + return cast(None | OutputTypeEnum | Unset, data) - model_type = _parse_model_type(d.pop("model_type", UNSET)) + output_type = _parse_output_type(d.pop("output_type", UNSET)) - def _parse_scorer_version(data: object) -> BaseScorerVersionDB | None | Unset: + def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, dict): + if not isinstance(data, str): raise TypeError() - scorer_version_type_0 = BaseScorerVersionDB.from_dict(data) + input_type_type_0 = InputTypeEnum(data) - return scorer_version_type_0 + return input_type_type_0 except: # noqa: E722 pass - return cast(BaseScorerVersionDB | None | Unset, data) + return cast(InputTypeEnum | None | Unset, data) - scorer_version = _parse_scorer_version(d.pop("scorer_version", UNSET)) + input_type = _parse_input_type(d.pop("input_type", UNSET)) def _parse_multimodal_capabilities(data: object) -> list[MultimodalCapability] | None | Unset: if data is None: @@ -423,22 +468,22 @@ def _parse_multimodal_capabilities(data: object) -> list[MultimodalCapability] | multimodal_capabilities = _parse_multimodal_capabilities(d.pop("multimodal_capabilities", UNSET)) - def _parse_roll_up_method(data: object) -> None | RollUpMethodDisplayOptions | Unset: + def _parse_roll_up_config(data: object) -> BaseMetricRollUpConfigDB | None | Unset: if data is None: return data if isinstance(data, Unset): return data try: - if not isinstance(data, str): + if not isinstance(data, dict): raise TypeError() - roll_up_method_type_0 = RollUpMethodDisplayOptions(data) + roll_up_config_type_0 = BaseMetricRollUpConfigDB.from_dict(data) - return roll_up_method_type_0 + return roll_up_config_type_0 except: # noqa: E722 pass - return cast(None | RollUpMethodDisplayOptions | Unset, data) + return cast(BaseMetricRollUpConfigDB | None | Unset, data) - roll_up_method = _parse_roll_up_method(d.pop("roll_up_method", UNSET)) + roll_up_config = _parse_roll_up_config(d.pop("roll_up_config", UNSET)) def _parse_score_type(data: object) -> None | str | Unset: if data is None: @@ -449,26 +494,27 @@ def _parse_score_type(data: object) -> None | str | Unset: score_type = _parse_score_type(d.pop("score_type", UNSET)) - scorer_config = cls( + runtime_scorer_config = cls( id=id, + scorer_version_id=scorer_version_id, + filters=filters, + roll_up_method=roll_up_method, + name=name, scorer_type=scorer_type, model_name=model_name, num_judges=num_judges, - filters=filters, + scorer_version=scorer_version, scoreable_node_types=scoreable_node_types, cot_enabled=cot_enabled, output_type=output_type, input_type=input_type, - name=name, - model_type=model_type, - scorer_version=scorer_version, multimodal_capabilities=multimodal_capabilities, - roll_up_method=roll_up_method, + roll_up_config=roll_up_config, score_type=score_type, ) - scorer_config.additional_properties = d - return scorer_config + runtime_scorer_config.additional_properties = d + return runtime_scorer_config @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/scorer_defaults.py b/src/splunk_ao/resources/models/scorer_defaults.py index 513fccad..33e8f0f2 100644 --- a/src/splunk_ao/resources/models/scorer_defaults.py +++ b/src/splunk_ao/resources/models/scorer_defaults.py @@ -14,6 +14,7 @@ from ..models.metadata_filter import MetadataFilter from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_invocation_config import ScorerInvocationConfig T = TypeVar("T", bound="ScorerDefaults") @@ -35,6 +36,8 @@ class ScorerDefaults: categorical, etc.). input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). + invocation (None | ScorerInvocationConfig | Unset): Deprecated compatibility location for direct-invocation + metadata. Use ScorerInfo.invocation or BaseScorerDB.invocation instead. """ model_name: None | str | Unset = UNSET @@ -44,11 +47,13 @@ class ScorerDefaults: cot_enabled: bool | None | Unset = UNSET output_type: None | OutputTypeEnum | Unset = UNSET input_type: InputTypeEnum | None | Unset = UNSET + invocation: None | ScorerInvocationConfig | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.metadata_filter import MetadataFilter from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_invocation_config import ScorerInvocationConfig model_name: None | str | Unset if isinstance(self.model_name, Unset): @@ -112,6 +117,14 @@ def to_dict(self) -> dict[str, Any]: else: input_type = self.input_type + invocation: dict[str, Any] | None | Unset + if isinstance(self.invocation, Unset): + invocation = UNSET + elif isinstance(self.invocation, ScorerInvocationConfig): + invocation = self.invocation.to_dict() + else: + invocation = self.invocation + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -129,6 +142,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["output_type"] = output_type if input_type is not UNSET: field_dict["input_type"] = input_type + if invocation is not UNSET: + field_dict["invocation"] = invocation return field_dict @@ -137,6 +152,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metadata_filter import MetadataFilter from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_invocation_config import ScorerInvocationConfig d = dict(src_dict) @@ -264,6 +280,23 @@ def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: input_type = _parse_input_type(d.pop("input_type", UNSET)) + def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + invocation_type_0 = ScorerInvocationConfig.from_dict(data) + + return invocation_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerInvocationConfig | Unset, data) + + invocation = _parse_invocation(d.pop("invocation", UNSET)) + scorer_defaults = cls( model_name=model_name, num_judges=num_judges, @@ -272,6 +305,7 @@ def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: cot_enabled=cot_enabled, output_type=output_type, input_type=input_type, + invocation=invocation, ) scorer_defaults.additional_properties = d diff --git a/src/splunk_ao/resources/models/scorer_invocation_config.py b/src/splunk_ao/resources/models/scorer_invocation_config.py new file mode 100644 index 00000000..40265615 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_invocation_config.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.scorer_invocation_config_required_inputs_item import ScorerInvocationConfigRequiredInputsItem +from ..models.scorer_invocation_payload_format import ScorerInvocationPayloadFormat +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScorerInvocationConfig") + + +@_attrs_define +class ScorerInvocationConfig: + """How the direct scorer-invoke API validates and serializes inputs. + + Attributes: + payload_format (ScorerInvocationPayloadFormat): + required_inputs (list[ScorerInvocationConfigRequiredInputsItem] | Unset): + """ + + payload_format: ScorerInvocationPayloadFormat + required_inputs: list[ScorerInvocationConfigRequiredInputsItem] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + payload_format = self.payload_format.value + + required_inputs: list[str] | Unset = UNSET + if not isinstance(self.required_inputs, Unset): + required_inputs = [] + for required_inputs_item_data in self.required_inputs: + required_inputs_item = required_inputs_item_data.value + required_inputs.append(required_inputs_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"payload_format": payload_format}) + if required_inputs is not UNSET: + field_dict["required_inputs"] = required_inputs + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + payload_format = ScorerInvocationPayloadFormat(d.pop("payload_format")) + + _required_inputs = d.pop("required_inputs", UNSET) + required_inputs: list[ScorerInvocationConfigRequiredInputsItem] | Unset = UNSET + if _required_inputs is not UNSET: + required_inputs = [] + for required_inputs_item_data in _required_inputs: + required_inputs_item = ScorerInvocationConfigRequiredInputsItem(required_inputs_item_data) + + required_inputs.append(required_inputs_item) + + scorer_invocation_config = cls(payload_format=payload_format, required_inputs=required_inputs) + + scorer_invocation_config.additional_properties = d + return scorer_invocation_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/scorer_invocation_config_required_inputs_item.py b/src/splunk_ao/resources/models/scorer_invocation_config_required_inputs_item.py new file mode 100644 index 00000000..61159013 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_invocation_config_required_inputs_item.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScorerInvocationConfigRequiredInputsItem(str, Enum): + QUERY = "query" + RESPONSE = "response" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/scorer_invocation_payload_format.py b/src/splunk_ao/resources/models/scorer_invocation_payload_format.py new file mode 100644 index 00000000..996d23e2 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_invocation_payload_format.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class ScorerInvocationPayloadFormat(str, Enum): + NODE_INPUT_OUTPUT = "node_input_output" + PAIRWISE = "pairwise" + QUERY = "query" + RESPONSE = "response" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/scorer_multimodal_capabilities_filter.py b/src/splunk_ao/resources/models/scorer_multimodal_capabilities_filter.py index 54e8a9b2..4946c355 100644 --- a/src/splunk_ao/resources/models/scorer_multimodal_capabilities_filter.py +++ b/src/splunk_ao/resources/models/scorer_multimodal_capabilities_filter.py @@ -20,6 +20,9 @@ class ScorerMultimodalCapabilitiesFilter: (e.g. ``{"name": "multimodal_capabilities", "operator": "contains", "value": "vision"}``). Use ``one_of`` to match scorers whose capabilities include ANY of the given values (e.g. ``{"name": "multimodal_capabilities", "operator": "one_of", "value": ["vision", "audio"]}``). + ``text`` is a filter-only value supplied in the ``one_of`` list + (e.g. ``{"operator": "one_of", "value": ["text"]}``) that matches scorers + with no multimodal capabilities. Attributes: operator (ScorerMultimodalCapabilitiesFilterOperator): diff --git a/src/splunk_ao/resources/models/scorer_response.py b/src/splunk_ao/resources/models/scorer_response.py index df41f09b..a6a91fce 100644 --- a/src/splunk_ao/resources/models/scorer_response.py +++ b/src/splunk_ao/resources/models/scorer_response.py @@ -24,6 +24,7 @@ from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.permission import Permission from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_invocation_config import ScorerInvocationConfig from ..models.scorer_scope_project_ref import ScorerScopeProjectRef @@ -39,7 +40,10 @@ class ScorerResponse: scorer_type (ScorerTypes): tags (list[str]): permissions (list[Permission] | Unset): + label (None | str | Unset): Default: ''. defaults (None | ScorerDefaults | Unset): + invocation (None | ScorerInvocationConfig | Unset): Intrinsic metadata for invoking this scorer directly with + query and response inputs. latest_version (BaseScorerVersionDB | None | Unset): model_type (ModelType | None | Unset): ground_truth (bool | None | Unset): @@ -55,7 +59,6 @@ class ScorerResponse: deprecated (bool | None | Unset): roll_up_method (None | RollUpMethodDisplayOptions | Unset): roll_up_config (BaseMetricRollUpConfigDB | None | Unset): - label (None | str | Unset): Default: ''. included_fields (list[str] | Unset): Fields that can be used in the scorer to configure it. i.e. model, num_judges, etc. This enables the ui to know which fields a user can configure when they're setting a scorer description (None | str | Unset): @@ -75,7 +78,9 @@ class ScorerResponse: scorer_type: ScorerTypes tags: list[str] permissions: list[Permission] | Unset = UNSET + label: None | str | Unset = "" defaults: None | ScorerDefaults | Unset = UNSET + invocation: None | ScorerInvocationConfig | Unset = UNSET latest_version: BaseScorerVersionDB | None | Unset = UNSET model_type: ModelType | None | Unset = UNSET ground_truth: bool | None | Unset = UNSET @@ -91,7 +96,6 @@ class ScorerResponse: deprecated: bool | None | Unset = UNSET roll_up_method: None | RollUpMethodDisplayOptions | Unset = UNSET roll_up_config: BaseMetricRollUpConfigDB | None | Unset = UNSET - label: None | str | Unset = "" included_fields: list[str] | Unset = UNSET description: None | str | Unset = UNSET created_by: None | str | Unset = UNSET @@ -119,6 +123,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_invocation_config import ScorerInvocationConfig id = self.id @@ -135,6 +140,12 @@ def to_dict(self) -> dict[str, Any]: permissions_item = permissions_item_data.to_dict() permissions.append(permissions_item) + label: None | str | Unset + if isinstance(self.label, Unset): + label = UNSET + else: + label = self.label + defaults: dict[str, Any] | None | Unset if isinstance(self.defaults, Unset): defaults = UNSET @@ -143,6 +154,14 @@ def to_dict(self) -> dict[str, Any]: else: defaults = self.defaults + invocation: dict[str, Any] | None | Unset + if isinstance(self.invocation, Unset): + invocation = UNSET + elif isinstance(self.invocation, ScorerInvocationConfig): + invocation = self.invocation.to_dict() + else: + invocation = self.invocation + latest_version: dict[str, Any] | None | Unset if isinstance(self.latest_version, Unset): latest_version = UNSET @@ -262,12 +281,6 @@ def to_dict(self) -> dict[str, Any]: else: roll_up_config = self.roll_up_config - label: None | str | Unset - if isinstance(self.label, Unset): - label = UNSET - else: - label = self.label - included_fields: list[str] | Unset = UNSET if not isinstance(self.included_fields, Unset): included_fields = self.included_fields @@ -342,8 +355,12 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({"id": id, "name": name, "scorer_type": scorer_type, "tags": tags}) if permissions is not UNSET: field_dict["permissions"] = permissions + if label is not UNSET: + field_dict["label"] = label if defaults is not UNSET: field_dict["defaults"] = defaults + if invocation is not UNSET: + field_dict["invocation"] = invocation if latest_version is not UNSET: field_dict["latest_version"] = latest_version if model_type is not UNSET: @@ -374,8 +391,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["roll_up_method"] = roll_up_method if roll_up_config is not UNSET: field_dict["roll_up_config"] = roll_up_config - if label is not UNSET: - field_dict["label"] = label if included_fields is not UNSET: field_dict["included_fields"] = included_fields if description is not UNSET: @@ -409,6 +424,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.permission import Permission from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_invocation_config import ScorerInvocationConfig from ..models.scorer_scope_project_ref import ScorerScopeProjectRef d = dict(src_dict) @@ -429,6 +445,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions.append(permissions_item) + def _parse_label(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + label = _parse_label(d.pop("label", UNSET)) + def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: if data is None: return data @@ -446,6 +471,23 @@ def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: defaults = _parse_defaults(d.pop("defaults", UNSET)) + def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + invocation_type_0 = ScorerInvocationConfig.from_dict(data) + + return invocation_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerInvocationConfig | Unset, data) + + invocation = _parse_invocation(d.pop("invocation", UNSET)) + def _parse_latest_version(data: object) -> BaseScorerVersionDB | None | Unset: if data is None: return data @@ -674,15 +716,6 @@ def _parse_roll_up_config(data: object) -> BaseMetricRollUpConfigDB | None | Uns roll_up_config = _parse_roll_up_config(d.pop("roll_up_config", UNSET)) - def _parse_label(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - label = _parse_label(d.pop("label", UNSET)) - included_fields = cast(list[str], d.pop("included_fields", UNSET)) def _parse_description(data: object) -> None | str | Unset: @@ -838,7 +871,9 @@ def _parse_metric_name(data: object) -> None | str | Unset: scorer_type=scorer_type, tags=tags, permissions=permissions, + label=label, defaults=defaults, + invocation=invocation, latest_version=latest_version, model_type=model_type, ground_truth=ground_truth, @@ -854,7 +889,6 @@ def _parse_metric_name(data: object) -> None | str | Unset: deprecated=deprecated, roll_up_method=roll_up_method, roll_up_config=roll_up_config, - label=label, included_fields=included_fields, description=description, created_by=created_by, diff --git a/src/splunk_ao/resources/models/stub_trace_record.py b/src/splunk_ao/resources/models/stub_trace_record.py index 8997d70e..f0b8e71c 100644 --- a/src/splunk_ao/resources/models/stub_trace_record.py +++ b/src/splunk_ao/resources/models/stub_trace_record.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast @@ -32,6 +33,7 @@ class StubTraceRecord: Attributes: id (str): ID of the missing trace, taken from span trace_id references. + created_at (datetime.datetime): Earliest created_at among child spans; used to order under a session. spans (list[ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | ExtendedWorkflowSpanRecordWithChildren] | Unset): @@ -43,6 +45,7 @@ class StubTraceRecord: """ id: str + created_at: datetime.datetime spans: ( list[ ExtendedAgentSpanRecordWithChildren @@ -68,6 +71,8 @@ def to_dict(self) -> dict[str, Any]: id = self.id + created_at = self.created_at.isoformat() + spans: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.spans, Unset): spans = [] @@ -110,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - field_dict.update({"id": id}) + field_dict.update({"id": id, "created_at": created_at}) if spans is not UNSET: field_dict["spans"] = spans if type_ is not UNSET: @@ -135,6 +140,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + _spans = d.pop("spans", UNSET) spans: ( list[ @@ -307,7 +314,13 @@ def _parse_session_id(data: object) -> None | str | Unset: session_id = _parse_session_id(d.pop("session_id", UNSET)) stub_trace_record = cls( - id=id, spans=spans, type_=type_, project_id=project_id, run_id=run_id, session_id=session_id + id=id, + created_at=created_at, + spans=spans, + type_=type_, + project_id=project_id, + run_id=run_id, + session_id=session_id, ) return stub_trace_record diff --git a/src/splunk_ao/resources/models/task_type.py b/src/splunk_ao/resources/models/task_type.py index ebed31d3..522aa6d0 100644 --- a/src/splunk_ao/resources/models/task_type.py +++ b/src/splunk_ao/resources/models/task_type.py @@ -2,9 +2,6 @@ class TaskType(IntEnum): - VALUE_7 = 7 - VALUE_9 = 9 - VALUE_12 = 12 VALUE_13 = 13 VALUE_15 = 15 VALUE_16 = 16