Skip to content

Commit 0067a21

Browse files
feat(api): update urls for endpoints
1 parent 3be0987 commit 0067a21

11 files changed

Lines changed: 442 additions & 98 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 193
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml
3-
openapi_spec_hash: a1913979235ce152a8dc380fabe5362e
4-
config_hash: 13e570f98198e8fd1dfcb7ca59d73e0d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-93df5cb3d61c1bbcab2a4bbf3f0775454bd185a400bc140c61dbf36e108dbf89.yml
3+
openapi_spec_hash: 0126adf782c5feac3d8e682e466c3cf7
4+
config_hash: 3f968a57adb20643373c134efc9af01a

src/resources/agents/chat/completions.ts

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class Completions extends APIResource {
4141
): APIPromise<CompletionCreateResponse> | APIPromise<Stream<Shared.ChatCompletionChunk>> {
4242
return this._client.post('/chat/completions?agent=true', {
4343
body,
44+
defaultBaseURL: '{agentEndpoint}/api/v1',
4445
...options,
4546
stream: body.stream ?? false,
4647
}) as APIPromise<CompletionCreateResponse> | APIPromise<Stream<Shared.ChatCompletionChunk>>;
@@ -281,6 +282,12 @@ export interface CompletionCreateParamsBase {
281282
*/
282283
presence_penalty?: number | null;
283284

285+
/**
286+
* Constrains effort on reasoning for reasoning models. Reducing reasoning effort
287+
* can result in faster responses and fewer tokens used on reasoning in a response.
288+
*/
289+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
290+
284291
/**
285292
* Up to 4 sequences where the API will stop generating further tokens. The
286293
* returned text will not contain the stop sequence.
@@ -552,7 +559,14 @@ export namespace CompletionCreateParams {
552559
content:
553560
| string
554561
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartText
555-
| Array<string | ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartText>;
562+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartImageURL
563+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartVideoURL
564+
| Array<
565+
| string
566+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartText
567+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartImageURL
568+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartVideoURL
569+
>;
556570

557571
/**
558572
* The role of the messages author, in this case `user`.
@@ -598,6 +612,65 @@ export namespace CompletionCreateParams {
598612
}
599613
}
600614

615+
/**
616+
* Content part with type and image URL.
617+
*/
618+
export interface ChatCompletionRequestContentPartImageURL {
619+
/**
620+
* Image URL settings.
621+
*/
622+
image_url: ChatCompletionRequestContentPartImageURL.ImageURL;
623+
624+
/**
625+
* The type of content part
626+
*/
627+
type: 'image_url';
628+
}
629+
630+
export namespace ChatCompletionRequestContentPartImageURL {
631+
/**
632+
* Image URL settings.
633+
*/
634+
export interface ImageURL {
635+
/**
636+
* A URL or data URL containing image content.
637+
*/
638+
url: string;
639+
640+
/**
641+
* Optional detail level for image understanding.
642+
*/
643+
detail?: 'auto' | 'low' | 'high';
644+
}
645+
}
646+
647+
/**
648+
* Content part with type and video URL.
649+
*/
650+
export interface ChatCompletionRequestContentPartVideoURL {
651+
/**
652+
* The type of content part
653+
*/
654+
type: 'video_url';
655+
656+
/**
657+
* Video URL settings.
658+
*/
659+
video_url: ChatCompletionRequestContentPartVideoURL.VideoURL;
660+
}
661+
662+
export namespace ChatCompletionRequestContentPartVideoURL {
663+
/**
664+
* Video URL settings.
665+
*/
666+
export interface VideoURL {
667+
/**
668+
* A URL or data URL containing video content.
669+
*/
670+
url: string;
671+
}
672+
}
673+
601674
/**
602675
* Content part with type and text
603676
*/
@@ -634,6 +707,65 @@ export namespace CompletionCreateParams {
634707
ttl?: '5m' | '1h';
635708
}
636709
}
710+
711+
/**
712+
* Content part with type and image URL.
713+
*/
714+
export interface ChatCompletionRequestContentPartImageURL {
715+
/**
716+
* Image URL settings.
717+
*/
718+
image_url: ChatCompletionRequestContentPartImageURL.ImageURL;
719+
720+
/**
721+
* The type of content part
722+
*/
723+
type: 'image_url';
724+
}
725+
726+
export namespace ChatCompletionRequestContentPartImageURL {
727+
/**
728+
* Image URL settings.
729+
*/
730+
export interface ImageURL {
731+
/**
732+
* A URL or data URL containing image content.
733+
*/
734+
url: string;
735+
736+
/**
737+
* Optional detail level for image understanding.
738+
*/
739+
detail?: 'auto' | 'low' | 'high';
740+
}
741+
}
742+
743+
/**
744+
* Content part with type and video URL.
745+
*/
746+
export interface ChatCompletionRequestContentPartVideoURL {
747+
/**
748+
* The type of content part
749+
*/
750+
type: 'video_url';
751+
752+
/**
753+
* Video URL settings.
754+
*/
755+
video_url: ChatCompletionRequestContentPartVideoURL.VideoURL;
756+
}
757+
758+
export namespace ChatCompletionRequestContentPartVideoURL {
759+
/**
760+
* Video URL settings.
761+
*/
762+
export interface VideoURL {
763+
/**
764+
* A URL or data URL containing video content.
765+
*/
766+
url: string;
767+
}
768+
}
637769
}
638770

