Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #1131

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
139 changes: 133 additions & 6 deletions src/resources/workers/ai/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -288,12 +289,22 @@ export namespace AIRunParams {
image?: Array<number>;
}

export interface TextGeneration {
export interface Variant7 {
/**
* Path param:
*/
account_id: string;

/**
* Body param:
*/
prompt: string;

/**
* Body param:
*/
frequency_penalty?: number;

/**
* Body param:
*/
Expand All @@ -307,30 +318,146 @@ export namespace AIRunParams {
/**
* Body param:
*/
messages?: Array<AIRunParams.TextGeneration.Message>;
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<AIRunParams.Variant8.Message>;

/**
* 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<AIRunParams.Variant8.Tool>;

/**
* 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<string, Parameters.Properties>;

required?: Array<string>;

type?: string;
}

export namespace Parameters {
export interface Properties {
description?: string;

type?: string;
}
}
}
}
}

export interface Translation {
Expand Down