From a33597d5677081f50207f926f9950d9914700fb3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 23:05:52 +0000 Subject: [PATCH 1/3] chore: sync repo --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 -------- Gemfile.lock | 2 +- README.md | 2 +- lib/deeprails/version.rb | 2 +- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 10f3091..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0" + ".": "0.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index cc7d5bb..70b36a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,5 @@ # Changelog -## 0.2.0 (2025-10-07) - -Full Changelog: [v0.1.0...v0.2.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.1.0...v0.2.0) - -### Features - -* **api:** manual updates ([40308c3](https://github.com/deeprails/deeprails-ruby-sdk/commit/40308c3e3ebfb15a6ab606a13f75e97656daff19)) - ## 0.1.0 (2025-10-07) Full Changelog: [v0.0.2...v0.1.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.0.2...v0.1.0) diff --git a/Gemfile.lock b/Gemfile.lock index b20f5f2..cfc3e5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - deeprails (0.2.0) + deeprails (0.1.0) connection_pool GEM diff --git a/README.md b/README.md index 1274f9b..4f4a447 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "deeprails", "~> 0.2.0" +gem "deeprails", "~> 0.1.0" ``` diff --git a/lib/deeprails/version.rb b/lib/deeprails/version.rb index ca4812b..3aef2cf 100644 --- a/lib/deeprails/version.rb +++ b/lib/deeprails/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Deeprails - VERSION = "0.2.0" + VERSION = "0.1.0" end From 9597e09967d659172d52c3935b3dd8f3e0018783 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 05:23:18 +0000 Subject: [PATCH 2/3] feat(api): adding code samples --- .stats.yml | 6 +-- README.md | 8 ++-- lib/deeprails/models/api_response.rb | 5 +- .../models/defend_create_workflow_params.rb | 4 +- lib/deeprails/models/defend_response.rb | 6 +-- .../models/defend_update_workflow_params.rb | 21 +-------- .../models/monitor_retrieve_response.rb | 5 +- .../models/monitor_submit_event_response.rb | 7 +-- .../models/workflow_event_response.rb | 2 - lib/deeprails/resources/defend.rb | 17 ++++--- lib/deeprails/resources/evaluate.rb | 2 +- lib/deeprails/resources/monitor.rb | 12 +++-- rbi/deeprails/models/api_response.rbi | 3 -- .../models/defend_create_workflow_params.rbi | 6 +-- rbi/deeprails/models/defend_response.rbi | 7 ++- .../models/defend_update_workflow_params.rbi | 47 ------------------- .../models/monitor_retrieve_response.rbi | 3 -- .../models/monitor_submit_event_response.rbi | 3 -- .../models/workflow_event_response.rbi | 1 - rbi/deeprails/resources/defend.rbi | 18 ++++--- rbi/deeprails/resources/evaluate.rbi | 2 +- rbi/deeprails/resources/monitor.rbi | 12 +++-- .../models/defend_update_workflow_params.rbs | 25 +--------- sig/deeprails/resources/defend.rbs | 1 - 24 files changed, 57 insertions(+), 166 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca2fea5..87138d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/deeprails-inc%2Fdeeprails-96512c1b797f0943ff15a6f7af701c2c68c90f2db3a99bcad64a092924c39167.yml -openapi_spec_hash: 19d817d155ec2593b8af64e69a63375b -config_hash: 3e459e308a3ae2c9963655281c3987bc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/deeprails-inc%2Fdeeprails-5f0bb342de09a42c51e94feacb97cb4c11c513120637868e4bd0cdaedff14c0c.yml +openapi_spec_hash: 616b686ef84ded4978605efdbb72183e +config_hash: 63c6f27e0ba2846cf2d04e70777b3b21 diff --git a/README.md b/README.md index 4f4a447..5391191 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ When the library is unable to connect to the API, or if the API returns a non-su begin defend = deeprails.defend.create_workflow( improvement_action: "fixit", - metrics: {completeness: 0.85, instruction_adherence: 0.75}, + metrics: {completeness: 0.8, instruction_adherence: 0.75}, name: "Push Alert Workflow", type: "custom" ) @@ -96,7 +96,7 @@ deeprails = Deeprails::Client.new( # Or, configure per-request: deeprails.defend.create_workflow( improvement_action: "fixit", - metrics: {completeness: 0.85, instruction_adherence: 0.75}, + metrics: {completeness: 0.8, instruction_adherence: 0.75}, name: "Push Alert Workflow", type: "custom", request_options: {max_retries: 5} @@ -116,7 +116,7 @@ deeprails = Deeprails::Client.new( # Or, configure per-request: deeprails.defend.create_workflow( improvement_action: "fixit", - metrics: {completeness: 0.85, instruction_adherence: 0.75}, + metrics: {completeness: 0.8, instruction_adherence: 0.75}, name: "Push Alert Workflow", type: "custom", request_options: {timeout: 5} @@ -153,7 +153,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete defend_response = deeprails.defend.create_workflow( improvement_action: "fixit", - metrics: {completeness: 0.85, instruction_adherence: 0.75}, + metrics: {completeness: 0.8, instruction_adherence: 0.75}, name: "Push Alert Workflow", type: "custom", request_options: { diff --git a/lib/deeprails/models/api_response.rb b/lib/deeprails/models/api_response.rb index ac4a4a2..c0e976f 100644 --- a/lib/deeprails/models/api_response.rb +++ b/lib/deeprails/models/api_response.rb @@ -11,7 +11,6 @@ class APIResponse < Deeprails::Internal::Type::BaseModel required :success, Deeprails::Internal::Type::Boolean # @!attribute data - # Response payload for creating or updating a monitor. # # @return [Deeprails::Models::APIResponse::Data, nil] optional :data, -> { Deeprails::APIResponse::Data } @@ -31,7 +30,7 @@ class APIResponse < Deeprails::Internal::Type::BaseModel # # @param success [Boolean] Represents whether the request was completed successfully. # - # @param data [Deeprails::Models::APIResponse::Data] Response payload for creating or updating a monitor. + # @param data [Deeprails::Models::APIResponse::Data] # # @param message [String] The accompanying message for the request. Includes error details when applicable @@ -84,8 +83,6 @@ class Data < Deeprails::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Deeprails::Models::APIResponse::Data} for more details. # - # Response payload for creating or updating a monitor. - # # @param monitor_id [String] A unique monitor ID. # # @param name [String] Name of the monitor. diff --git a/lib/deeprails/models/defend_create_workflow_params.rb b/lib/deeprails/models/defend_create_workflow_params.rb index 82e87a8..60cce95 100644 --- a/lib/deeprails/models/defend_create_workflow_params.rb +++ b/lib/deeprails/models/defend_create_workflow_params.rb @@ -10,7 +10,7 @@ class DefendCreateWorkflowParams < Deeprails::Internal::Type::BaseModel # @!attribute improvement_action # The action used to improve outputs that fail one or guardrail metrics for the # workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. # @@ -87,7 +87,7 @@ class DefendCreateWorkflowParams < Deeprails::Internal::Type::BaseModel # The action used to improve outputs that fail one or guardrail metrics for the # workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. module ImprovementAction diff --git a/lib/deeprails/models/defend_response.rb b/lib/deeprails/models/defend_response.rb index 07c6535..2a679f5 100644 --- a/lib/deeprails/models/defend_response.rb +++ b/lib/deeprails/models/defend_response.rb @@ -31,7 +31,7 @@ class DefendResponse < Deeprails::Internal::Type::BaseModel # @!attribute improvement_action # The action used to improve outputs that fail one or more guardrail metrics for # the workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. # @@ -68,8 +68,6 @@ class DefendResponse < Deeprails::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Deeprails::Models::DefendResponse} for more details. # - # Response payload for guardrail workflow operations. - # # @param name [String] Name of the workflow. # # @param workflow_id [String] A unique workflow ID. @@ -90,7 +88,7 @@ class DefendResponse < Deeprails::Internal::Type::BaseModel # The action used to improve outputs that fail one or more guardrail metrics for # the workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. # diff --git a/lib/deeprails/models/defend_update_workflow_params.rb b/lib/deeprails/models/defend_update_workflow_params.rb index 3f515fd..e8c16a8 100644 --- a/lib/deeprails/models/defend_update_workflow_params.rb +++ b/lib/deeprails/models/defend_update_workflow_params.rb @@ -19,31 +19,12 @@ class DefendUpdateWorkflowParams < Deeprails::Internal::Type::BaseModel # @return [String, nil] optional :name, String - # @!attribute type - # Type of thresholds to use for the workflow, either `automatic` or `custom`. - # - # @return [Symbol, Deeprails::Models::DefendUpdateWorkflowParams::Type, nil] - optional :type, enum: -> { Deeprails::DefendUpdateWorkflowParams::Type } - - # @!method initialize(description: nil, name: nil, type: nil, request_options: {}) + # @!method initialize(description: nil, name: nil, request_options: {}) # @param description [String] Description for the workflow. # # @param name [String] Name of the workflow. # - # @param type [Symbol, Deeprails::Models::DefendUpdateWorkflowParams::Type] Type of thresholds to use for the workflow, either `automatic` or `custom`. - # # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}] - - # Type of thresholds to use for the workflow, either `automatic` or `custom`. - module Type - extend Deeprails::Internal::Type::Enum - - AUTOMATIC = :automatic - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/deeprails/models/monitor_retrieve_response.rb b/lib/deeprails/models/monitor_retrieve_response.rb index e81d3c7..6faf4b2 100644 --- a/lib/deeprails/models/monitor_retrieve_response.rb +++ b/lib/deeprails/models/monitor_retrieve_response.rb @@ -11,7 +11,6 @@ class MonitorRetrieveResponse < Deeprails::Internal::Type::BaseModel required :success, Deeprails::Internal::Type::Boolean # @!attribute data - # Detailed response payload for retrieving a monitor and its evaluations. # # @return [Deeprails::Models::MonitorRetrieveResponse::Data, nil] optional :data, -> { Deeprails::Models::MonitorRetrieveResponse::Data } @@ -31,7 +30,7 @@ class MonitorRetrieveResponse < Deeprails::Internal::Type::BaseModel # # @param success [Boolean] Represents whether the request was completed successfully. # - # @param data [Deeprails::Models::MonitorRetrieveResponse::Data] Detailed response payload for retrieving a monitor and its evaluations. + # @param data [Deeprails::Models::MonitorRetrieveResponse::Data] # # @param message [String] The accompanying message for the request. Includes error details when applicable @@ -99,8 +98,6 @@ class Data < Deeprails::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Deeprails::Models::MonitorRetrieveResponse::Data} for more details. # - # Detailed response payload for retrieving a monitor and its evaluations. - # # @param monitor_id [String] A unique monitor ID. # # @param monitor_status [Symbol, Deeprails::Models::MonitorRetrieveResponse::Data::MonitorStatus] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon diff --git a/lib/deeprails/models/monitor_submit_event_response.rb b/lib/deeprails/models/monitor_submit_event_response.rb index 8a19660..801df4d 100644 --- a/lib/deeprails/models/monitor_submit_event_response.rb +++ b/lib/deeprails/models/monitor_submit_event_response.rb @@ -11,7 +11,6 @@ class MonitorSubmitEventResponse < Deeprails::Internal::Type::BaseModel required :success, Deeprails::Internal::Type::Boolean # @!attribute data - # Response payload for monitor event operations. # # @return [Deeprails::Models::MonitorSubmitEventResponse::Data, nil] optional :data, -> { Deeprails::Models::MonitorSubmitEventResponse::Data } @@ -31,9 +30,9 @@ class MonitorSubmitEventResponse < Deeprails::Internal::Type::BaseModel # # @param success [Boolean] Represents whether the request was completed successfully. # - # @param data [Deeprails::Models::MonitorSubmitEventResponse::Data] Response payload for monitor event operations. + # @param data [Deeprails::Models::MonitorSubmitEventResponse::Data] # - # @param message [String] The accompanying message for the request. Includes error details when applicabl + # @param message [String] The accompanying message for the request. Includes error details when applicable # @see Deeprails::Models::MonitorSubmitEventResponse#data class Data < Deeprails::Internal::Type::BaseModel @@ -62,8 +61,6 @@ class Data < Deeprails::Internal::Type::BaseModel optional :created_at, Time # @!method initialize(evaluation_id:, event_id:, monitor_id:, created_at: nil) - # Response payload for monitor event operations. - # # @param evaluation_id [String] A unique evaluation ID associated with this event. # # @param event_id [String] A unique monitor event ID. diff --git a/lib/deeprails/models/workflow_event_response.rb b/lib/deeprails/models/workflow_event_response.rb index 4b2e124..04052f1 100644 --- a/lib/deeprails/models/workflow_event_response.rb +++ b/lib/deeprails/models/workflow_event_response.rb @@ -41,8 +41,6 @@ class WorkflowEventResponse < Deeprails::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Deeprails::Models::WorkflowEventResponse} for more details. # - # Response payload for workflow event operations. - # # @param event_id [String] A unique workflow event ID. # # @param workflow_id [String] Workflow ID associated with the event. diff --git a/lib/deeprails/resources/defend.rb b/lib/deeprails/resources/defend.rb index 8501756..7e6f21a 100644 --- a/lib/deeprails/resources/defend.rb +++ b/lib/deeprails/resources/defend.rb @@ -6,8 +6,8 @@ class Defend # Some parameter documentations has been truncated, see # {Deeprails::Models::DefendCreateWorkflowParams} for more details. # - # Create a new guardrail workflow with optional guardrail thresholds and - # improvement actions. + # Use this endpoint to create a new guardrail workflow with optional guardrail + # thresholds and improvement actions # # @overload create_workflow(improvement_action:, metrics:, name:, type:, automatic_tolerance: nil, description: nil, max_retries: nil, request_options: {}) # @@ -41,7 +41,7 @@ def create_workflow(params) ) end - # Retrieve a specific event of a guardrail workflow. + # Use this endpoint to retrieve a specific event of a guardrail workflow # # @overload retrieve_event(event_id, workflow_id:, request_options: {}) # @@ -68,7 +68,7 @@ def retrieve_event(event_id, params) ) end - # Retrieve the details for a specific guardrail workflow. + # Use this endpoint to retrieve the details for a specific defend workflow # # @overload retrieve_workflow(workflow_id, request_options: {}) # @@ -91,7 +91,8 @@ def retrieve_workflow(workflow_id, params = {}) # Some parameter documentations has been truncated, see # {Deeprails::Models::DefendSubmitEventParams} for more details. # - # Submit a model input and output pair to a workflow for evaluation. + # Use this endpoint to submit a model input and output pair to a workflow for + # evaluation # # @overload submit_event(workflow_id, model_input:, model_output:, model_used:, nametag:, run_mode:, request_options: {}) # @@ -123,9 +124,9 @@ def submit_event(workflow_id, params) ) end - # Update an existing guardrail workflow. + # Use this endpoint to update an existing guardrail workflow # - # @overload update_workflow(workflow_id, description: nil, name: nil, type: nil, request_options: {}) + # @overload update_workflow(workflow_id, description: nil, name: nil, request_options: {}) # # @param workflow_id [String] The ID of the workflow to edit. # @@ -133,8 +134,6 @@ def submit_event(workflow_id, params) # # @param name [String] Name of the workflow. # - # @param type [Symbol, Deeprails::Models::DefendUpdateWorkflowParams::Type] Type of thresholds to use for the workflow, either `automatic` or `custom`. - # # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Deeprails::Models::DefendResponse] diff --git a/lib/deeprails/resources/evaluate.rb b/lib/deeprails/resources/evaluate.rb index 257b5f5..98d787c 100644 --- a/lib/deeprails/resources/evaluate.rb +++ b/lib/deeprails/resources/evaluate.rb @@ -39,7 +39,7 @@ def create(params) ) end - # Retrieve the evaluation record for a given evaluation ID. + # Use this endpoint to retrieve the evaluation record for a given evaluation ID # # @overload retrieve(eval_id, request_options: {}) # diff --git a/lib/deeprails/resources/monitor.rb b/lib/deeprails/resources/monitor.rb index fd9e51d..351e6c8 100644 --- a/lib/deeprails/resources/monitor.rb +++ b/lib/deeprails/resources/monitor.rb @@ -3,7 +3,8 @@ module Deeprails module Resources class Monitor - # Create a new monitor to evaluate model inputs and outputs using guardrails. + # Use this endpoint to create a new monitor to evaluate model inputs and outputs + # using guardrails # # @overload create(name:, description: nil, request_options: {}) # @@ -27,7 +28,8 @@ def create(params) ) end - # Retrieve the details and evaluations associated with a specific monitor. + # Use this endpoint to retrieve the details and evaluations associated with a + # specific monitor # # @overload retrieve(monitor_id, limit: nil, request_options: {}) # @@ -54,7 +56,8 @@ def retrieve(monitor_id, params = {}) # Some parameter documentations has been truncated, see # {Deeprails::Models::MonitorUpdateParams} for more details. # - # Update the name, description, or status of an existing monitor. + # Use this endpoint to update the name, description, or status of an existing + # monitor # # @overload update(monitor_id, description: nil, monitor_status: nil, name: nil, request_options: {}) # @@ -85,7 +88,8 @@ def update(monitor_id, params = {}) # Some parameter documentations has been truncated, see # {Deeprails::Models::MonitorSubmitEventParams} for more details. # - # Submit a model input and output pair to a monitor for evaluation. + # Use this endpoint to submit a model input and output pair to a monitor for + # evaluation # # @overload submit_event(monitor_id, guardrail_metrics:, model_input:, model_output:, model_used: nil, nametag: nil, run_mode: nil, request_options: {}) # diff --git a/rbi/deeprails/models/api_response.rbi b/rbi/deeprails/models/api_response.rbi index d61e4e0..16d6dd9 100644 --- a/rbi/deeprails/models/api_response.rbi +++ b/rbi/deeprails/models/api_response.rbi @@ -12,7 +12,6 @@ module Deeprails sig { returns(T::Boolean) } attr_accessor :success - # Response payload for creating or updating a monitor. sig { returns(T.nilable(Deeprails::APIResponse::Data)) } attr_reader :data @@ -38,7 +37,6 @@ module Deeprails def self.new( # Represents whether the request was completed successfully. success:, - # Response payload for creating or updating a monitor. data: nil, # The accompanying message for the request. Includes error details when # applicable. @@ -117,7 +115,6 @@ module Deeprails sig { params(user_id: String).void } attr_writer :user_id - # Response payload for creating or updating a monitor. sig do params( monitor_id: String, diff --git a/rbi/deeprails/models/defend_create_workflow_params.rbi b/rbi/deeprails/models/defend_create_workflow_params.rbi index 9774413..97bc096 100644 --- a/rbi/deeprails/models/defend_create_workflow_params.rbi +++ b/rbi/deeprails/models/defend_create_workflow_params.rbi @@ -16,7 +16,7 @@ module Deeprails # The action used to improve outputs that fail one or guardrail metrics for the # workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. sig do @@ -101,7 +101,7 @@ module Deeprails def self.new( # The action used to improve outputs that fail one or guardrail metrics for the # workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. improvement_action:, @@ -154,7 +154,7 @@ module Deeprails # The action used to improve outputs that fail one or guardrail metrics for the # workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. module ImprovementAction diff --git a/rbi/deeprails/models/defend_response.rbi b/rbi/deeprails/models/defend_response.rbi index 610eef1..7310f76 100644 --- a/rbi/deeprails/models/defend_response.rbi +++ b/rbi/deeprails/models/defend_response.rbi @@ -32,7 +32,7 @@ module Deeprails # The action used to improve outputs that fail one or more guardrail metrics for # the workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. sig do @@ -74,7 +74,6 @@ module Deeprails sig { params(success_rate: Float).void } attr_writer :success_rate - # Response payload for guardrail workflow operations. sig do params( name: String, @@ -100,7 +99,7 @@ module Deeprails description: nil, # The action used to improve outputs that fail one or more guardrail metrics for # the workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. improvement_action: nil, @@ -140,7 +139,7 @@ module Deeprails # The action used to improve outputs that fail one or more guardrail metrics for # the workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. module ImprovementAction diff --git a/rbi/deeprails/models/defend_update_workflow_params.rbi b/rbi/deeprails/models/defend_update_workflow_params.rbi index e6dc87b..17b3c02 100644 --- a/rbi/deeprails/models/defend_update_workflow_params.rbi +++ b/rbi/deeprails/models/defend_update_workflow_params.rbi @@ -28,24 +28,10 @@ module Deeprails sig { params(name: String).void } attr_writer :name - # Type of thresholds to use for the workflow, either `automatic` or `custom`. - sig do - returns( - T.nilable(Deeprails::DefendUpdateWorkflowParams::Type::OrSymbol) - ) - end - attr_reader :type - - sig do - params(type: Deeprails::DefendUpdateWorkflowParams::Type::OrSymbol).void - end - attr_writer :type - sig do params( description: String, name: String, - type: Deeprails::DefendUpdateWorkflowParams::Type::OrSymbol, request_options: Deeprails::RequestOptions::OrHash ).returns(T.attached_class) end @@ -54,8 +40,6 @@ module Deeprails description: nil, # Name of the workflow. name: nil, - # Type of thresholds to use for the workflow, either `automatic` or `custom`. - type: nil, request_options: {} ) end @@ -65,43 +49,12 @@ module Deeprails { description: String, name: String, - type: Deeprails::DefendUpdateWorkflowParams::Type::OrSymbol, request_options: Deeprails::RequestOptions } ) end def to_hash end - - # Type of thresholds to use for the workflow, either `automatic` or `custom`. - module Type - extend Deeprails::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Deeprails::DefendUpdateWorkflowParams::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTOMATIC = - T.let( - :automatic, - Deeprails::DefendUpdateWorkflowParams::Type::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - Deeprails::DefendUpdateWorkflowParams::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Deeprails::DefendUpdateWorkflowParams::Type::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/deeprails/models/monitor_retrieve_response.rbi b/rbi/deeprails/models/monitor_retrieve_response.rbi index e33b560..a8726b1 100644 --- a/rbi/deeprails/models/monitor_retrieve_response.rbi +++ b/rbi/deeprails/models/monitor_retrieve_response.rbi @@ -15,7 +15,6 @@ module Deeprails sig { returns(T::Boolean) } attr_accessor :success - # Detailed response payload for retrieving a monitor and its evaluations. sig do returns(T.nilable(Deeprails::Models::MonitorRetrieveResponse::Data)) end @@ -47,7 +46,6 @@ module Deeprails def self.new( # Represents whether the request was completed successfully. success:, - # Detailed response payload for retrieving a monitor and its evaluations. data: nil, # The accompanying message for the request. Includes error details when # applicable. @@ -149,7 +147,6 @@ module Deeprails sig { params(user_id: String).void } attr_writer :user_id - # Detailed response payload for retrieving a monitor and its evaluations. sig do params( monitor_id: String, diff --git a/rbi/deeprails/models/monitor_submit_event_response.rbi b/rbi/deeprails/models/monitor_submit_event_response.rbi index ff850c8..b278181 100644 --- a/rbi/deeprails/models/monitor_submit_event_response.rbi +++ b/rbi/deeprails/models/monitor_submit_event_response.rbi @@ -15,7 +15,6 @@ module Deeprails sig { returns(T::Boolean) } attr_accessor :success - # Response payload for monitor event operations. sig do returns(T.nilable(Deeprails::Models::MonitorSubmitEventResponse::Data)) end @@ -47,7 +46,6 @@ module Deeprails def self.new( # Represents whether the request was completed successfully. success:, - # Response payload for monitor event operations. data: nil, # The accompanying message for the request. Includes error details when # applicable. @@ -95,7 +93,6 @@ module Deeprails sig { params(created_at: Time).void } attr_writer :created_at - # Response payload for monitor event operations. sig do params( evaluation_id: String, diff --git a/rbi/deeprails/models/workflow_event_response.rbi b/rbi/deeprails/models/workflow_event_response.rbi index b19fbe6..2d9d3db 100644 --- a/rbi/deeprails/models/workflow_event_response.rbi +++ b/rbi/deeprails/models/workflow_event_response.rbi @@ -40,7 +40,6 @@ module Deeprails sig { params(filtered: T::Boolean).void } attr_writer :filtered - # Response payload for workflow event operations. sig do params( event_id: String, diff --git a/rbi/deeprails/resources/defend.rbi b/rbi/deeprails/resources/defend.rbi index 814f568..594ac65 100644 --- a/rbi/deeprails/resources/defend.rbi +++ b/rbi/deeprails/resources/defend.rbi @@ -3,8 +3,8 @@ module Deeprails module Resources class Defend - # Create a new guardrail workflow with optional guardrail thresholds and - # improvement actions. + # Use this endpoint to create a new guardrail workflow with optional guardrail + # thresholds and improvement actions sig do params( improvement_action: @@ -24,7 +24,7 @@ module Deeprails def create_workflow( # The action used to improve outputs that fail one or guardrail metrics for the # workflow events. May be `regenerate`, `fixit`, or null which represents “do - # nothing”. ReGen runs the user's exact input prompt with minor induced variance. + # nothing”. Regenerate runs the user's input prompt with minor induced variance. # Fixit attempts to directly address the shortcomings of the output using the # guardrail failure rationale. Do nothing does not attempt any improvement. improvement_action:, @@ -54,7 +54,7 @@ module Deeprails ) end - # Retrieve a specific event of a guardrail workflow. + # Use this endpoint to retrieve a specific event of a guardrail workflow sig do params( event_id: String, @@ -71,7 +71,7 @@ module Deeprails ) end - # Retrieve the details for a specific guardrail workflow. + # Use this endpoint to retrieve the details for a specific defend workflow sig do params( workflow_id: String, @@ -85,7 +85,8 @@ module Deeprails ) end - # Submit a model input and output pair to a workflow for evaluation. + # Use this endpoint to submit a model input and output pair to a workflow for + # evaluation sig do params( workflow_id: String, @@ -119,13 +120,12 @@ module Deeprails ) end - # Update an existing guardrail workflow. + # Use this endpoint to update an existing guardrail workflow sig do params( workflow_id: String, description: String, name: String, - type: Deeprails::DefendUpdateWorkflowParams::Type::OrSymbol, request_options: Deeprails::RequestOptions::OrHash ).returns(Deeprails::DefendResponse) end @@ -136,8 +136,6 @@ module Deeprails description: nil, # Name of the workflow. name: nil, - # Type of thresholds to use for the workflow, either `automatic` or `custom`. - type: nil, request_options: {} ) end diff --git a/rbi/deeprails/resources/evaluate.rbi b/rbi/deeprails/resources/evaluate.rbi index 92d4e75..e8a1ae5 100644 --- a/rbi/deeprails/resources/evaluate.rbi +++ b/rbi/deeprails/resources/evaluate.rbi @@ -43,7 +43,7 @@ module Deeprails ) end - # Retrieve the evaluation record for a given evaluation ID. + # Use this endpoint to retrieve the evaluation record for a given evaluation ID sig do params( eval_id: String, diff --git a/rbi/deeprails/resources/monitor.rbi b/rbi/deeprails/resources/monitor.rbi index 9fe3710..fc47109 100644 --- a/rbi/deeprails/resources/monitor.rbi +++ b/rbi/deeprails/resources/monitor.rbi @@ -3,7 +3,8 @@ module Deeprails module Resources class Monitor - # Create a new monitor to evaluate model inputs and outputs using guardrails. + # Use this endpoint to create a new monitor to evaluate model inputs and outputs + # using guardrails sig do params( name: String, @@ -20,7 +21,8 @@ module Deeprails ) end - # Retrieve the details and evaluations associated with a specific monitor. + # Use this endpoint to retrieve the details and evaluations associated with a + # specific monitor sig do params( monitor_id: String, @@ -37,7 +39,8 @@ module Deeprails ) end - # Update the name, description, or status of an existing monitor. + # Use this endpoint to update the name, description, or status of an existing + # monitor sig do params( monitor_id: String, @@ -62,7 +65,8 @@ module Deeprails ) end - # Submit a model input and output pair to a monitor for evaluation. + # Use this endpoint to submit a model input and output pair to a monitor for + # evaluation sig do params( monitor_id: String, diff --git a/sig/deeprails/models/defend_update_workflow_params.rbs b/sig/deeprails/models/defend_update_workflow_params.rbs index 772d106..b1c82f4 100644 --- a/sig/deeprails/models/defend_update_workflow_params.rbs +++ b/sig/deeprails/models/defend_update_workflow_params.rbs @@ -1,11 +1,7 @@ module Deeprails module Models type defend_update_workflow_params = - { - description: String, - name: String, - type: Deeprails::Models::DefendUpdateWorkflowParams::type_ - } + { description: String, name: String } & Deeprails::Internal::Type::request_parameters class DefendUpdateWorkflowParams < Deeprails::Internal::Type::BaseModel @@ -20,36 +16,17 @@ module Deeprails def name=: (String) -> String - attr_reader type: Deeprails::Models::DefendUpdateWorkflowParams::type_? - - def type=: ( - Deeprails::Models::DefendUpdateWorkflowParams::type_ - ) -> Deeprails::Models::DefendUpdateWorkflowParams::type_ - def initialize: ( ?description: String, ?name: String, - ?type: Deeprails::Models::DefendUpdateWorkflowParams::type_, ?request_options: Deeprails::request_opts ) -> void def to_hash: -> { description: String, name: String, - type: Deeprails::Models::DefendUpdateWorkflowParams::type_, request_options: Deeprails::RequestOptions } - - type type_ = :automatic | :custom - - module Type - extend Deeprails::Internal::Type::Enum - - AUTOMATIC: :automatic - CUSTOM: :custom - - def self?.values: -> ::Array[Deeprails::Models::DefendUpdateWorkflowParams::type_] - end end end end diff --git a/sig/deeprails/resources/defend.rbs b/sig/deeprails/resources/defend.rbs index f716160..17ba5fc 100644 --- a/sig/deeprails/resources/defend.rbs +++ b/sig/deeprails/resources/defend.rbs @@ -37,7 +37,6 @@ module Deeprails String workflow_id, ?description: String, ?name: String, - ?type: Deeprails::Models::DefendUpdateWorkflowParams::type_, ?request_options: Deeprails::request_opts ) -> Deeprails::DefendResponse From 306e416a9e441a3497cfe93c8f6de9eb2e96ae19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 05:38:57 +0000 Subject: [PATCH 3/3] release: 0.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/deeprails/version.rb | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3d2ac0b..10f3091 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.2.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 70b36a7..e1b31b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.2.0 (2025-10-08) + +Full Changelog: [v0.1.0...v0.2.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.1.0...v0.2.0) + +### Features + +* **api:** adding code samples ([9597e09](https://github.com/deeprails/deeprails-ruby-sdk/commit/9597e09967d659172d52c3935b3dd8f3e0018783)) + + +### Chores + +* sync repo ([a33597d](https://github.com/deeprails/deeprails-ruby-sdk/commit/a33597d5677081f50207f926f9950d9914700fb3)) + ## 0.1.0 (2025-10-07) Full Changelog: [v0.0.2...v0.1.0](https://github.com/deeprails/deeprails-ruby-sdk/compare/v0.0.2...v0.1.0) diff --git a/Gemfile.lock b/Gemfile.lock index cfc3e5c..b20f5f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - deeprails (0.1.0) + deeprails (0.2.0) connection_pool GEM diff --git a/README.md b/README.md index 5391191..a52da70 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "deeprails", "~> 0.1.0" +gem "deeprails", "~> 0.2.0" ``` diff --git a/lib/deeprails/version.rb b/lib/deeprails/version.rb index 3aef2cf..ca4812b 100644 --- a/lib/deeprails/version.rb +++ b/lib/deeprails/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Deeprails - VERSION = "0.1.0" + VERSION = "0.2.0" end