From 2aa24b5286836b5038a23a19c04a86fff5f4fabb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 01:21:46 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#1131) --- .stats.yml | 2 +- src/resources/workers/ai/ai.ts | 139 +++++++++++++++++++++++++++++++-- 2 files changed, 134 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index fb607b8531..53103a816f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1256 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9f6e9da01b27f4f387991ca14ecafe0c42a356cc3c47b269e5f8b4f6cd0ed700.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cb76af21f6fcf485b7e41586c3076cd45d25d6d04971c77ec814523b894dcb97.yml diff --git a/src/resources/workers/ai/ai.ts b/src/resources/workers/ai/ai.ts index 1c3daea167..94ed7909e2 100644 --- a/src/resources/workers/ai/ai.ts +++ b/src/resources/workers/ai/ai.ts @@ -138,7 +138,8 @@ export type AIRunParams = | AIRunParams.AutomaticSpeechRecognition | AIRunParams.ImageClassification | AIRunParams.ObjectDetection - | AIRunParams.TextGeneration + | AIRunParams.Variant7 + | AIRunParams.Variant8 | AIRunParams.Translation | AIRunParams.Summarization | AIRunParams.ImageToText; @@ -288,12 +289,22 @@ export namespace AIRunParams { image?: Array; } - export interface TextGeneration { + export interface Variant7 { /** * Path param: */ account_id: string; + /** + * Body param: + */ + prompt: string; + + /** + * Body param: + */ + frequency_penalty?: number; + /** * Body param: */ @@ -307,30 +318,146 @@ export namespace AIRunParams { /** * Body param: */ - messages?: Array; + presence_penalty?: number; /** * Body param: */ - prompt?: string; + raw?: boolean; /** * Body param: */ - raw?: boolean; + repetition_penalty?: number; + + /** + * Body param: + */ + seed?: number; + + /** + * Body param: + */ + stream?: boolean; + + /** + * Body param: + */ + temperature?: number; + + /** + * Body param: + */ + top_k?: number; + + /** + * Body param: + */ + top_p?: number; + } + + export interface Variant8 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + messages: Array; + + /** + * Body param: + */ + frequency_penalty?: number; + + /** + * Body param: + */ + max_tokens?: number; + + /** + * Body param: + */ + presence_penalty?: number; + + /** + * Body param: + */ + repetition_penalty?: number; + + /** + * Body param: + */ + seed?: number; /** * Body param: */ stream?: boolean; + + /** + * Body param: + */ + temperature?: number; + + /** + * Body param: + */ + tools?: Array; + + /** + * Body param: + */ + top_k?: number; + + /** + * Body param: + */ + top_p?: number; } - export namespace TextGeneration { + export namespace Variant8 { export interface Message { content: string; role: string; } + + export interface Tool { + function?: Tool.Function; + + type?: string; + } + + export namespace Tool { + export interface Function { + description?: string; + + name?: string; + + parameters?: Function.Parameters; + } + + export namespace Function { + export interface Parameters { + properties?: Record; + + required?: Array; + + type?: string; + } + + export namespace Parameters { + export interface Properties { + description?: string; + + type?: string; + } + } + } + } } export interface Translation {