639771
/**

src/resources/chat/completions.ts

Lines changed: 138 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ export class Completions extends APIResource {
3838
body: CompletionCreateParams,
3939
options?: RequestOptions,
4040
): APIPromise<CompletionCreateResponse> | APIPromise<Stream<Shared.ChatCompletionChunk>> {
41-
return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false }) as
42-
| APIPromise<CompletionCreateResponse>
43-
| APIPromise<Stream<Shared.ChatCompletionChunk>>;
41+
return this._client.post('/chat/completions', {
42+
body,
43+
defaultBaseURL: '{inferenceEndpoint}/v1',
44+
...options,
45+
stream: body.stream ?? false,
46+
}) as APIPromise<CompletionCreateResponse> | APIPromise<Stream<Shared.ChatCompletionChunk>>;
4447
}
4548
}
4649

@@ -278,6 +281,12 @@ export interface CompletionCreateParamsBase {
278281
*/
279282
presence_penalty?: number | null;
280283

284+
/**
285+
* Constrains effort on reasoning for reasoning models. Reducing reasoning effort
286+
* can result in faster responses and fewer tokens used on reasoning in a response.
287+
*/
288+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
289+
281290
/**
282291
* Up to 4 sequences where the API will stop generating further tokens. The
283292
* returned text will not contain the stop sequence.
@@ -549,7 +558,14 @@ export namespace CompletionCreateParams {
549558
content:
550559
| string
551560
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartText
552-
| Array<string | ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartText>;
561+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartImageURL
562+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartVideoURL
563+
| Array<
564+
| string
565+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartText
566+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartImageURL
567+
| ChatCompletionRequestUserMessage.ChatCompletionRequestContentPartVideoURL
568+
>;
553569

554570
/**
555571
* The role of the messages author, in this case `user`.
@@ -595,6 +611,65 @@ export namespace CompletionCreateParams {
595611
}
596612
}
597613

614+
/**
615+
* Content part with type and image URL.
616+
*/
617+
export interface ChatCompletionRequestContentPartImageURL {
618+
/**
619+
* Image URL settings.
620+
*/
621+
image_url: ChatCompletionRequestContentPartImageURL.ImageURL;
622+
623+
/**
624+
* The type of content part
625+
*/
626+
type: 'image_url';
627+
}
628+
629+
export namespace ChatCompletionRequestContentPartImageURL {
630+
/**
631+
* Image URL settings.
632+
*/
633+
export interface ImageURL {
634+
/**
635+
* A URL or data URL containing image content.
636+
*/
637+
url: string;
638+
639+
/**
640+
* Optional detail level for image understanding.
641+
*/
642+
detail?: 'auto' | 'low' | 'high';
643+
}
644+
}
645+
646+
/**
647+
* Content part with type and video URL.
648+
*/
649+
export interface ChatCompletionRequestContentPartVideoURL {
650+
/**
651+
* The type of content part
652+
*/
653+
type: 'video_url';
654+
655+
/**
656+
* Video URL settings.
657+
*/
658+
video_url: ChatCompletionRequestContentPartVideoURL.VideoURL;
659+
}
660+
661+
export namespace ChatCompletionRequestContentPartVideoURL {
662+
/**
663+
* Video URL settings.
664+
*/
665+
export interface VideoURL {
666+
/**
667+
* A URL or data URL containing video content.
668+
*/
669+
url: string;
670+
}
671+
}
672+
598673
/**
599674
* Content part with type and text
600675
*/
@@ -631,6 +706,65 @@ export namespace CompletionCreateParams {
631706
ttl?: '5m' | '1h';
632707
}
633708
}
709+
710+
/**
711+
* Content part with type and image URL.
712+
*/
713+
export interface ChatCompletionRequestContentPartImageURL {
714+
/**
715+
* Image URL settings.
716+
*/
717+
image_url: ChatCompletionRequestContentPartImageURL.ImageURL;
718+
719+
/**
720+
* The type of content part
721+
*/
722+
type: 'image_url';
723+
}
724+
725+
export namespace ChatCompletionRequestContentPartImageURL {
726+
/**
727+
* Image URL settings.
728+
*/
729+
export interface ImageURL {
730+
/**
731+
* A URL or data URL containing image content.
732+
*/
733+
url: string;
734+
735+
/**
736+
* Optional detail level for image understanding.
737+
*/
738+
detail?: 'auto' | 'low' | 'high';
739+
}
740+
}
741+
742+
/**
743+
* Content part with type and video URL.
744+
*/
745+
export interface ChatCompletionRequestContentPartVideoURL {
746+
/**
747+
* The type of content part
748+
*/
749+
type: 'video_url';
750+
751+
/**
752+
* Video URL settings.
753+
*/
754+
video_url: ChatCompletionRequestContentPartVideoURL.VideoURL;
755+
}
756+
757+
export namespace ChatCompletionRequestContentPartVideoURL {
758+
/**
759+
* Video URL settings.
760+
*/
761+
export interface VideoURL {
762+
/**
763+
* A URL or data URL containing video content.
764+
*/
765+
url: string;
766+
}
767+
}
634768
}
635769

636770
/**

src/resources/images.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ export class Images extends APIResource {
4040
body: ImageGenerateParams,
4141
options?: RequestOptions,
4242
): APIPromise<ImageGenerateResponse> | APIPromise<Stream<Shared.ImageGenStreamEvent>> {
43-
return this._client.post('/images/generations', { body, ...options, stream: body.stream ?? false }) as
44-
| APIPromise<ImageGenerateResponse>
45-
| APIPromise<Stream<Shared.ImageGenStreamEvent>>;
43+
return this._client.post('/images/generations', {
44+
body,
45+
defaultBaseURL: '{inferenceEndpoint}/v1',
46+
...options,
47+
stream: body.stream ?? false,
48+
}) as APIPromise<ImageGenerateResponse> | APIPromise<Stream<Shared.ImageGenStreamEvent>>;
4649
}
4750
}
4851

0 commit comments

Comments
 (0)