Documentation
¶
Overview ¶
Package openai defines constants for openai.
Index ¶
- type AssistantGenTextExtension
- type IncompleteDetails
- type OutputRefusal
- type PromptCacheRetention
- type Reasoning
- type ReasoningEffort
- type ReasoningSummary
- type ResponseError
- type ResponseErrorCode
- type ResponseMetaExtension
- type ResponseStatus
- type ServiceTier
- type TextAnnotation
- type TextAnnotationContainerFileCitation
- type TextAnnotationFileCitation
- type TextAnnotationFilePath
- type TextAnnotationType
- type TextAnnotationURLCitation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssistantGenTextExtension ¶
type AssistantGenTextExtension struct {
Refusal *OutputRefusal `json:"refusal,omitempty"`
Annotations []*TextAnnotation `json:"annotations,omitempty"`
}
func ConcatAssistantGenTextExtensions ¶
func ConcatAssistantGenTextExtensions(chunks []*AssistantGenTextExtension) (*AssistantGenTextExtension, error)
ConcatAssistantGenTextExtensions concatenates multiple AssistantGenTextExtension chunks into a single one.
type IncompleteDetails ¶
type IncompleteDetails struct {
Reason string `json:"reason,omitempty"`
}
type OutputRefusal ¶
type OutputRefusal struct {
Reason string `json:"reason,omitempty"`
}
type PromptCacheRetention ¶
type PromptCacheRetention string
const ( PromptCacheRetentionInMemory PromptCacheRetention = "in-memory" PromptCacheRetention24h PromptCacheRetention = "24h" )
type Reasoning ¶
type Reasoning struct {
Effort ReasoningEffort `json:"effort,omitempty"`
Summary ReasoningSummary `json:"summary,omitempty"`
}
type ReasoningEffort ¶
type ReasoningEffort string
const ( ReasoningEffortMinimal ReasoningEffort = "minimal" ReasoningEffortLow ReasoningEffort = "low" ReasoningEffortMedium ReasoningEffort = "medium" ReasoningEffortHigh ReasoningEffort = "high" )
type ReasoningSummary ¶
type ReasoningSummary string
const ( ReasoningSummaryAuto ReasoningSummary = "auto" ReasoningSummaryConcise ReasoningSummary = "concise" ReasoningSummaryDetailed ReasoningSummary = "detailed" )
type ResponseError ¶
type ResponseError struct {
Code ResponseErrorCode `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
type ResponseErrorCode ¶
type ResponseErrorCode string
const ( ResponseErrorCodeServerError ResponseErrorCode = "server_error" ResponseErrorCodeRateLimitExceeded ResponseErrorCode = "rate_limit_exceeded" ResponseErrorCodeInvalidPrompt ResponseErrorCode = "invalid_prompt" ResponseErrorCodeVectorStoreTimeout ResponseErrorCode = "vector_store_timeout" ResponseErrorCodeInvalidImage ResponseErrorCode = "invalid_image" ResponseErrorCodeInvalidImageFormat ResponseErrorCode = "invalid_image_format" ResponseErrorCodeInvalidBase64Image ResponseErrorCode = "invalid_base64_image" ResponseErrorCodeInvalidImageURL ResponseErrorCode = "invalid_image_url" ResponseErrorCodeImageTooLarge ResponseErrorCode = "image_too_large" ResponseErrorCodeImageTooSmall ResponseErrorCode = "image_too_small" ResponseErrorCodeImageParseError ResponseErrorCode = "image_parse_error" ResponseErrorCodeImageContentPolicyViolation ResponseErrorCode = "image_content_policy_violation" ResponseErrorCodeInvalidImageMode ResponseErrorCode = "invalid_image_mode" ResponseErrorCodeImageFileTooLarge ResponseErrorCode = "image_file_too_large" ResponseErrorCodeUnsupportedImageMediaType ResponseErrorCode = "unsupported_image_media_type" ResponseErrorCodeEmptyImageFile ResponseErrorCode = "empty_image_file" ResponseErrorCodeFailedToDownloadImage ResponseErrorCode = "failed_to_download_image" ResponseErrorCodeImageFileNotFound ResponseErrorCode = "image_file_not_found" )
type ResponseMetaExtension ¶
type ResponseMetaExtension struct {
ID string `json:"id,omitempty"`
Status ResponseStatus `json:"status,omitempty"`
Error *ResponseError `json:"error,omitempty"`
IncompleteDetails *IncompleteDetails `json:"incomplete_details,omitempty"`
PreviousResponseID string `json:"previous_response_id,omitempty"`
Reasoning *Reasoning `json:"reasoning,omitempty"`
ServiceTier ServiceTier `json:"service_tier,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
PromptCacheRetention PromptCacheRetention `json:"prompt_cache_retention,omitempty"`
}
func ConcatResponseMetaExtensions ¶
func ConcatResponseMetaExtensions(chunks []*ResponseMetaExtension) (*ResponseMetaExtension, error)
ConcatResponseMetaExtensions concatenates multiple ResponseMetaExtension chunks into a single one.
type ResponseStatus ¶
type ResponseStatus string
const ( ResponseStatusCompleted ResponseStatus = "completed" ResponseStatusFailed ResponseStatus = "failed" ResponseStatusInProgress ResponseStatus = "in_progress" ResponseStatusCancelled ResponseStatus = "cancelled" ResponseStatusQueued ResponseStatus = "queued" ResponseStatusIncomplete ResponseStatus = "incomplete" )
type ServiceTier ¶
type ServiceTier string
const ( ServiceTierAuto ServiceTier = "auto" ServiceTierDefault ServiceTier = "default" ServiceTierFlex ServiceTier = "flex" ServiceTierScale ServiceTier = "scale" ServiceTierPriority ServiceTier = "priority" )
type TextAnnotation ¶
type TextAnnotation struct {
Index int `json:"index,omitempty"`
Type TextAnnotationType `json:"type,omitempty"`
FileCitation *TextAnnotationFileCitation `json:"file_citation,omitempty"`
URLCitation *TextAnnotationURLCitation `json:"url_citation,omitempty"`
ContainerFileCitation *TextAnnotationContainerFileCitation `json:"container_file_citation,omitempty"`
FilePath *TextAnnotationFilePath `json:"file_path,omitempty"`
}
type TextAnnotationContainerFileCitation ¶
type TextAnnotationContainerFileCitation struct {
// The ID of the container file.
ContainerID string `json:"container_id,omitempty"`
// The ID of the file.
FileID string `json:"file_id,omitempty"`
// The filename of the container file cited.
Filename string `json:"filename,omitempty"`
// The index of the first character of the container file citation in the message.
StartIndex int `json:"start_index,omitempty"`
// The index of the last character of the container file citation in the message.
EndIndex int `json:"end_index,omitempty"`
}
type TextAnnotationFilePath ¶
type TextAnnotationType ¶
type TextAnnotationType string
const ( TextAnnotationTypeFileCitation TextAnnotationType = "file_citation" TextAnnotationTypeURLCitation TextAnnotationType = "url_citation" TextAnnotationTypeContainerFileCitation TextAnnotationType = "container_file_citation" TextAnnotationTypeFilePath TextAnnotationType = "file_path" )
type TextAnnotationURLCitation ¶
type TextAnnotationURLCitation struct {
// The title of the web resource.
Title string `json:"title,omitempty"`
// The URL of the web resource.
URL string `json:"url,omitempty"`
// The index of the first character of the URL citation in the message.
StartIndex int `json:"start_index,omitempty"`
// The index of the last character of the URL citation in the message.
EndIndex int `json:"end_index,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.