@@ -47,34 +47,31 @@ export class Prompts extends APIResource {
47
47
}
48
48
49
49
/**
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.
54
53
*/
55
54
getParameters (
56
55
id : string ,
57
56
body ?: PromptGetParametersParams ,
58
57
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 > ;
61
60
getParameters (
62
61
id : string ,
63
62
body : PromptGetParametersParams | Core . RequestOptions = { } ,
64
63
options ?: Core . RequestOptions ,
65
- ) : Core . APIPromise < ModelParameters > {
64
+ ) : Core . APIPromise < Parameters > {
66
65
if ( isRequestOptions ( body ) ) {
67
66
return this . getParameters ( id , { } , body ) ;
68
67
}
69
68
return this . _client . post ( `/sdk/v1/prompts/${ id } ` , { body, ...options } ) ;
70
69
}
71
70
}
72
71
73
- export type ModelParameters =
74
- | ModelParameters . AnthropicModelParameters
75
- | ModelParameters . OpenAIModelParameters ;
72
+ export type Parameters = Parameters . AnthropicModelParameters | Parameters . OpenAIModelParameters ;
76
73
77
- export namespace ModelParameters {
74
+ export namespace Parameters {
78
75
export interface AnthropicModelParameters {
79
76
name : string ;
80
77
@@ -455,7 +452,7 @@ export interface PromptConfiguration {
455
452
export namespace PromptConfiguration {
456
453
export interface Message {
457
454
content : Array <
458
- | Message . TextContentBlock
455
+ | Message . TextContentBlockSchema
459
456
| Message . ImageBase64ContentBlock
460
457
| Message . ToolCallContentBlock
461
458
| Message . ToolResultContentBlock
@@ -465,7 +462,7 @@ export namespace PromptConfiguration {
465
462
}
466
463
467
464
export namespace Message {
468
- export interface TextContentBlock {
465
+ export interface TextContentBlockSchema {
469
466
text : string ;
470
467
471
468
type : 'TEXT' ;
@@ -539,9 +536,14 @@ export namespace PromptConfiguration {
539
536
maxTokens : number | null ;
540
537
541
538
/**
542
- * The name of the model for the provider.
539
+ * Example: "gpt-3.5-turbo"
543
540
*/
544
- name : string ;
541
+ modelName : string ;
542
+
543
+ /**
544
+ * The provider of the provided model.
545
+ */
546
+ modelProvider : 'ANTHROPIC' | 'OPENAI' ;
545
547
546
548
parallelToolCalls : boolean ;
547
549
@@ -550,11 +552,6 @@ export namespace PromptConfiguration {
550
552
*/
551
553
presencePenalty : number ;
552
554
553
- /**
554
- * The LLM model provider.
555
- */
556
- provider : 'ANTHROPIC' | 'OPENAI' ;
557
-
558
555
/**
559
556
* Example: PromptResponseFormat.TEXT
560
557
*/
@@ -631,7 +628,7 @@ export interface PromptCreateParams {
631
628
export namespace PromptCreateParams {
632
629
export interface Message {
633
630
content : Array <
634
- | Message . TextContentBlock
631
+ | Message . TextContentBlockSchema
635
632
| Message . ImageBase64ContentBlock
636
633
| Message . ToolCallContentBlock
637
634
| Message . ToolResultContentBlock
@@ -643,7 +640,7 @@ export namespace PromptCreateParams {
643
640
}
644
641
645
642
export namespace Message {
646
- export interface TextContentBlock {
643
+ export interface TextContentBlockSchema {
647
644
text : string ;
648
645
649
646
type : 'TEXT' ;
@@ -717,9 +714,14 @@ export namespace PromptCreateParams {
717
714
maxTokens : number | null ;
718
715
719
716
/**
720
- * The name of the model for the provider.
717
+ * Example: "gpt-3.5-turbo"
721
718
*/
722
- name : string ;
719
+ modelName : string ;
720
+
721
+ /**
722
+ * The provider of the provided model.
723
+ */
724
+ modelProvider : 'ANTHROPIC' | 'OPENAI' ;
723
725
724
726
parallelToolCalls : boolean ;
725
727
@@ -728,11 +730,6 @@ export namespace PromptCreateParams {
728
730
*/
729
731
presencePenalty : number ;
730
732
731
- /**
732
- * The LLM model provider.
733
- */
734
- provider : 'ANTHROPIC' | 'OPENAI' ;
735
-
736
733
/**
737
734
* Example: PromptResponseFormat.TEXT
738
735
*/
@@ -781,7 +778,7 @@ export interface PromptUpdateParams {
781
778
export namespace PromptUpdateParams {
782
779
export interface Message {
783
780
content : Array <
784
- | Message . TextContentBlock
781
+ | Message . TextContentBlockSchema
785
782
| Message . ImageBase64ContentBlock
786
783
| Message . ToolCallContentBlock
787
784
| Message . ToolResultContentBlock
@@ -793,7 +790,7 @@ export namespace PromptUpdateParams {
793
790
}
794
791
795
792
export namespace Message {
796
- export interface TextContentBlock {
793
+ export interface TextContentBlockSchema {
797
794
text : string ;
798
795
799
796
type : 'TEXT' ;
@@ -867,9 +864,14 @@ export namespace PromptUpdateParams {
867
864
maxTokens : number | null ;
868
865
869
866
/**
870
- * The name of the model for the provider.
867
+ * Example: "gpt-3.5-turbo"
871
868
*/
872
- name : string ;
869
+ modelName : string ;
870
+
871
+ /**
872
+ * The provider of the provided model.
873
+ */
874
+ modelProvider : 'ANTHROPIC' | 'OPENAI' ;
873
875
874
876
parallelToolCalls : boolean ;
875
877
@@ -878,11 +880,6 @@ export namespace PromptUpdateParams {
878
880
*/
879
881
presencePenalty : number ;
880
882
881
- /**
882
- * The LLM model provider.
883
- */
884
- provider : 'ANTHROPIC' | 'OPENAI' ;
885
-
886
883
/**
887
884
* Example: PromptResponseFormat.TEXT
888
885
*/
@@ -945,7 +942,7 @@ export interface PromptGetParametersParams {
945
942
export namespace PromptGetParametersParams {
946
943
export interface AppendMessage {
947
944
content : Array <
948
- | AppendMessage . TextContentBlock
945
+ | AppendMessage . TextContentBlockSchema
949
946
| AppendMessage . ImageBase64ContentBlock
950
947
| AppendMessage . ToolCallContentBlock
951
948
| AppendMessage . ToolResultContentBlock
@@ -955,7 +952,7 @@ export namespace PromptGetParametersParams {
955
952
}
956
953
957
954
export namespace AppendMessage {
958
- export interface TextContentBlock {
955
+ export interface TextContentBlockSchema {
959
956
text : string ;
960
957
961
958
type : 'TEXT' ;
@@ -1019,7 +1016,7 @@ export namespace PromptGetParametersParams {
1019
1016
1020
1017
export interface OverrideMessage {
1021
1018
content : Array <
1022
- | OverrideMessage . TextContentBlock
1019
+ | OverrideMessage . TextContentBlockSchema
1023
1020
| OverrideMessage . ImageBase64ContentBlock
1024
1021
| OverrideMessage . ToolCallContentBlock
1025
1022
| OverrideMessage . ToolResultContentBlock
@@ -1029,7 +1026,7 @@ export namespace PromptGetParametersParams {
1029
1026
}
1030
1027
1031
1028
export namespace OverrideMessage {
1032
- export interface TextContentBlock {
1029
+ export interface TextContentBlockSchema {
1033
1030
text : string ;
1034
1031
1035
1032
type : 'TEXT' ;
@@ -1093,7 +1090,7 @@ export namespace PromptGetParametersParams {
1093
1090
}
1094
1091
1095
1092
export namespace Prompts {
1096
- export import ModelParameters = PromptsAPI . ModelParameters ;
1093
+ export import Parameters = PromptsAPI . Parameters ;
1097
1094
export import PromptConfiguration = PromptsAPI . PromptConfiguration ;
1098
1095
export import PromptListResponse = PromptsAPI . PromptListResponse ;
1099
1096
export import PromptDeleteResponse = PromptsAPI . PromptDeleteResponse ;
0 commit comments