Skip to content

Commit eec77a9

Browse files
feat(api): update via SDK Studio (#235)
1 parent 335e9b2 commit eec77a9

File tree

9 files changed

+66
-76
lines changed

9 files changed

+66
-76
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-9cff8ea13f14bd0899df69243fe78b4f88d4d0172263aa260af1ea66a7d0484e.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const { data: completionCreateResponse, response: raw } = await client.completio
158158
.create('1212121')
159159
.withResponse();
160160
console.log(raw.headers.get('X-My-Header'));
161-
console.log(completionCreateResponse.provider);
161+
console.log(completionCreateResponse.message);
162162
```
163163

164164
### Making custom/undocumented requests

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Methods:
1212

1313
Types:
1414

15-
- <code><a href="./src/resources/prompts.ts">ModelParameters</a></code>
15+
- <code><a href="./src/resources/prompts.ts">Parameters</a></code>
1616
- <code><a href="./src/resources/prompts.ts">PromptConfiguration</a></code>
1717
- <code><a href="./src/resources/prompts.ts">PromptListResponse</a></code>
1818
- <code><a href="./src/resources/prompts.ts">PromptDeleteResponse</a></code>
@@ -24,7 +24,7 @@ Methods:
2424
- <code title="get /sdk/v1/prompts">client.prompts.<a href="./src/resources/prompts.ts">list</a>() -> PromptListResponse</code>
2525
- <code title="delete /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">delete</a>(id) -> PromptDeleteResponse</code>
2626
- <code title="get /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">get</a>(id) -> PromptConfiguration</code>
27-
- <code title="post /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">getParameters</a>(id, { ...params }) -> ModelParameters</code>
27+
- <code title="post /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">getParameters</a>(id, { ...params }) -> Parameters</code>
2828

2929
# Tools
3030

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export namespace PromptFoundry {
194194
export import CompletionCreateParams = API.CompletionCreateParams;
195195

196196
export import Prompts = API.Prompts;
197-
export import ModelParameters = API.ModelParameters;
197+
export import Parameters = API.Parameters;
198198
export import PromptConfiguration = API.PromptConfiguration;
199199
export import PromptListResponse = API.PromptListResponse;
200200
export import PromptDeleteResponse = API.PromptDeleteResponse;

src/resources/completion.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ export interface CompletionCreateResponse {
3636
*/
3737
message: CompletionCreateResponse.Message;
3838

39-
name: string;
40-
41-
/**
42-
* The LLM model provider.
43-
*/
44-
provider: 'ANTHROPIC' | 'OPENAI';
45-
4639
stats: CompletionCreateResponse.Stats;
4740
}
4841

@@ -52,7 +45,7 @@ export namespace CompletionCreateResponse {
5245
*/
5346
export interface Message {
5447
content: Array<
55-
| Message.TextContentBlock
48+
| Message.TextContentBlockSchema
5649
| Message.ImageBase64ContentBlock
5750
| Message.ToolCallContentBlock
5851
| Message.ToolResultContentBlock
@@ -62,7 +55,7 @@ export namespace CompletionCreateResponse {
6255
}
6356

6457
export namespace Message {
65-
export interface TextContentBlock {
58+
export interface TextContentBlockSchema {
6659
text: string;
6760

6861
type: 'TEXT';
@@ -174,7 +167,7 @@ export interface CompletionCreateParams {
174167
export namespace CompletionCreateParams {
175168
export interface AppendMessage {
176169
content: Array<
177-
| AppendMessage.TextContentBlock
170+
| AppendMessage.TextContentBlockSchema
178171
| AppendMessage.ImageBase64ContentBlock
179172
| AppendMessage.ToolCallContentBlock
180173
| AppendMessage.ToolResultContentBlock
@@ -184,7 +177,7 @@ export namespace CompletionCreateParams {
184177
}
185178

186179
export namespace AppendMessage {
187-
export interface TextContentBlock {
180+
export interface TextContentBlockSchema {
188181
text: string;
189182

190183
type: 'TEXT';
@@ -248,7 +241,7 @@ export namespace CompletionCreateParams {
248241

249242
export interface OverrideMessage {
250243
content: Array<
251-
| OverrideMessage.TextContentBlock
244+
| OverrideMessage.TextContentBlockSchema
252245
| OverrideMessage.ImageBase64ContentBlock
253246
| OverrideMessage.ToolCallContentBlock
254247
| OverrideMessage.ToolResultContentBlock
@@ -258,7 +251,7 @@ export namespace CompletionCreateParams {
258251
}
259252

260253
export namespace OverrideMessage {
261-
export interface TextContentBlock {
254+
export interface TextContentBlockSchema {
262255
text: string;
263256

264257
type: 'TEXT';

src/resources/evaluations.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export interface Evaluation {
7474
export namespace Evaluation {
7575
export interface AppendedMessage {
7676
content: Array<
77-
| AppendedMessage.TextContentBlock
77+
| AppendedMessage.TextContentBlockSchema
7878
| AppendedMessage.ImageBase64ContentBlock
7979
| AppendedMessage.ToolCallContentBlock
8080
| AppendedMessage.ToolResultContentBlock
@@ -84,7 +84,7 @@ export namespace Evaluation {
8484
}
8585

8686
export namespace AppendedMessage {
87-
export interface TextContentBlock {
87+
export interface TextContentBlockSchema {
8888
text: string;
8989

9090
type: 'TEXT';
@@ -180,7 +180,7 @@ export interface EvaluationCreateParams {
180180
export namespace EvaluationCreateParams {
181181
export interface AppendedMessage {
182182
content: Array<
183-
| AppendedMessage.TextContentBlock
183+
| AppendedMessage.TextContentBlockSchema
184184
| AppendedMessage.ImageBase64ContentBlock
185185
| AppendedMessage.ToolCallContentBlock
186186
| AppendedMessage.ToolResultContentBlock
@@ -190,7 +190,7 @@ export namespace EvaluationCreateParams {
190190
}
191191

192192
export namespace AppendedMessage {
193-
export interface TextContentBlock {
193+
export interface TextContentBlockSchema {
194194
text: string;
195195

196196
type: 'TEXT';
@@ -280,7 +280,7 @@ export interface EvaluationUpdateParams {
280280
export namespace EvaluationUpdateParams {
281281
export interface AppendedMessage {
282282
content: Array<
283-
| AppendedMessage.TextContentBlock
283+
| AppendedMessage.TextContentBlockSchema
284284
| AppendedMessage.ImageBase64ContentBlock
285285
| AppendedMessage.ToolCallContentBlock
286286
| AppendedMessage.ToolResultContentBlock
@@ -290,7 +290,7 @@ export namespace EvaluationUpdateParams {
290290
}
291291

292292
export namespace AppendedMessage {
293-
export interface TextContentBlock {
293+
export interface TextContentBlockSchema {
294294
text: string;
295295

296296
type: 'TEXT';

src/resources/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export {
1919
EvaluationAssertions,
2020
} from './evaluation-assertions';
2121
export {
22-
ModelParameters,
22+
Parameters,
2323
PromptConfiguration,
2424
PromptListResponse,
2525
PromptDeleteResponse,

src/resources/prompts.ts

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,31 @@ export class Prompts extends APIResource {
4747
}
4848

4949
/**
50-
* Fetches the configured model parameters and messages rendered with the provided
51-
* variables mapped to the set LLM provider. This endpoint abstracts the need to
52-
* handle mapping between different providers, while still allowing direct calls to
53-
* the providers.
50+
* Fetches the model configuration parameters for a specified prompt, including
51+
* penalty settings, response format, and the model messages rendered with the
52+
* given variables mapped to the set LLM provider.
5453
*/
5554
getParameters(
5655
id: string,
5756
body?: PromptGetParametersParams,
5857
options?: Core.RequestOptions,
59-
): Core.APIPromise<ModelParameters>;
60-
getParameters(id: string, options?: Core.RequestOptions): Core.APIPromise<ModelParameters>;
58+
): Core.APIPromise<Parameters>;
59+
getParameters(id: string, options?: Core.RequestOptions): Core.APIPromise<Parameters>;
6160
getParameters(
6261
id: string,
6362
body: PromptGetParametersParams | Core.RequestOptions = {},
6463
options?: Core.RequestOptions,
65-
): Core.APIPromise<ModelParameters> {
64+
): Core.APIPromise<Parameters> {
6665
if (isRequestOptions(body)) {
6766
return this.getParameters(id, {}, body);
6867
}
6968
return this._client.post(`/sdk/v1/prompts/${id}`, { body, ...options });
7069
}
7170
}
7271

73-
export type ModelParameters =
74-
| ModelParameters.AnthropicModelParameters
75-
| ModelParameters.OpenAIModelParameters;
72+
export type Parameters = Parameters.AnthropicModelParameters | Parameters.OpenAIModelParameters;
7673

77-
export namespace ModelParameters {
74+
export namespace Parameters {
7875
export interface AnthropicModelParameters {
7976
name: string;
8077

@@ -455,7 +452,7 @@ export interface PromptConfiguration {
455452
export namespace PromptConfiguration {
456453
export interface Message {
457454
content: Array<
458-
| Message.TextContentBlock
455+
| Message.TextContentBlockSchema
459456
| Message.ImageBase64ContentBlock
460457
| Message.ToolCallContentBlock
461458
| Message.ToolResultContentBlock
@@ -465,7 +462,7 @@ export namespace PromptConfiguration {
465462
}
466463

467464
export namespace Message {
468-
export interface TextContentBlock {
465+
export interface TextContentBlockSchema {
469466
text: string;
470467

471468
type: 'TEXT';
@@ -539,9 +536,14 @@ export namespace PromptConfiguration {
539536
maxTokens: number | null;
540537

541538
/**
542-
* The name of the model for the provider.
539+
* Example: "gpt-3.5-turbo"
543540
*/
544-
name: string;
541+
modelName: string;
542+
543+
/**
544+
* The provider of the provided model.
545+
*/
546+
modelProvider: 'ANTHROPIC' | 'OPENAI';
545547

546548
parallelToolCalls: boolean;
547549

@@ -550,11 +552,6 @@ export namespace PromptConfiguration {
550552
*/
551553
presencePenalty: number;
552554

553-
/**
554-
* The LLM model provider.
555-
*/
556-
provider: 'ANTHROPIC' | 'OPENAI';
557-
558555
/**
559556
* Example: PromptResponseFormat.TEXT
560557
*/
@@ -631,7 +628,7 @@ export interface PromptCreateParams {
631628
export namespace PromptCreateParams {
632629
export interface Message {
633630
content: Array<
634-
| Message.TextContentBlock
631+
| Message.TextContentBlockSchema
635632
| Message.ImageBase64ContentBlock
636633
| Message.ToolCallContentBlock
637634
| Message.ToolResultContentBlock
@@ -643,7 +640,7 @@ export namespace PromptCreateParams {
643640
}
644641

645642
export namespace Message {
646-
export interface TextContentBlock {
643+
export interface TextContentBlockSchema {
647644
text: string;
648645

649646
type: 'TEXT';
@@ -717,9 +714,14 @@ export namespace PromptCreateParams {
717714
maxTokens: number | null;
718715

719716
/**
720-
* The name of the model for the provider.
717+
* Example: "gpt-3.5-turbo"
721718
*/
722-
name: string;
719+
modelName: string;
720+
721+
/**
722+
* The provider of the provided model.
723+
*/
724+
modelProvider: 'ANTHROPIC' | 'OPENAI';
723725

724726
parallelToolCalls: boolean;
725727

@@ -728,11 +730,6 @@ export namespace PromptCreateParams {
728730
*/
729731
presencePenalty: number;
730732

731-
/**
732-
* The LLM model provider.
733-
*/
734-
provider: 'ANTHROPIC' | 'OPENAI';
735-
736733
/**
737734
* Example: PromptResponseFormat.TEXT
738735
*/
@@ -781,7 +778,7 @@ export interface PromptUpdateParams {
781778
export namespace PromptUpdateParams {
782779
export interface Message {
783780
content: Array<
784-
| Message.TextContentBlock
781+
| Message.TextContentBlockSchema
785782
| Message.ImageBase64ContentBlock
786783
| Message.ToolCallContentBlock
787784
| Message.ToolResultContentBlock
@@ -793,7 +790,7 @@ export namespace PromptUpdateParams {
793790
}
794791

795792
export namespace Message {
796-
export interface TextContentBlock {
793+
export interface TextContentBlockSchema {
797794
text: string;
798795

799796
type: 'TEXT';
@@ -867,9 +864,14 @@ export namespace PromptUpdateParams {
867864
maxTokens: number | null;
868865

869866
/**
870-
* The name of the model for the provider.
867+
* Example: "gpt-3.5-turbo"
871868
*/
872-
name: string;
869+
modelName: string;
870+
871+
/**
872+
* The provider of the provided model.
873+
*/
874+
modelProvider: 'ANTHROPIC' | 'OPENAI';
873875

874876
parallelToolCalls: boolean;
875877

@@ -878,11 +880,6 @@ export namespace PromptUpdateParams {
878880
*/
879881
presencePenalty: number;
880882

881-
/**
882-
* The LLM model provider.
883-
*/
884-
provider: 'ANTHROPIC' | 'OPENAI';
885-
886883
/**
887884
* Example: PromptResponseFormat.TEXT
888885
*/
@@ -945,7 +942,7 @@ export interface PromptGetParametersParams {
945942
export namespace PromptGetParametersParams {
946943
export interface AppendMessage {
947944
content: Array<
948-
| AppendMessage.TextContentBlock
945+
| AppendMessage.TextContentBlockSchema
949946
| AppendMessage.ImageBase64ContentBlock
950947
| AppendMessage.ToolCallContentBlock
951948
| AppendMessage.ToolResultContentBlock
@@ -955,7 +952,7 @@ export namespace PromptGetParametersParams {
955952
}
956953

957954
export namespace AppendMessage {
958-
export interface TextContentBlock {
955+
export interface TextContentBlockSchema {
959956
text: string;
960957

961958
type: 'TEXT';
@@ -1019,7 +1016,7 @@ export namespace PromptGetParametersParams {
10191016

10201017
export interface OverrideMessage {
10211018
content: Array<
1022-
| OverrideMessage.TextContentBlock
1019+
| OverrideMessage.TextContentBlockSchema
10231020
| OverrideMessage.ImageBase64ContentBlock
10241021
| OverrideMessage.ToolCallContentBlock
10251022
| OverrideMessage.ToolResultContentBlock
@@ -1029,7 +1026,7 @@ export namespace PromptGetParametersParams {
10291026
}
10301027

10311028
export namespace OverrideMessage {
1032-
export interface TextContentBlock {
1029+
export interface TextContentBlockSchema {
10331030
text: string;
10341031

10351032
type: 'TEXT';
@@ -1093,7 +1090,7 @@ export namespace PromptGetParametersParams {
10931090
}
10941091

10951092
export namespace Prompts {
1096-
export import ModelParameters = PromptsAPI.ModelParameters;
1093+
export import Parameters = PromptsAPI.Parameters;
10971094
export import PromptConfiguration = PromptsAPI.PromptConfiguration;
10981095
export import PromptListResponse = PromptsAPI.PromptListResponse;
10991096
export import PromptDeleteResponse = PromptsAPI.PromptDeleteResponse;

0 commit comments

Comments
 (0)