Skip to content

Commit c90ea3d

Browse files
feat(api): api update (#2532)
1 parent a43b825 commit c90ea3d

File tree

2 files changed

+173
-7
lines changed

2 files changed

+173
-7
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1655
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6db915d7030aa9f8d4d68b580cc2c2d740ef86c64a1c21410cc88213b6f6ab40.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-77660d4b73b127e706d861f689edd9c335916dab968ea50cc84dedc5b8b3eb78.yml

Diff for: src/resources/ai/ai.ts

+172-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export type AIRunResponse =
6464
| AIRunResponse.UnionMember7
6565
| AIRunResponse.Translation
6666
| AIRunResponse.Summarization
67-
| AIRunResponse.ImageToText;
67+
| AIRunResponse.ImageToText
68+
| AIRunResponse.ImageTextToText;
6869

6970
export namespace AIRunResponse {
7071
export interface TextClassification {
@@ -186,7 +187,7 @@ export namespace AIRunResponse {
186187
/**
187188
* The generated text response from the model
188189
*/
189-
response?: string;
190+
response: string;
190191

191192
/**
192193
* An array of tool calls requests made during the response generation
@@ -250,6 +251,10 @@ export namespace AIRunResponse {
250251
export interface ImageToText {
251252
description?: string;
252253
}
254+
255+
export interface ImageTextToText {
256+
description?: string;
257+
}
253258
}
254259

255260
export type AIRunParams =
@@ -264,7 +269,9 @@ export type AIRunParams =
264269
| AIRunParams.Messages
265270
| AIRunParams.Translation
266271
| AIRunParams.Summarization
267-
| AIRunParams.ImageToText;
272+
| AIRunParams.ImageToText
273+
| AIRunParams.Variant12
274+
| AIRunParams.Variant13;
268275

269276
export declare namespace AIRunParams {
270277
export interface TextClassification {
@@ -355,7 +362,7 @@ export declare namespace AIRunParams {
355362
account_id: string;
356363

357364
/**
358-
* Body param: A text description of the image you want to generate
365+
* Body param: A text description of the audio you want to generate
359366
*/
360367
prompt: string;
361368

@@ -549,6 +556,12 @@ export declare namespace AIRunParams {
549556
*/
550557
presence_penalty?: number;
551558

559+
/**
560+
* Body param: If true, a chat template is not applied and you must adhere to the
561+
* specific model's expected formatting.
562+
*/
563+
raw?: boolean;
564+
552565
/**
553566
* Body param: Penalty for repeated tokens; higher values discourage repetition.
554567
*/
@@ -565,7 +578,8 @@ export declare namespace AIRunParams {
565578
seed?: number;
566579

567580
/**
568-
* Body param: If true, the response will be streamed back incrementally.
581+
* Body param: If true, the response will be streamed back incrementally using SSE,
582+
* Server Sent Events.
569583
*/
570584
stream?: boolean;
571585

@@ -588,7 +602,7 @@ export declare namespace AIRunParams {
588602
top_k?: number;
589603

590604
/**
591-
* Body param: Controls the creativity of the AI's responses by adjusting how many
605+
* Body param: Adjusts the creativity of the AI's responses by controlling how many
592606
* possible words it considers. Lower values make outputs more predictable; higher
593607
* values allow for more varied and creative responses.
594608
*/
@@ -854,6 +868,158 @@ export declare namespace AIRunParams {
854868
*/
855869
top_p?: number;
856870
}
871+
872+
export interface Variant12 {
873+
/**
874+
* Path param:
875+
*/
876+
account_id: string;
877+
878+
/**
879+
* Body param: Image in base64 encoded format.
880+
*/
881+
image: string;
882+
883+
/**
884+
* Body param: The input text prompt for the model to generate a response.
885+
*/
886+
prompt: string;
887+
888+
/**
889+
* Body param: Decreases the likelihood of the model repeating the same lines
890+
* verbatim.
891+
*/
892+
frequency_penalty?: number;
893+
894+
/**
895+
* Body param: Whether to ignore the EOS token and continue generating tokens after
896+
* the EOS token is generated.
897+
*/
898+
ignore_eos?: boolean;
899+
900+
/**
901+
* Body param: The maximum number of tokens to generate in the response.
902+
*/
903+
max_tokens?: number;
904+
905+
/**
906+
* Body param: Increases the likelihood of the model introducing new topics.
907+
*/
908+
presence_penalty?: number;
909+
910+
/**
911+
* Body param: Penalty for repeated tokens; higher values discourage repetition.
912+
*/
913+
repetition_penalty?: number;
914+
915+
/**
916+
* Body param: Random seed for reproducibility of the generation.
917+
*/
918+
seed?: number;
919+
920+
/**
921+
* Body param: Controls the randomness of the output; higher values produce more
922+
* random results.
923+
*/
924+
temperature?: number;
925+
926+
/**
927+
* Body param: Limits the AI to choose from the top 'k' most probable words. Lower
928+
* values make responses more focused; higher values introduce more variety and
929+
* potential surprises.
930+
*/
931+
top_k?: number;
932+
933+
/**
934+
* Body param: Controls the creativity of the AI's responses by adjusting how many
935+
* possible words it considers. Lower values make outputs more predictable; higher
936+
* values allow for more varied and creative responses.
937+
*/
938+
top_p?: number;
939+
}
940+
941+
export interface Variant13 {
942+
/**
943+
* Path param:
944+
*/
945+
account_id: string;
946+
947+
/**
948+
* Body param: Image in base64 encoded format.
949+
*/
950+
image: string;
951+
952+
/**
953+
* Body param: An array of message objects representing the conversation history.
954+
*/
955+
messages: Array<Variant13.Message>;
956+
957+
/**
958+
* Body param: Decreases the likelihood of the model repeating the same lines
959+
* verbatim.
960+
*/
961+
frequency_penalty?: number;
962+
963+
/**
964+
* Body param: Whether to ignore the EOS token and continue generating tokens after
965+
* the EOS token is generated.
966+
*/
967+
ignore_eos?: boolean;
968+
969+
/**
970+
* Body param: The maximum number of tokens to generate in the response.
971+
*/
972+
max_tokens?: number;
973+
974+
/**
975+
* Body param: Increases the likelihood of the model introducing new topics.
976+
*/
977+
presence_penalty?: number;
978+
979+
/**
980+
* Body param: Penalty for repeated tokens; higher values discourage repetition.
981+
*/
982+
repetition_penalty?: number;
983+
984+
/**
985+
* Body param: Random seed for reproducibility of the generation.
986+
*/
987+
seed?: number;
988+
989+
/**
990+
* Body param: Controls the randomness of the output; higher values produce more
991+
* random results.
992+
*/
993+
temperature?: number;
994+
995+
/**
996+
* Body param: Limits the AI to choose from the top 'k' most probable words. Lower
997+
* values make responses more focused; higher values introduce more variety and
998+
* potential surprises.
999+
*/
1000+
top_k?: number;
1001+
1002+
/**
1003+
* Body param: Controls the creativity of the AI's responses by adjusting how many
1004+
* possible words it considers. Lower values make outputs more predictable; higher
1005+
* values allow for more varied and creative responses.
1006+
*/
1007+
top_p?: number;
1008+
}
1009+
1010+
export namespace Variant13 {
1011+
export interface Message {
1012+
/**
1013+
* The content of the message as a string.
1014+
*/
1015+
content: string;
1016+
1017+
/**
1018+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
1019+
*/
1020+
role: string;
1021+
}
1022+
}
8571023
}
8581024

8591025
AI.Finetunes = Finetunes;

0 commit comments

Comments
 (0)