feat: add params to RunRequest (#754)

This commit is contained in:
Adam Smith
2024-06-03 09:50:22 -07:00
committed by GitHub
parent 211cb49fc2
commit 30cf7b879c

13
run.go
View File

@@ -92,6 +92,7 @@ type RunRequest struct {
// Sampling temperature between 0 and 2. Higher values like 0.8 are more random.
// lower values are more focused and deterministic.
Temperature *float32 `json:"temperature,omitempty"`
TopP *float32 `json:"top_p,omitempty"`
// The maximum number of prompt tokens that may be used over the course of the run.
// If the run exceeds the number of prompt tokens specified, the run will end with status 'complete'.
@@ -103,6 +104,11 @@ type RunRequest struct {
// ThreadTruncationStrategy defines the truncation strategy to use for the thread.
TruncationStrategy *ThreadTruncationStrategy `json:"truncation_strategy,omitempty"`
// This can be either a string or a ToolChoice object.
ToolChoice any `json:"tool_choice,omitempty"`
// This can be either a string or a ResponseFormat object.
ResponseFormat any `json:"response_format,omitempty"`
}
// ThreadTruncationStrategy defines the truncation strategy to use for the thread.
@@ -124,6 +130,13 @@ const (
TruncationStrategyLastMessages = TruncationStrategy("last_messages")
)
// ReponseFormat specifies the format the model must output.
// https://platform.openai.com/docs/api-reference/runs/createRun#runs-createrun-response_format.
// Type can either be text or json_object.
type ReponseFormat struct {
Type string `json:"type"`
}
type RunModifyRequest struct {
Metadata map[string]any `json:"metadata,omitempty"`
}