From f64cf0f720a4a1241cd3ad27be67a1e10a030fa0 Mon Sep 17 00:00:00 2001 From: Devvrat Bhardwaj Date: Fri, 11 Jul 2025 12:50:24 -0400 Subject: [PATCH 1/4] Changed the inference endpoint to v3/detect --- src/resources/inference.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/inference.ts b/src/resources/inference.ts index 4945351..7a84041 100644 --- a/src/resources/inference.ts +++ b/src/resources/inference.ts @@ -11,7 +11,7 @@ export class Inference extends APIResource { body: InferenceDetectParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.post('/v2/detect', { body, ...options }); + return this._client.post('/v3/detect', { body, ...options }); } } From 333ea9112f8221f8cd8a52c81cb5322850d585ad Mon Sep 17 00:00:00 2001 From: Devvrat Bhardwaj Date: Mon, 14 Jul 2025 02:31:35 -0400 Subject: [PATCH 2/4] Added toolTrace support in the object-style call --- src/index.ts | 5 ++++- src/resources/decorators.ts | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 950685d..1e64ef5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -216,6 +216,7 @@ export class Client extends Core.APIClient { applicationName?: string; modelName?: string; mustCompute?: 'all_or_none' | 'ignore_failures'; + toolTrace?: any[]; }): Promise; // Unified implementation for both call styles @@ -249,6 +250,7 @@ export class Client extends Core.APIClient { applicationName: arg1.applicationName, modelName: arg1.modelName, mustCompute: arg1.mustCompute ?? 'all_or_none', + toolTrace: arg1.toolTrace, }; } else { // Called using positional syntax (backward compatible) @@ -279,7 +281,8 @@ export class Client extends Core.APIClient { opts.publish, opts.applicationName, opts.modelName, - opts.mustCompute + opts.mustCompute, + opts.toolTrace ); } diff --git a/src/resources/decorators.ts b/src/resources/decorators.ts index 7c019ed..64d67b1 100644 --- a/src/resources/decorators.ts +++ b/src/resources/decorators.ts @@ -20,7 +20,8 @@ export class Decorators extends APIResource { publish?: boolean, applicationName?: string, modelName?: string, - mustCompute: 'all_or_none' | 'ignore_failures' = 'all_or_none' + mustCompute: 'all_or_none' | 'ignore_failures' = 'all_or_none', + toolTrace?: any[] ): Promise { try { // Prepare the payload for detect API @@ -35,6 +36,7 @@ export class Decorators extends APIResource { ...(publish ? { publish } : {}), // Only include publish if provided ...(applicationName ? { application_name: applicationName } : {}), // Only include application_name if provided ...(modelName ? { model_name: modelName } : {}), // Only include model_name if provided + ...(toolTrace ? { tool_trace: toolTrace } : {}), must_compute: mustCompute, // Always include must_compute with default value }; From 2a5cf8c6585cf4db9cb5f4e136bd067eefe4310b Mon Sep 17 00:00:00 2001 From: Devvrat Bhardwaj Date: Tue, 15 Jul 2025 03:38:50 -0400 Subject: [PATCH 3/4] Added the tool_trace field to the InferenceDetectParams.Body interface --- src/resources/inference.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/resources/inference.ts b/src/resources/inference.ts index 7a84041..7b3a057 100644 --- a/src/resources/inference.ts +++ b/src/resources/inference.ts @@ -74,6 +74,11 @@ export namespace InferenceDetectParams { * Indicates the computation strategy. Must be either 'all_or_none' or 'ignore_failures'. */ must_compute?: 'all_or_none' | 'ignore_failures'; + + /** + * Optional tool trace for analysis + */ + tool_trace?: any[]; } export namespace Body { From f95f25bc632745dd36116e2923b93fafcd8051e9 Mon Sep 17 00:00:00 2001 From: Devvrat Bhardwaj Date: Tue, 15 Jul 2025 14:07:58 -0400 Subject: [PATCH 4/4] Reverted detect endpoint to v2/detect --- src/resources/inference.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/inference.ts b/src/resources/inference.ts index 7b3a057..04bfb45 100644 --- a/src/resources/inference.ts +++ b/src/resources/inference.ts @@ -11,7 +11,7 @@ export class Inference extends APIResource { body: InferenceDetectParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.post('/v3/detect', { body, ...options }); + return this._client.post('/v2/detect', { body, ...options }); } }