diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 37fcefa..5fdd883 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "1.1.0" } diff --git a/.stats.yml b/.stats.yml index 038dee7..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: ce7e997e94b56d2c2403f39c42b96a98 +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/CHANGELOG.md b/CHANGELOG.md index aa0124a..21f1dbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.1.0 (2025-10-08) + +Full Changelog: [v1.0.0...v1.1.0](https://github.com/deeprails/deeprails-typescript-sdk/compare/v1.0.0...v1.1.0) + +### Features + +* **api:** adding code samples ([df17733](https://github.com/deeprails/deeprails-typescript-sdk/commit/df1773357e9cb9a183ec41fabd9980dc436ca20c)) +* **api:** manual updates ([8a5bb06](https://github.com/deeprails/deeprails-typescript-sdk/commit/8a5bb0669951aa87771073158032e029fd78c332)) + + +### Chores + +* configure new SDK language ([1726711](https://github.com/deeprails/deeprails-typescript-sdk/commit/17267115aacd1b5cadfcae447f39daa397318328)) +* configure new SDK language ([1cccec5](https://github.com/deeprails/deeprails-typescript-sdk/commit/1cccec57666d11ac0b3e3e7de455aaa35c9a9c41)) + ## 1.0.0 (2025-10-07) Full Changelog: [v0.0.1...v1.0.0](https://github.com/deeprails/deeprails-typescript-sdk/compare/v0.0.1...v1.0.0) diff --git a/README.md b/README.md index 0ea92f7..5f6def6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This library provides convenient access to the Deeprails REST API from server-side TypeScript or JavaScript. -The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.deeprails.com](https://docs.deeprails.com). The full API of this library can be found in [api.md](api.md). ## Installation @@ -26,7 +26,7 @@ const client = new Deeprails({ const defendResponse = await client.defend.createWorkflow({ 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', }); @@ -48,7 +48,7 @@ const client = new Deeprails({ const params: Deeprails.DefendCreateWorkflowParams = { 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', }; @@ -68,7 +68,7 @@ a subclass of `APIError` will be thrown: const defendResponse = await client.defend .createWorkflow({ 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', }) @@ -112,7 +112,7 @@ const client = new Deeprails({ }); // Or, configure per-request: -await client.defend.createWorkflow({ improvement_action: 'fixit', metrics: { completeness: 0.85, instruction_adherence: 0.75 }, name: 'Push Alert Workflow', type: 'custom' }, { +await client.defend.createWorkflow({ improvement_action: 'fixit', metrics: { completeness: 0.8, instruction_adherence: 0.75 }, name: 'Push Alert Workflow', type: 'custom' }, { maxRetries: 5, }); ``` @@ -129,7 +129,7 @@ const client = new Deeprails({ }); // Override per-request: -await client.defend.createWorkflow({ improvement_action: 'fixit', metrics: { completeness: 0.85, instruction_adherence: 0.75 }, name: 'Push Alert Workflow', type: 'custom' }, { +await client.defend.createWorkflow({ improvement_action: 'fixit', metrics: { completeness: 0.8, instruction_adherence: 0.75 }, name: 'Push Alert Workflow', type: 'custom' }, { timeout: 5 * 1000, }); ``` @@ -155,7 +155,7 @@ const client = new Deeprails(); const response = await client.defend .createWorkflow({ 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', }) @@ -166,7 +166,7 @@ console.log(response.statusText); // access the underlying Response object const { data: defendResponse, response: raw } = await client.defend .createWorkflow({ 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', }) diff --git a/package.json b/package.json index 63cfb0e..27e2be8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deeprails", - "version": "1.0.0", + "version": "1.1.0", "description": "The official TypeScript library for the Deeprails API", "author": { "name": "DeepRails", diff --git a/src/resources/defend.ts b/src/resources/defend.ts index d49cc73..4c0a19b 100644 --- a/src/resources/defend.ts +++ b/src/resources/defend.ts @@ -7,15 +7,15 @@ import { path } from '../internal/utils/path'; export class Defend extends APIResource { /** - * 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 */ createWorkflow(body: DefendCreateWorkflowParams, options?: RequestOptions): APIPromise { return this._client.post('/defend', { body, ...options }); } /** - * Retrieve a specific event of a guardrail workflow. + * Use this endpoint to retrieve a specific event of a guardrail workflow */ retrieveEvent( eventID: string, @@ -27,14 +27,15 @@ export class Defend extends APIResource { } /** - * Retrieve the details for a specific guardrail workflow. + * Use this endpoint to retrieve the details for a specific defend workflow */ retrieveWorkflow(workflowID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/defend/${workflowID}`, options); } /** - * 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 */ submitEvent( workflowID: string, @@ -45,7 +46,7 @@ export class Defend extends APIResource { } /** - * Update an existing guardrail workflow. + * Use this endpoint to update an existing guardrail workflow */ updateWorkflow( workflowID: string, @@ -56,9 +57,6 @@ export class Defend extends APIResource { } } -/** - * Response payload for guardrail workflow operations. - */ export interface DefendResponse { /** * Name of the workflow. @@ -83,7 +81,7 @@ export interface DefendResponse { /** * 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. */ @@ -112,9 +110,6 @@ export interface DefendResponse { success_rate?: number; } -/** - * Response payload for workflow event operations. - */ export interface WorkflowEventResponse { /** * A unique workflow event ID. @@ -149,7 +144,7 @@ export interface DefendCreateWorkflowParams { /** * 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. */ @@ -260,11 +255,6 @@ export interface DefendUpdateWorkflowParams { * Name of the workflow. */ name?: string; - - /** - * Type of thresholds to use for the workflow, either `automatic` or `custom`. - */ - type?: 'automatic' | 'custom'; } export declare namespace Defend { diff --git a/src/resources/evaluate.ts b/src/resources/evaluate.ts index d8e5153..9941dd7 100644 --- a/src/resources/evaluate.ts +++ b/src/resources/evaluate.ts @@ -15,7 +15,7 @@ export class Evaluate extends APIResource { } /** - * Retrieve the evaluation record for a given evaluation ID. + * Use this endpoint to retrieve the evaluation record for a given evaluation ID */ retrieve(evalID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/evaluate/${evalID}`, options); diff --git a/src/resources/monitor.ts b/src/resources/monitor.ts index 6d3ef91..f4ba19f 100644 --- a/src/resources/monitor.ts +++ b/src/resources/monitor.ts @@ -8,14 +8,16 @@ import { path } from '../internal/utils/path'; export class Monitor extends APIResource { /** - * 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 */ create(body: MonitorCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/monitor', { body, ...options }); } /** - * Retrieve the details and evaluations associated with a specific monitor. + * Use this endpoint to retrieve the details and evaluations associated with a + * specific monitor */ retrieve( monitorID: string, @@ -26,7 +28,8 @@ export class Monitor extends APIResource { } /** - * Update the name, description, or status of an existing monitor. + * Use this endpoint to update the name, description, or status of an existing + * monitor */ update( monitorID: string, @@ -37,7 +40,8 @@ export class Monitor extends APIResource { } /** - * 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 */ submitEvent( monitorID: string, @@ -57,9 +61,6 @@ export interface APIResponse { */ success: boolean; - /** - * Response payload for creating or updating a monitor. - */ data?: APIResponse.Data; /** @@ -70,9 +71,6 @@ export interface APIResponse { } export namespace APIResponse { - /** - * Response payload for creating or updating a monitor. - */ export interface Data { /** * A unique monitor ID. @@ -121,9 +119,6 @@ export interface MonitorRetrieveResponse { */ success: boolean; - /** - * Detailed response payload for retrieving a monitor and its evaluations. - */ data?: MonitorRetrieveResponse.Data; /** @@ -134,9 +129,6 @@ export interface MonitorRetrieveResponse { } export namespace MonitorRetrieveResponse { - /** - * Detailed response payload for retrieving a monitor and its evaluations. - */ export interface Data { /** * A unique monitor ID. @@ -232,9 +224,6 @@ export interface MonitorSubmitEventResponse { */ success: boolean; - /** - * Response payload for monitor event operations. - */ data?: MonitorSubmitEventResponse.Data; /** @@ -245,9 +234,6 @@ export interface MonitorSubmitEventResponse { } export namespace MonitorSubmitEventResponse { - /** - * Response payload for monitor event operations. - */ export interface Data { /** * A unique evaluation ID associated with this event. diff --git a/src/version.ts b/src/version.ts index bea2896..c80f975 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.0.0'; // x-release-please-version +export const VERSION = '1.1.0'; // x-release-please-version diff --git a/tests/api-resources/defend.test.ts b/tests/api-resources/defend.test.ts index 7df59dd..e02076b 100644 --- a/tests/api-resources/defend.test.ts +++ b/tests/api-resources/defend.test.ts @@ -114,7 +114,7 @@ describe('resource defend', () => { await expect( client.defend.updateWorkflow( 'workflow_id', - { description: 'description', name: 'name', type: 'automatic' }, + { description: 'description', name: 'name' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Deeprails.NotFoundError);