@@ -28,6 +28,16 @@ type Run struct {
28
28
Metadata map [string ]any `json:"metadata"`
29
29
Usage Usage `json:"usage,omitempty"`
30
30
31
+ Temperature * int `json:"temperature,omitempty"`
32
+ // The maximum number of prompt tokens that may be used over the course of the run.
33
+ // If the run exceeds the number of prompt tokens specified, the run will end with status 'complete'
34
+ MaxPromptTokens int `json:"max_prompt_tokens,omitempty"`
35
+ // The maximum number of completion tokens that may be used over the course of the run.
36
+ // If the run exceeds the number of completion tokens specified, the run will end with status 'complete'
37
+ MaxCompletionTokens int `json:"max_completion_tokens,omitempty"`
38
+ // ThreadTruncationStrategy defines the truncation strategy to use for the thread
39
+ TruncationStrategy * ThreadTruncationStrategy `json:"truncation_strategy,omitempty"`
40
+
31
41
httpHeader
32
42
}
33
43
@@ -78,8 +88,41 @@ type RunRequest struct {
78
88
AdditionalInstructions string `json:"additional_instructions,omitempty"`
79
89
Tools []Tool `json:"tools,omitempty"`
80
90
Metadata map [string ]any `json:"metadata,omitempty"`
91
+
92
+ // What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
93
+ Temperature * int `json:"temperature,omitempty"`
94
+
95
+ // The maximum number of prompt tokens that may be used over the course of the run.
96
+ // If the run exceeds the number of prompt tokens specified, the run will end with status 'complete'
97
+ MaxPromptTokens int `json:"max_prompt_tokens,omitempty"`
98
+
99
+ // The maximum number of completion tokens that may be used over the course of the run.
100
+ // If the run exceeds the number of completion tokens specified, the run will end with status 'complete'
101
+ MaxCompletionTokens int `json:"max_completion_tokens,omitempty"`
102
+
103
+ // ThreadTruncationStrategy defines the truncation strategy to use for the thread
104
+ TruncationStrategy * ThreadTruncationStrategy `json:"truncation_strategy,omitempty"`
81
105
}
82
106
107
+ // ThreadTruncationStrategy defines the truncation strategy to use for the thread
108
+ // https://platform.openai.com/docs/assistants/how-it-works/truncation-strategy
109
+ type ThreadTruncationStrategy struct {
110
+ // default 'auto'
111
+ Type TruncationStrategy `json:"type,omitempty"`
112
+ // this field should be set if the truncation strategy is set to LastMessages
113
+ LastMessages * int `json:"last_messages,omitempty"`
114
+ }
115
+
116
+ // TruncationStrategy defines the existing truncation strategies existing for thread management in an assistant
117
+ type TruncationStrategy string
118
+
119
+ const (
120
+ // TruncationStrategyAuto messages in the middle of the thread will be dropped to fit the context length of the model
121
+ TruncationStrategyAuto = TruncationStrategy ("auto" )
122
+ // TruncationStrategyLastMessages the thread will be truncated to the n most recent messages in the thread
123
+ TruncationStrategyLastMessages = TruncationStrategy ("last_messages" )
124
+ )
125
+
83
126
type RunModifyRequest struct {
84
127
Metadata map [string ]any `json:"metadata,omitempty"`
85
128
}
0 commit comments