shared

package
v4.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations struct {
	MessageContentTextAnnotationsFileCitationObject *MessageContentTextAnnotationsFileCitationObject
	MessageContentTextAnnotationsFilePathObject     *MessageContentTextAnnotationsFilePathObject

	Type AnnotationsType
}

func CreateAnnotationsMessageContentTextAnnotationsFileCitationObject

func CreateAnnotationsMessageContentTextAnnotationsFileCitationObject(messageContentTextAnnotationsFileCitationObject MessageContentTextAnnotationsFileCitationObject) Annotations

func CreateAnnotationsMessageContentTextAnnotationsFilePathObject

func CreateAnnotationsMessageContentTextAnnotationsFilePathObject(messageContentTextAnnotationsFilePathObject MessageContentTextAnnotationsFilePathObject) Annotations

func (Annotations) MarshalJSON

func (u Annotations) MarshalJSON() ([]byte, error)

func (*Annotations) UnmarshalJSON

func (u *Annotations) UnmarshalJSON(data []byte) error

type AnnotationsType

type AnnotationsType string
const (
	AnnotationsTypeMessageContentTextAnnotationsFileCitationObject AnnotationsType = "MessageContentTextAnnotationsFileCitationObject"
	AnnotationsTypeMessageContentTextAnnotationsFilePathObject     AnnotationsType = "MessageContentTextAnnotationsFilePathObject"
)

type AssistantFileObject

type AssistantFileObject struct {
	// The assistant ID that the file is attached to.
	AssistantID string `json:"assistant_id"`
	// The Unix timestamp (in seconds) for when the assistant file was created.
	CreatedAt int64 `json:"created_at"`
	// The identifier, which can be referenced in API endpoints.
	ID string `json:"id"`
	// The object type, which is always `assistant.file`.
	Object Object `json:"object"`
}

AssistantFileObject - A list of [Files](/docs/api-reference/files) attached to an `assistant`.

func (*AssistantFileObject) GetAssistantID

func (o *AssistantFileObject) GetAssistantID() string

func (*AssistantFileObject) GetCreatedAt

func (o *AssistantFileObject) GetCreatedAt() int64

func (*AssistantFileObject) GetID

func (o *AssistantFileObject) GetID() string

func (*AssistantFileObject) GetObject

func (o *AssistantFileObject) GetObject() Object

type AssistantObject

type AssistantObject struct {
	// The Unix timestamp (in seconds) for when the assistant was created.
	CreatedAt int64 `json:"created_at"`
	// The description of the assistant. The maximum length is 512 characters.
	//
	Description *string `json:"description"`
	// A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order.
	//
	FileIds []string `json:"file_ids"`
	// The identifier, which can be referenced in API endpoints.
	ID string `json:"id"`
	// The system instructions that the assistant uses. The maximum length is 32768 characters.
	//
	Instructions *string `json:"instructions"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *Metadata `json:"metadata"`
	// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
	//
	Model string `json:"model"`
	// The name of the assistant. The maximum length is 256 characters.
	//
	Name *string `json:"name"`
	// The object type, which is always `assistant`.
	Object AssistantObjectObject `json:"object"`
	// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
	//
	Tools []Tools `json:"tools"`
}

AssistantObject - Represents an `assistant` that can call the model and use tools.

func (*AssistantObject) GetCreatedAt

func (o *AssistantObject) GetCreatedAt() int64

func (*AssistantObject) GetDescription

func (o *AssistantObject) GetDescription() *string

func (*AssistantObject) GetFileIds

func (o *AssistantObject) GetFileIds() []string

func (*AssistantObject) GetID

func (o *AssistantObject) GetID() string

func (*AssistantObject) GetInstructions

func (o *AssistantObject) GetInstructions() *string

func (*AssistantObject) GetMetadata

func (o *AssistantObject) GetMetadata() *Metadata

func (*AssistantObject) GetModel

func (o *AssistantObject) GetModel() string

func (*AssistantObject) GetName

func (o *AssistantObject) GetName() *string

func (*AssistantObject) GetObject

func (o *AssistantObject) GetObject() AssistantObjectObject

func (*AssistantObject) GetTools

func (o *AssistantObject) GetTools() []Tools

type AssistantObjectObject

type AssistantObjectObject string

AssistantObjectObject - The object type, which is always `assistant`.

const (
	AssistantObjectObjectAssistant AssistantObjectObject = "assistant"
)

func (AssistantObjectObject) ToPointer

func (*AssistantObjectObject) UnmarshalJSON

func (e *AssistantObjectObject) UnmarshalJSON(data []byte) error

type AssistantToolsCode

type AssistantToolsCode struct {
	// The type of tool being defined: `code_interpreter`
	Type Type `json:"type"`
}

func (*AssistantToolsCode) GetType

func (o *AssistantToolsCode) GetType() Type

type AssistantToolsFunction

type AssistantToolsFunction struct {
	Function FunctionObject `json:"function"`
	// The type of tool being defined: `function`
	Type AssistantToolsFunctionType `json:"type"`
}

func (*AssistantToolsFunction) GetFunction

func (o *AssistantToolsFunction) GetFunction() FunctionObject

func (*AssistantToolsFunction) GetType

type AssistantToolsFunctionType

type AssistantToolsFunctionType string

AssistantToolsFunctionType - The type of tool being defined: `function`

const (
	AssistantToolsFunctionTypeFunction AssistantToolsFunctionType = "function"
)

func (AssistantToolsFunctionType) ToPointer

func (*AssistantToolsFunctionType) UnmarshalJSON

func (e *AssistantToolsFunctionType) UnmarshalJSON(data []byte) error

type AssistantToolsRetrieval

type AssistantToolsRetrieval struct {
	// The type of tool being defined: `retrieval`
	Type AssistantToolsRetrievalType `json:"type"`
}

func (*AssistantToolsRetrieval) GetType

type AssistantToolsRetrievalType

type AssistantToolsRetrievalType string

AssistantToolsRetrievalType - The type of tool being defined: `retrieval`

const (
	AssistantToolsRetrievalTypeRetrieval AssistantToolsRetrievalType = "retrieval"
)

func (AssistantToolsRetrievalType) ToPointer

func (*AssistantToolsRetrievalType) UnmarshalJSON

func (e *AssistantToolsRetrievalType) UnmarshalJSON(data []byte) error

type BatchSize

type BatchSize struct {
	CreateFineTuningJobRequest1 *CreateFineTuningJobRequest1
	Integer                     *int64

	Type BatchSizeType
}

BatchSize - Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

func CreateBatchSizeCreateFineTuningJobRequest1

func CreateBatchSizeCreateFineTuningJobRequest1(createFineTuningJobRequest1 CreateFineTuningJobRequest1) BatchSize

func CreateBatchSizeInteger

func CreateBatchSizeInteger(integer int64) BatchSize

func (BatchSize) MarshalJSON

func (u BatchSize) MarshalJSON() ([]byte, error)

func (*BatchSize) UnmarshalJSON

func (u *BatchSize) UnmarshalJSON(data []byte) error

type BatchSizeType

type BatchSizeType string
const (
	BatchSizeTypeCreateFineTuningJobRequest1 BatchSizeType = "CreateFineTuningJobRequest_1"
	BatchSizeTypeInteger                     BatchSizeType = "integer"
)

type Categories

type Categories struct {
	// Content that expresses, incites, or promotes harassing language towards any target.
	Harassment bool `json:"harassment"`
	// Harassment content that also includes violence or serious harm towards any target.
	HarassmentThreatening bool `json:"harassment/threatening"`
	// Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.
	Hate bool `json:"hate"`
	// Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.
	HateThreatening bool `json:"hate/threatening"`
	// Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders.
	SelfHarm bool `json:"self-harm"`
	// Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts.
	SelfHarmInstructions bool `json:"self-harm/instructions"`
	// Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders.
	SelfHarmIntent bool `json:"self-harm/intent"`
	// Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).
	Sexual bool `json:"sexual"`
	// Sexual content that includes an individual who is under 18 years old.
	SexualMinors bool `json:"sexual/minors"`
	// Content that depicts death, violence, or physical injury.
	Violence bool `json:"violence"`
	// Content that depicts death, violence, or physical injury in graphic detail.
	ViolenceGraphic bool `json:"violence/graphic"`
}

Categories - A list of the categories, and whether they are flagged or not.

func (*Categories) GetHarassment

func (o *Categories) GetHarassment() bool

func (*Categories) GetHarassmentThreatening

func (o *Categories) GetHarassmentThreatening() bool

func (*Categories) GetHate

func (o *Categories) GetHate() bool

func (*Categories) GetHateThreatening

func (o *Categories) GetHateThreatening() bool

func (*Categories) GetSelfHarm

func (o *Categories) GetSelfHarm() bool

func (*Categories) GetSelfHarmInstructions

func (o *Categories) GetSelfHarmInstructions() bool

func (*Categories) GetSelfHarmIntent

func (o *Categories) GetSelfHarmIntent() bool

func (*Categories) GetSexual

func (o *Categories) GetSexual() bool

func (*Categories) GetSexualMinors

func (o *Categories) GetSexualMinors() bool

func (*Categories) GetViolence

func (o *Categories) GetViolence() bool

func (*Categories) GetViolenceGraphic

func (o *Categories) GetViolenceGraphic() bool

type CategoryScores

type CategoryScores struct {
	// The score for the category 'harassment'.
	Harassment float64 `json:"harassment"`
	// The score for the category 'harassment/threatening'.
	HarassmentThreatening float64 `json:"harassment/threatening"`
	// The score for the category 'hate'.
	Hate float64 `json:"hate"`
	// The score for the category 'hate/threatening'.
	HateThreatening float64 `json:"hate/threatening"`
	// The score for the category 'self-harm'.
	SelfHarm float64 `json:"self-harm"`
	// The score for the category 'self-harm/instructions'.
	SelfHarmInstructions float64 `json:"self-harm/instructions"`
	// The score for the category 'self-harm/intent'.
	SelfHarmIntent float64 `json:"self-harm/intent"`
	// The score for the category 'sexual'.
	Sexual float64 `json:"sexual"`
	// The score for the category 'sexual/minors'.
	SexualMinors float64 `json:"sexual/minors"`
	// The score for the category 'violence'.
	Violence float64 `json:"violence"`
	// The score for the category 'violence/graphic'.
	ViolenceGraphic float64 `json:"violence/graphic"`
}

CategoryScores - A list of the categories along with their scores as predicted by model.

func (*CategoryScores) GetHarassment

func (o *CategoryScores) GetHarassment() float64

func (*CategoryScores) GetHarassmentThreatening

func (o *CategoryScores) GetHarassmentThreatening() float64

func (*CategoryScores) GetHate

func (o *CategoryScores) GetHate() float64

func (*CategoryScores) GetHateThreatening

func (o *CategoryScores) GetHateThreatening() float64

func (*CategoryScores) GetSelfHarm

func (o *CategoryScores) GetSelfHarm() float64

func (*CategoryScores) GetSelfHarmInstructions

func (o *CategoryScores) GetSelfHarmInstructions() float64

func (*CategoryScores) GetSelfHarmIntent

func (o *CategoryScores) GetSelfHarmIntent() float64

func (*CategoryScores) GetSexual

func (o *CategoryScores) GetSexual() float64

func (*CategoryScores) GetSexualMinors

func (o *CategoryScores) GetSexualMinors() float64

func (*CategoryScores) GetViolence

func (o *CategoryScores) GetViolence() float64

func (*CategoryScores) GetViolenceGraphic

func (o *CategoryScores) GetViolenceGraphic() float64

type ChatCompletionFunctionCallOption

type ChatCompletionFunctionCallOption struct {
	// The name of the function to call.
	Name string `json:"name"`
}

ChatCompletionFunctionCallOption - Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.

func (*ChatCompletionFunctionCallOption) GetName

type ChatCompletionFunctions

type ChatCompletionFunctions struct {
	// A description of what the function does, used by the model to choose when and how to call the function.
	Description *string `json:"description,omitempty"`
	// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
	Name string `json:"name"`
	// The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
	//
	// Omitting `parameters` defines a function with an empty parameter list.
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

ChatCompletionFunctions

Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.

func (*ChatCompletionFunctions) GetDescription

func (o *ChatCompletionFunctions) GetDescription() *string

func (*ChatCompletionFunctions) GetName

func (o *ChatCompletionFunctions) GetName() string

func (*ChatCompletionFunctions) GetParameters

func (o *ChatCompletionFunctions) GetParameters() map[string]interface{}

type ChatCompletionMessageToolCall

type ChatCompletionMessageToolCall struct {
	// The function that the model called.
	Function Function `json:"function"`
	// The ID of the tool call.
	ID string `json:"id"`
	// The type of the tool. Currently, only `function` is supported.
	Type ChatCompletionMessageToolCallType `json:"type"`
}

func (*ChatCompletionMessageToolCall) GetFunction

func (o *ChatCompletionMessageToolCall) GetFunction() Function

func (*ChatCompletionMessageToolCall) GetID

func (*ChatCompletionMessageToolCall) GetType

type ChatCompletionMessageToolCallType

type ChatCompletionMessageToolCallType string

ChatCompletionMessageToolCallType - The type of the tool. Currently, only `function` is supported.

const (
	ChatCompletionMessageToolCallTypeFunction ChatCompletionMessageToolCallType = "function"
)

func (ChatCompletionMessageToolCallType) ToPointer

func (*ChatCompletionMessageToolCallType) UnmarshalJSON

func (e *ChatCompletionMessageToolCallType) UnmarshalJSON(data []byte) error

type ChatCompletionNamedToolChoice

type ChatCompletionNamedToolChoice struct {
	Function ChatCompletionNamedToolChoiceFunction `json:"function"`
	// The type of the tool. Currently, only `function` is supported.
	Type ChatCompletionNamedToolChoiceType `json:"type"`
}

ChatCompletionNamedToolChoice - Specifies a tool the model should use. Use to force the model to call a specific function.

func (*ChatCompletionNamedToolChoice) GetFunction

func (*ChatCompletionNamedToolChoice) GetType

type ChatCompletionNamedToolChoiceFunction

type ChatCompletionNamedToolChoiceFunction struct {
	// The name of the function to call.
	Name string `json:"name"`
}

func (*ChatCompletionNamedToolChoiceFunction) GetName

type ChatCompletionNamedToolChoiceType

type ChatCompletionNamedToolChoiceType string

ChatCompletionNamedToolChoiceType - The type of the tool. Currently, only `function` is supported.

const (
	ChatCompletionNamedToolChoiceTypeFunction ChatCompletionNamedToolChoiceType = "function"
)

func (ChatCompletionNamedToolChoiceType) ToPointer

func (*ChatCompletionNamedToolChoiceType) UnmarshalJSON

func (e *ChatCompletionNamedToolChoiceType) UnmarshalJSON(data []byte) error

type ChatCompletionRequestAssistantMessage

type ChatCompletionRequestAssistantMessage struct {
	// The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
	//
	Content *string `json:"content,omitempty"`
	// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
	//
	// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
	FunctionCall *FunctionCall `json:"function_call,omitempty"`
	// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
	Name *string `json:"name,omitempty"`
	// The role of the messages author, in this case `assistant`.
	Role Role `json:"role"`
	// The tool calls generated by the model, such as function calls.
	ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls,omitempty"`
}

func (*ChatCompletionRequestAssistantMessage) GetContent

func (*ChatCompletionRequestAssistantMessage) GetFunctionCall

func (*ChatCompletionRequestAssistantMessage) GetName

func (*ChatCompletionRequestAssistantMessage) GetRole

func (*ChatCompletionRequestAssistantMessage) GetToolCalls

type ChatCompletionRequestFunctionMessage

type ChatCompletionRequestFunctionMessage struct {
	// The contents of the function message.
	Content *string `json:"content"`
	// The name of the function to call.
	Name string `json:"name"`
	// The role of the messages author, in this case `function`.
	Role ChatCompletionRequestFunctionMessageRole `json:"role"`
}

ChatCompletionRequestFunctionMessage

Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.

func (*ChatCompletionRequestFunctionMessage) GetContent

func (*ChatCompletionRequestFunctionMessage) GetName

func (*ChatCompletionRequestFunctionMessage) GetRole

type ChatCompletionRequestFunctionMessageRole

type ChatCompletionRequestFunctionMessageRole string

ChatCompletionRequestFunctionMessageRole - The role of the messages author, in this case `function`.

const (
	ChatCompletionRequestFunctionMessageRoleFunction ChatCompletionRequestFunctionMessageRole = "function"
)

func (ChatCompletionRequestFunctionMessageRole) ToPointer

func (*ChatCompletionRequestFunctionMessageRole) UnmarshalJSON

func (e *ChatCompletionRequestFunctionMessageRole) UnmarshalJSON(data []byte) error

type ChatCompletionRequestMessage

type ChatCompletionRequestMessage struct {
	ChatCompletionRequestSystemMessage    *ChatCompletionRequestSystemMessage
	ChatCompletionRequestUserMessage      *ChatCompletionRequestUserMessage
	ChatCompletionRequestAssistantMessage *ChatCompletionRequestAssistantMessage
	ChatCompletionRequestToolMessage      *ChatCompletionRequestToolMessage
	ChatCompletionRequestFunctionMessage  *ChatCompletionRequestFunctionMessage

	Type ChatCompletionRequestMessageType
}

func CreateChatCompletionRequestMessageChatCompletionRequestAssistantMessage

func CreateChatCompletionRequestMessageChatCompletionRequestAssistantMessage(chatCompletionRequestAssistantMessage ChatCompletionRequestAssistantMessage) ChatCompletionRequestMessage

func CreateChatCompletionRequestMessageChatCompletionRequestFunctionMessage

func CreateChatCompletionRequestMessageChatCompletionRequestFunctionMessage(chatCompletionRequestFunctionMessage ChatCompletionRequestFunctionMessage) ChatCompletionRequestMessage

func CreateChatCompletionRequestMessageChatCompletionRequestSystemMessage

func CreateChatCompletionRequestMessageChatCompletionRequestSystemMessage(chatCompletionRequestSystemMessage ChatCompletionRequestSystemMessage) ChatCompletionRequestMessage

func CreateChatCompletionRequestMessageChatCompletionRequestToolMessage

func CreateChatCompletionRequestMessageChatCompletionRequestToolMessage(chatCompletionRequestToolMessage ChatCompletionRequestToolMessage) ChatCompletionRequestMessage

func CreateChatCompletionRequestMessageChatCompletionRequestUserMessage

func CreateChatCompletionRequestMessageChatCompletionRequestUserMessage(chatCompletionRequestUserMessage ChatCompletionRequestUserMessage) ChatCompletionRequestMessage

func (ChatCompletionRequestMessage) MarshalJSON

func (u ChatCompletionRequestMessage) MarshalJSON() ([]byte, error)

func (*ChatCompletionRequestMessage) UnmarshalJSON

func (u *ChatCompletionRequestMessage) UnmarshalJSON(data []byte) error

type ChatCompletionRequestMessageContentPart

type ChatCompletionRequestMessageContentPart struct {
	ChatCompletionRequestMessageContentPartText  *ChatCompletionRequestMessageContentPartText
	ChatCompletionRequestMessageContentPartImage *ChatCompletionRequestMessageContentPartImage

	Type ChatCompletionRequestMessageContentPartType
}

func CreateChatCompletionRequestMessageContentPartChatCompletionRequestMessageContentPartImage

func CreateChatCompletionRequestMessageContentPartChatCompletionRequestMessageContentPartImage(chatCompletionRequestMessageContentPartImage ChatCompletionRequestMessageContentPartImage) ChatCompletionRequestMessageContentPart

func CreateChatCompletionRequestMessageContentPartChatCompletionRequestMessageContentPartText

func CreateChatCompletionRequestMessageContentPartChatCompletionRequestMessageContentPartText(chatCompletionRequestMessageContentPartText ChatCompletionRequestMessageContentPartText) ChatCompletionRequestMessageContentPart

func (ChatCompletionRequestMessageContentPart) MarshalJSON

func (u ChatCompletionRequestMessageContentPart) MarshalJSON() ([]byte, error)

func (*ChatCompletionRequestMessageContentPart) UnmarshalJSON

func (u *ChatCompletionRequestMessageContentPart) UnmarshalJSON(data []byte) error

type ChatCompletionRequestMessageContentPartImage

type ChatCompletionRequestMessageContentPartImage struct {
	ImageURL ImageURL `json:"image_url"`
	// The type of the content part.
	Type ChatCompletionRequestMessageContentPartImageType `json:"type"`
}

func (*ChatCompletionRequestMessageContentPartImage) GetImageURL

func (*ChatCompletionRequestMessageContentPartImage) GetType

type ChatCompletionRequestMessageContentPartImageType

type ChatCompletionRequestMessageContentPartImageType string

ChatCompletionRequestMessageContentPartImageType - The type of the content part.

const (
	ChatCompletionRequestMessageContentPartImageTypeImageURL ChatCompletionRequestMessageContentPartImageType = "image_url"
)

func (ChatCompletionRequestMessageContentPartImageType) ToPointer

func (*ChatCompletionRequestMessageContentPartImageType) UnmarshalJSON

type ChatCompletionRequestMessageContentPartText

type ChatCompletionRequestMessageContentPartText struct {
	// The text content.
	Text string `json:"text"`
	// The type of the content part.
	Type ChatCompletionRequestMessageContentPartTextType `json:"type"`
}

func (*ChatCompletionRequestMessageContentPartText) GetText

func (*ChatCompletionRequestMessageContentPartText) GetType

type ChatCompletionRequestMessageContentPartTextType

type ChatCompletionRequestMessageContentPartTextType string

ChatCompletionRequestMessageContentPartTextType - The type of the content part.

const (
	ChatCompletionRequestMessageContentPartTextTypeText ChatCompletionRequestMessageContentPartTextType = "text"
)

func (ChatCompletionRequestMessageContentPartTextType) ToPointer

func (*ChatCompletionRequestMessageContentPartTextType) UnmarshalJSON

type ChatCompletionRequestMessageContentPartType

type ChatCompletionRequestMessageContentPartType string
const (
	ChatCompletionRequestMessageContentPartTypeChatCompletionRequestMessageContentPartText  ChatCompletionRequestMessageContentPartType = "ChatCompletionRequestMessageContentPartText"
	ChatCompletionRequestMessageContentPartTypeChatCompletionRequestMessageContentPartImage ChatCompletionRequestMessageContentPartType = "ChatCompletionRequestMessageContentPartImage"
)

type ChatCompletionRequestMessageType

type ChatCompletionRequestMessageType string
const (
	ChatCompletionRequestMessageTypeChatCompletionRequestSystemMessage    ChatCompletionRequestMessageType = "ChatCompletionRequestSystemMessage"
	ChatCompletionRequestMessageTypeChatCompletionRequestUserMessage      ChatCompletionRequestMessageType = "ChatCompletionRequestUserMessage"
	ChatCompletionRequestMessageTypeChatCompletionRequestAssistantMessage ChatCompletionRequestMessageType = "ChatCompletionRequestAssistantMessage"
	ChatCompletionRequestMessageTypeChatCompletionRequestToolMessage      ChatCompletionRequestMessageType = "ChatCompletionRequestToolMessage"
	ChatCompletionRequestMessageTypeChatCompletionRequestFunctionMessage  ChatCompletionRequestMessageType = "ChatCompletionRequestFunctionMessage"
)

type ChatCompletionRequestSystemMessage

type ChatCompletionRequestSystemMessage struct {
	// The contents of the system message.
	Content string `json:"content"`
	// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
	Name *string `json:"name,omitempty"`
	// The role of the messages author, in this case `system`.
	Role ChatCompletionRequestSystemMessageRole `json:"role"`
}

func (*ChatCompletionRequestSystemMessage) GetContent

func (*ChatCompletionRequestSystemMessage) GetName

func (*ChatCompletionRequestSystemMessage) GetRole

type ChatCompletionRequestSystemMessageRole

type ChatCompletionRequestSystemMessageRole string

ChatCompletionRequestSystemMessageRole - The role of the messages author, in this case `system`.

const (
	ChatCompletionRequestSystemMessageRoleSystem ChatCompletionRequestSystemMessageRole = "system"
)

func (ChatCompletionRequestSystemMessageRole) ToPointer

func (*ChatCompletionRequestSystemMessageRole) UnmarshalJSON

func (e *ChatCompletionRequestSystemMessageRole) UnmarshalJSON(data []byte) error

type ChatCompletionRequestToolMessage

type ChatCompletionRequestToolMessage struct {
	// The contents of the tool message.
	Content string `json:"content"`
	// The role of the messages author, in this case `tool`.
	Role ChatCompletionRequestToolMessageRole `json:"role"`
	// Tool call that this message is responding to.
	ToolCallID string `json:"tool_call_id"`
}

func (*ChatCompletionRequestToolMessage) GetContent

func (o *ChatCompletionRequestToolMessage) GetContent() string

func (*ChatCompletionRequestToolMessage) GetRole

func (*ChatCompletionRequestToolMessage) GetToolCallID

func (o *ChatCompletionRequestToolMessage) GetToolCallID() string

type ChatCompletionRequestToolMessageRole

type ChatCompletionRequestToolMessageRole string

ChatCompletionRequestToolMessageRole - The role of the messages author, in this case `tool`.

const (
	ChatCompletionRequestToolMessageRoleTool ChatCompletionRequestToolMessageRole = "tool"
)

func (ChatCompletionRequestToolMessageRole) ToPointer

func (*ChatCompletionRequestToolMessageRole) UnmarshalJSON

func (e *ChatCompletionRequestToolMessageRole) UnmarshalJSON(data []byte) error

type ChatCompletionRequestUserMessage

type ChatCompletionRequestUserMessage struct {
	// The contents of the user message.
	//
	Content Content `json:"content"`
	// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
	Name *string `json:"name,omitempty"`
	// The role of the messages author, in this case `user`.
	Role ChatCompletionRequestUserMessageRole `json:"role"`
}

func (*ChatCompletionRequestUserMessage) GetContent

func (o *ChatCompletionRequestUserMessage) GetContent() Content

func (*ChatCompletionRequestUserMessage) GetName

func (*ChatCompletionRequestUserMessage) GetRole

type ChatCompletionRequestUserMessageRole

type ChatCompletionRequestUserMessageRole string

ChatCompletionRequestUserMessageRole - The role of the messages author, in this case `user`.

const (
	ChatCompletionRequestUserMessageRoleUser ChatCompletionRequestUserMessageRole = "user"
)

func (ChatCompletionRequestUserMessageRole) ToPointer

func (*ChatCompletionRequestUserMessageRole) UnmarshalJSON

func (e *ChatCompletionRequestUserMessageRole) UnmarshalJSON(data []byte) error

type ChatCompletionResponseMessage

type ChatCompletionResponseMessage struct {
	// The contents of the message.
	Content *string `json:"content"`
	// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
	//
	// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
	FunctionCall *ChatCompletionResponseMessageFunctionCall `json:"function_call,omitempty"`
	// The role of the author of this message.
	Role ChatCompletionResponseMessageRole `json:"role"`
	// The tool calls generated by the model, such as function calls.
	ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls,omitempty"`
}

ChatCompletionResponseMessage - A chat completion message generated by the model.

func (*ChatCompletionResponseMessage) GetContent

func (o *ChatCompletionResponseMessage) GetContent() *string

func (*ChatCompletionResponseMessage) GetFunctionCall

func (*ChatCompletionResponseMessage) GetRole

func (*ChatCompletionResponseMessage) GetToolCalls

type ChatCompletionResponseMessageFunctionCall

type ChatCompletionResponseMessageFunctionCall struct {
	// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
	Arguments string `json:"arguments"`
	// The name of the function to call.
	Name string `json:"name"`
}

ChatCompletionResponseMessageFunctionCall - Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.

Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.

func (*ChatCompletionResponseMessageFunctionCall) GetArguments

func (*ChatCompletionResponseMessageFunctionCall) GetName

type ChatCompletionResponseMessageRole

type ChatCompletionResponseMessageRole string

ChatCompletionResponseMessageRole - The role of the author of this message.

const (
	ChatCompletionResponseMessageRoleAssistant ChatCompletionResponseMessageRole = "assistant"
)

func (ChatCompletionResponseMessageRole) ToPointer

func (*ChatCompletionResponseMessageRole) UnmarshalJSON

func (e *ChatCompletionResponseMessageRole) UnmarshalJSON(data []byte) error

type ChatCompletionTokenLogprob

type ChatCompletionTokenLogprob struct {
	// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
	Bytes []int64 `json:"bytes"`
	// The log probability of this token.
	Logprob float64 `json:"logprob"`
	// The token.
	Token string `json:"token"`
	// List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
	TopLogprobs []TopLogprobs `json:"top_logprobs"`
}

func (*ChatCompletionTokenLogprob) GetBytes

func (o *ChatCompletionTokenLogprob) GetBytes() []int64

func (*ChatCompletionTokenLogprob) GetLogprob

func (o *ChatCompletionTokenLogprob) GetLogprob() float64

func (*ChatCompletionTokenLogprob) GetToken

func (o *ChatCompletionTokenLogprob) GetToken() string

func (*ChatCompletionTokenLogprob) GetTopLogprobs

func (o *ChatCompletionTokenLogprob) GetTopLogprobs() []TopLogprobs

type ChatCompletionTool

type ChatCompletionTool struct {
	Function FunctionObject `json:"function"`
	// The type of the tool. Currently, only `function` is supported.
	Type ChatCompletionToolType `json:"type"`
}

func (*ChatCompletionTool) GetFunction

func (o *ChatCompletionTool) GetFunction() FunctionObject

func (*ChatCompletionTool) GetType

type ChatCompletionToolChoiceOption

type ChatCompletionToolChoiceOption struct {
	One                           *One
	ChatCompletionNamedToolChoice *ChatCompletionNamedToolChoice

	Type ChatCompletionToolChoiceOptionType
}

ChatCompletionToolChoiceOption - Controls which (if any) function is called by the model. `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. Specifying a particular function via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that function.

`none` is the default when no functions are present. `auto` is the default if functions are present.

func CreateChatCompletionToolChoiceOptionChatCompletionNamedToolChoice

func CreateChatCompletionToolChoiceOptionChatCompletionNamedToolChoice(chatCompletionNamedToolChoice ChatCompletionNamedToolChoice) ChatCompletionToolChoiceOption

func CreateChatCompletionToolChoiceOptionOne

func CreateChatCompletionToolChoiceOptionOne(one One) ChatCompletionToolChoiceOption

func (ChatCompletionToolChoiceOption) MarshalJSON

func (u ChatCompletionToolChoiceOption) MarshalJSON() ([]byte, error)

func (*ChatCompletionToolChoiceOption) UnmarshalJSON

func (u *ChatCompletionToolChoiceOption) UnmarshalJSON(data []byte) error

type ChatCompletionToolChoiceOptionType

type ChatCompletionToolChoiceOptionType string
const (
	ChatCompletionToolChoiceOptionTypeOne                           ChatCompletionToolChoiceOptionType = "1"
	ChatCompletionToolChoiceOptionTypeChatCompletionNamedToolChoice ChatCompletionToolChoiceOptionType = "ChatCompletionNamedToolChoice"
)

type ChatCompletionToolType

type ChatCompletionToolType string

ChatCompletionToolType - The type of the tool. Currently, only `function` is supported.

const (
	ChatCompletionToolTypeFunction ChatCompletionToolType = "function"
)

func (ChatCompletionToolType) ToPointer

func (*ChatCompletionToolType) UnmarshalJSON

func (e *ChatCompletionToolType) UnmarshalJSON(data []byte) error

type Choices

type Choices struct {
	// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
	// `length` if the maximum number of tokens specified in the request was reached,
	// `content_filter` if content was omitted due to a flag from our content filters,
	// `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
	//
	FinishReason FinishReason `json:"finish_reason"`
	// The index of the choice in the list of choices.
	Index int64 `json:"index"`
	// Log probability information for the choice.
	Logprobs *Logprobs `json:"logprobs"`
	// A chat completion message generated by the model.
	Message ChatCompletionResponseMessage `json:"message"`
}

func (*Choices) GetFinishReason

func (o *Choices) GetFinishReason() FinishReason

func (*Choices) GetIndex

func (o *Choices) GetIndex() int64

func (*Choices) GetLogprobs

func (o *Choices) GetLogprobs() *Logprobs

func (*Choices) GetMessage

func (o *Choices) GetMessage() ChatCompletionResponseMessage

type Code

type Code string

Code - One of `server_error` or `rate_limit_exceeded`.

const (
	CodeServerError       Code = "server_error"
	CodeRateLimitExceeded Code = "rate_limit_exceeded"
)

func (Code) ToPointer

func (e Code) ToPointer() *Code

func (*Code) UnmarshalJSON

func (e *Code) UnmarshalJSON(data []byte) error

type CodeInterpreter

type CodeInterpreter struct {
	// The input to the Code Interpreter tool call.
	Input string `json:"input"`
	// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.
	Outputs []Outputs `json:"outputs"`
}

CodeInterpreter - The Code Interpreter tool call definition.

func (*CodeInterpreter) GetInput

func (o *CodeInterpreter) GetInput() string

func (*CodeInterpreter) GetOutputs

func (o *CodeInterpreter) GetOutputs() []Outputs

type CompletionUsage

type CompletionUsage struct {
	// Number of tokens in the generated completion.
	CompletionTokens int64 `json:"completion_tokens"`
	// Number of tokens in the prompt.
	PromptTokens int64 `json:"prompt_tokens"`
	// Total number of tokens used in the request (prompt + completion).
	TotalTokens int64 `json:"total_tokens"`
}

CompletionUsage - Usage statistics for the completion request.

func (*CompletionUsage) GetCompletionTokens

func (o *CompletionUsage) GetCompletionTokens() int64

func (*CompletionUsage) GetPromptTokens

func (o *CompletionUsage) GetPromptTokens() int64

func (*CompletionUsage) GetTotalTokens

func (o *CompletionUsage) GetTotalTokens() int64

type Content

type Content struct {
	Str                                            *string
	ArrayOfChatCompletionRequestMessageContentPart []ChatCompletionRequestMessageContentPart

	Type ContentType
}

Content - The contents of the user message.

func CreateContentArrayOfChatCompletionRequestMessageContentPart

func CreateContentArrayOfChatCompletionRequestMessageContentPart(arrayOfChatCompletionRequestMessageContentPart []ChatCompletionRequestMessageContentPart) Content

func CreateContentStr

func CreateContentStr(str string) Content

func (Content) MarshalJSON

func (u Content) MarshalJSON() ([]byte, error)

func (*Content) UnmarshalJSON

func (u *Content) UnmarshalJSON(data []byte) error

type ContentType

type ContentType string
const (
	ContentTypeStr                                            ContentType = "str"
	ContentTypeArrayOfChatCompletionRequestMessageContentPart ContentType = "arrayOfChatCompletionRequestMessageContentPart"
)

type CreateAssistantFileRequest

type CreateAssistantFileRequest struct {
	// A [File](/docs/api-reference/files) ID (with `purpose="assistants"`) that the assistant should use. Useful for tools like `retrieval` and `code_interpreter` that can access files.
	FileID string `json:"file_id"`
}

func (*CreateAssistantFileRequest) GetFileID

func (o *CreateAssistantFileRequest) GetFileID() string

type CreateAssistantRequest

type CreateAssistantRequest struct {
	// The description of the assistant. The maximum length is 512 characters.
	//
	Description *string `json:"description,omitempty"`
	// A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order.
	//
	FileIds []string `json:"file_ids,omitempty"`
	// The system instructions that the assistant uses. The maximum length is 32768 characters.
	//
	Instructions *string `json:"instructions,omitempty"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *CreateAssistantRequestMetadata `json:"metadata,omitempty"`
	// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
	//
	Model string `json:"model"`
	// The name of the assistant. The maximum length is 256 characters.
	//
	Name *string `json:"name,omitempty"`
	// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
	//
	Tools []CreateAssistantRequestTools `json:"tools,omitempty"`
}

func (*CreateAssistantRequest) GetDescription

func (o *CreateAssistantRequest) GetDescription() *string

func (*CreateAssistantRequest) GetFileIds

func (o *CreateAssistantRequest) GetFileIds() []string

func (*CreateAssistantRequest) GetInstructions

func (o *CreateAssistantRequest) GetInstructions() *string

func (*CreateAssistantRequest) GetMetadata

func (*CreateAssistantRequest) GetModel

func (o *CreateAssistantRequest) GetModel() string

func (*CreateAssistantRequest) GetName

func (o *CreateAssistantRequest) GetName() *string

func (*CreateAssistantRequest) GetTools

type CreateAssistantRequestMetadata

type CreateAssistantRequestMetadata struct {
}

CreateAssistantRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type CreateAssistantRequestTools

type CreateAssistantRequestTools struct {
	AssistantToolsCode      *AssistantToolsCode
	AssistantToolsRetrieval *AssistantToolsRetrieval
	AssistantToolsFunction  *AssistantToolsFunction

	Type CreateAssistantRequestToolsType
}

func CreateCreateAssistantRequestToolsAssistantToolsCode

func CreateCreateAssistantRequestToolsAssistantToolsCode(assistantToolsCode AssistantToolsCode) CreateAssistantRequestTools

func CreateCreateAssistantRequestToolsAssistantToolsFunction

func CreateCreateAssistantRequestToolsAssistantToolsFunction(assistantToolsFunction AssistantToolsFunction) CreateAssistantRequestTools

func CreateCreateAssistantRequestToolsAssistantToolsRetrieval

func CreateCreateAssistantRequestToolsAssistantToolsRetrieval(assistantToolsRetrieval AssistantToolsRetrieval) CreateAssistantRequestTools

func (CreateAssistantRequestTools) MarshalJSON

func (u CreateAssistantRequestTools) MarshalJSON() ([]byte, error)

func (*CreateAssistantRequestTools) UnmarshalJSON

func (u *CreateAssistantRequestTools) UnmarshalJSON(data []byte) error

type CreateAssistantRequestToolsType

type CreateAssistantRequestToolsType string
const (
	CreateAssistantRequestToolsTypeAssistantToolsCode      CreateAssistantRequestToolsType = "AssistantToolsCode"
	CreateAssistantRequestToolsTypeAssistantToolsRetrieval CreateAssistantRequestToolsType = "AssistantToolsRetrieval"
	CreateAssistantRequestToolsTypeAssistantToolsFunction  CreateAssistantRequestToolsType = "AssistantToolsFunction"
)

type CreateChatCompletionRequest

type CreateChatCompletionRequest struct {
	// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
	//
	// [See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)
	//
	FrequencyPenalty *float64 `default:"0" json:"frequency_penalty"`
	// Deprecated in favor of `tool_choice`.
	//
	// Controls which (if any) function is called by the model.
	// `none` means the model will not call a function and instead generates a message.
	// `auto` means the model can pick between generating a message or calling a function.
	// Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
	//
	// `none` is the default when no functions are present. `auto` is the default if functions are present.
	//
	//
	// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
	FunctionCall *CreateChatCompletionRequestFunctionCall `json:"function_call,omitempty"`
	// Deprecated in favor of `tools`.
	//
	// A list of functions the model may generate JSON inputs for.
	//
	//
	// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
	Functions []ChatCompletionFunctions `json:"functions,omitempty"`
	// Modify the likelihood of specified tokens appearing in the completion.
	//
	// Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
	//
	LogitBias map[string]int64 `json:"logit_bias,omitempty"`
	// Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model.
	Logprobs *bool `default:"false" json:"logprobs"`
	// The maximum number of [tokens](/tokenizer) that can be generated in the chat completion.
	//
	// The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.
	//
	MaxTokens *int64 `json:"max_tokens,omitempty"`
	// A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models).
	Messages []ChatCompletionRequestMessage `json:"messages"`
	// ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.
	Model CreateChatCompletionRequestModel `json:"model"`
	// How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.
	N *int64 `default:"1" json:"n"`
	// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
	//
	// [See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)
	//
	PresencePenalty *float64 `default:"0" json:"presence_penalty"`
	// An object specifying the format that the model must output. Compatible with [GPT-4 Turbo](/docs/models/gpt-4-and-gpt-4-turbo) and all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.
	//
	// Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.
	//
	// **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
	//
	ResponseFormat *ResponseFormat `json:"response_format,omitempty"`
	// This feature is in Beta.
	// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.
	// Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
	//
	Seed *int64 `json:"seed,omitempty"`
	// Up to 4 sequences where the API will stop generating further tokens.
	//
	Stop *Stop `json:"stop,omitempty"`
	// If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
	//
	Stream *bool `default:"false" json:"stream"`
	// 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.
	//
	// We generally recommend altering this or `top_p` but not both.
	//
	Temperature *float64 `default:"1" json:"temperature"`
	// Controls which (if any) function is called by the model.
	// `none` means the model will not call a function and instead generates a message.
	// `auto` means the model can pick between generating a message or calling a function.
	// Specifying a particular function via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that function.
	//
	// `none` is the default when no functions are present. `auto` is the default if functions are present.
	//
	ToolChoice *ChatCompletionToolChoiceOption `json:"tool_choice,omitempty"`
	// A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
	//
	Tools []ChatCompletionTool `json:"tools,omitempty"`
	// An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.
	TopLogprobs *int64 `json:"top_logprobs,omitempty"`
	// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
	//
	// We generally recommend altering this or `temperature` but not both.
	//
	TopP *float64 `default:"1" json:"top_p"`
	// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
	//
	User *string `json:"user,omitempty"`
}

func (*CreateChatCompletionRequest) GetFrequencyPenalty

func (o *CreateChatCompletionRequest) GetFrequencyPenalty() *float64

func (*CreateChatCompletionRequest) GetFunctionCall

func (*CreateChatCompletionRequest) GetFunctions

func (*CreateChatCompletionRequest) GetLogitBias

func (o *CreateChatCompletionRequest) GetLogitBias() map[string]int64

func (*CreateChatCompletionRequest) GetLogprobs

func (o *CreateChatCompletionRequest) GetLogprobs() *bool

func (*CreateChatCompletionRequest) GetMaxTokens

func (o *CreateChatCompletionRequest) GetMaxTokens() *int64

func (*CreateChatCompletionRequest) GetMessages

func (*CreateChatCompletionRequest) GetModel

func (*CreateChatCompletionRequest) GetN

func (*CreateChatCompletionRequest) GetPresencePenalty

func (o *CreateChatCompletionRequest) GetPresencePenalty() *float64

func (*CreateChatCompletionRequest) GetResponseFormat

func (o *CreateChatCompletionRequest) GetResponseFormat() *ResponseFormat

func (*CreateChatCompletionRequest) GetSeed

func (o *CreateChatCompletionRequest) GetSeed() *int64

func (*CreateChatCompletionRequest) GetStop

func (o *CreateChatCompletionRequest) GetStop() *Stop

func (*CreateChatCompletionRequest) GetStream

func (o *CreateChatCompletionRequest) GetStream() *bool

func (*CreateChatCompletionRequest) GetTemperature

func (o *CreateChatCompletionRequest) GetTemperature() *float64

func (*CreateChatCompletionRequest) GetToolChoice

func (*CreateChatCompletionRequest) GetTools

func (*CreateChatCompletionRequest) GetTopLogprobs

func (o *CreateChatCompletionRequest) GetTopLogprobs() *int64

func (*CreateChatCompletionRequest) GetTopP

func (o *CreateChatCompletionRequest) GetTopP() *float64

func (*CreateChatCompletionRequest) GetUser

func (o *CreateChatCompletionRequest) GetUser() *string

func (CreateChatCompletionRequest) MarshalJSON

func (c CreateChatCompletionRequest) MarshalJSON() ([]byte, error)

func (*CreateChatCompletionRequest) UnmarshalJSON

func (c *CreateChatCompletionRequest) UnmarshalJSON(data []byte) error

type CreateChatCompletionRequest1

type CreateChatCompletionRequest1 string

CreateChatCompletionRequest1 - `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function.

const (
	CreateChatCompletionRequest1None CreateChatCompletionRequest1 = "none"
	CreateChatCompletionRequest1Auto CreateChatCompletionRequest1 = "auto"
)

func (CreateChatCompletionRequest1) ToPointer

func (*CreateChatCompletionRequest1) UnmarshalJSON

func (e *CreateChatCompletionRequest1) UnmarshalJSON(data []byte) error

type CreateChatCompletionRequestFunctionCall

type CreateChatCompletionRequestFunctionCall struct {
	CreateChatCompletionRequest1     *CreateChatCompletionRequest1
	ChatCompletionFunctionCallOption *ChatCompletionFunctionCallOption

	Type CreateChatCompletionRequestFunctionCallType
}

CreateChatCompletionRequestFunctionCall - Deprecated in favor of `tool_choice`.

Controls which (if any) function is called by the model. `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.

`none` is the default when no functions are present. `auto` is the default if functions are present.

Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.

func CreateCreateChatCompletionRequestFunctionCallChatCompletionFunctionCallOption

func CreateCreateChatCompletionRequestFunctionCallChatCompletionFunctionCallOption(chatCompletionFunctionCallOption ChatCompletionFunctionCallOption) CreateChatCompletionRequestFunctionCall

func CreateCreateChatCompletionRequestFunctionCallCreateChatCompletionRequest1

func CreateCreateChatCompletionRequestFunctionCallCreateChatCompletionRequest1(createChatCompletionRequest1 CreateChatCompletionRequest1) CreateChatCompletionRequestFunctionCall

func (CreateChatCompletionRequestFunctionCall) MarshalJSON

func (u CreateChatCompletionRequestFunctionCall) MarshalJSON() ([]byte, error)

func (*CreateChatCompletionRequestFunctionCall) UnmarshalJSON

func (u *CreateChatCompletionRequestFunctionCall) UnmarshalJSON(data []byte) error

type CreateChatCompletionRequestFunctionCallType

type CreateChatCompletionRequestFunctionCallType string
const (
	CreateChatCompletionRequestFunctionCallTypeCreateChatCompletionRequest1     CreateChatCompletionRequestFunctionCallType = "CreateChatCompletionRequest_1"
	CreateChatCompletionRequestFunctionCallTypeChatCompletionFunctionCallOption CreateChatCompletionRequestFunctionCallType = "ChatCompletionFunctionCallOption"
)

type CreateChatCompletionRequestModel

type CreateChatCompletionRequestModel struct {
	Str *string
	Two *Two

	Type CreateChatCompletionRequestModelType
}

CreateChatCompletionRequestModel - ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.

func CreateCreateChatCompletionRequestModelStr

func CreateCreateChatCompletionRequestModelStr(str string) CreateChatCompletionRequestModel

func CreateCreateChatCompletionRequestModelTwo

func CreateCreateChatCompletionRequestModelTwo(two Two) CreateChatCompletionRequestModel

func (CreateChatCompletionRequestModel) MarshalJSON

func (u CreateChatCompletionRequestModel) MarshalJSON() ([]byte, error)

func (*CreateChatCompletionRequestModel) UnmarshalJSON

func (u *CreateChatCompletionRequestModel) UnmarshalJSON(data []byte) error

type CreateChatCompletionRequestModelType

type CreateChatCompletionRequestModelType string
const (
	CreateChatCompletionRequestModelTypeStr CreateChatCompletionRequestModelType = "str"
	CreateChatCompletionRequestModelTypeTwo CreateChatCompletionRequestModelType = "2"
)

type CreateChatCompletionRequestType

type CreateChatCompletionRequestType string

CreateChatCompletionRequestType - Must be one of `text` or `json_object`.

const (
	CreateChatCompletionRequestTypeText       CreateChatCompletionRequestType = "text"
	CreateChatCompletionRequestTypeJSONObject CreateChatCompletionRequestType = "json_object"
)

func (CreateChatCompletionRequestType) ToPointer

func (*CreateChatCompletionRequestType) UnmarshalJSON

func (e *CreateChatCompletionRequestType) UnmarshalJSON(data []byte) error

type CreateChatCompletionResponse

type CreateChatCompletionResponse struct {
	// A list of chat completion choices. Can be more than one if `n` is greater than 1.
	Choices []Choices `json:"choices"`
	// The Unix timestamp (in seconds) of when the chat completion was created.
	Created int64 `json:"created"`
	// A unique identifier for the chat completion.
	ID string `json:"id"`
	// The model used for the chat completion.
	Model string `json:"model"`
	// The object type, which is always `chat.completion`.
	Object CreateChatCompletionResponseObject `json:"object"`
	// This fingerprint represents the backend configuration that the model runs with.
	//
	// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
	//
	SystemFingerprint *string `json:"system_fingerprint,omitempty"`
	// Usage statistics for the completion request.
	Usage *CompletionUsage `json:"usage,omitempty"`
}

CreateChatCompletionResponse - Represents a chat completion response returned by model, based on the provided input.

func (*CreateChatCompletionResponse) GetChoices

func (o *CreateChatCompletionResponse) GetChoices() []Choices

func (*CreateChatCompletionResponse) GetCreated

func (o *CreateChatCompletionResponse) GetCreated() int64

func (*CreateChatCompletionResponse) GetID

func (*CreateChatCompletionResponse) GetModel

func (o *CreateChatCompletionResponse) GetModel() string

func (*CreateChatCompletionResponse) GetObject

func (*CreateChatCompletionResponse) GetSystemFingerprint

func (o *CreateChatCompletionResponse) GetSystemFingerprint() *string

func (*CreateChatCompletionResponse) GetUsage

type CreateChatCompletionResponseObject

type CreateChatCompletionResponseObject string

CreateChatCompletionResponseObject - The object type, which is always `chat.completion`.

const (
	CreateChatCompletionResponseObjectChatCompletion CreateChatCompletionResponseObject = "chat.completion"
)

func (CreateChatCompletionResponseObject) ToPointer

func (*CreateChatCompletionResponseObject) UnmarshalJSON

func (e *CreateChatCompletionResponseObject) UnmarshalJSON(data []byte) error

type CreateCompletionRequest

type CreateCompletionRequest struct {
	// Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.
	//
	// When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.
	//
	// **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
	//
	BestOf *int64 `default:"1" json:"best_of"`
	// Echo back the prompt in addition to the completion
	//
	Echo *bool `default:"false" json:"echo"`
	// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
	//
	// [See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)
	//
	FrequencyPenalty *float64 `default:"0" json:"frequency_penalty"`
	// Modify the likelihood of specified tokens appearing in the completion.
	//
	// Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
	//
	// As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated.
	//
	LogitBias map[string]int64 `json:"logit_bias,omitempty"`
	// Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.
	//
	// The maximum value for `logprobs` is 5.
	//
	Logprobs *int64 `default:"null" json:"logprobs"`
	// The maximum number of [tokens](/tokenizer) that can be generated in the completion.
	//
	// The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.
	//
	MaxTokens *int64 `default:"16" json:"max_tokens"`
	// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
	//
	Model CreateCompletionRequestModel `json:"model"`
	// How many completions to generate for each prompt.
	//
	// **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
	//
	N *int64 `default:"1" json:"n"`
	// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
	//
	// [See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)
	//
	PresencePenalty *float64 `default:"0" json:"presence_penalty"`
	// The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.
	//
	// Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
	//
	Prompt *Prompt `json:"prompt"`
	// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.
	//
	// Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
	//
	Seed *int64 `json:"seed,omitempty"`
	// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
	//
	Stop *CreateCompletionRequestStop `json:"stop,omitempty"`
	// Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
	//
	Stream *bool `default:"false" json:"stream"`
	// The suffix that comes after a completion of inserted text.
	Suffix *string `default:"null" json:"suffix"`
	// 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.
	//
	// We generally recommend altering this or `top_p` but not both.
	//
	Temperature *float64 `default:"1" json:"temperature"`
	// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
	//
	// We generally recommend altering this or `temperature` but not both.
	//
	TopP *float64 `default:"1" json:"top_p"`
	// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
	//
	User *string `json:"user,omitempty"`
}

func (*CreateCompletionRequest) GetBestOf

func (o *CreateCompletionRequest) GetBestOf() *int64

func (*CreateCompletionRequest) GetEcho

func (o *CreateCompletionRequest) GetEcho() *bool

func (*CreateCompletionRequest) GetFrequencyPenalty

func (o *CreateCompletionRequest) GetFrequencyPenalty() *float64

func (*CreateCompletionRequest) GetLogitBias

func (o *CreateCompletionRequest) GetLogitBias() map[string]int64

func (*CreateCompletionRequest) GetLogprobs

func (o *CreateCompletionRequest) GetLogprobs() *int64

func (*CreateCompletionRequest) GetMaxTokens

func (o *CreateCompletionRequest) GetMaxTokens() *int64

func (*CreateCompletionRequest) GetModel

func (*CreateCompletionRequest) GetN

func (o *CreateCompletionRequest) GetN() *int64

func (*CreateCompletionRequest) GetPresencePenalty

func (o *CreateCompletionRequest) GetPresencePenalty() *float64

func (*CreateCompletionRequest) GetPrompt

func (o *CreateCompletionRequest) GetPrompt() *Prompt

func (*CreateCompletionRequest) GetSeed

func (o *CreateCompletionRequest) GetSeed() *int64

func (*CreateCompletionRequest) GetStop

func (*CreateCompletionRequest) GetStream

func (o *CreateCompletionRequest) GetStream() *bool

func (*CreateCompletionRequest) GetSuffix

func (o *CreateCompletionRequest) GetSuffix() *string

func (*CreateCompletionRequest) GetTemperature

func (o *CreateCompletionRequest) GetTemperature() *float64

func (*CreateCompletionRequest) GetTopP

func (o *CreateCompletionRequest) GetTopP() *float64

func (*CreateCompletionRequest) GetUser

func (o *CreateCompletionRequest) GetUser() *string

func (CreateCompletionRequest) MarshalJSON

func (c CreateCompletionRequest) MarshalJSON() ([]byte, error)

func (*CreateCompletionRequest) UnmarshalJSON

func (c *CreateCompletionRequest) UnmarshalJSON(data []byte) error

type CreateCompletionRequest2

type CreateCompletionRequest2 string
const (
	CreateCompletionRequest2Gpt35TurboInstruct CreateCompletionRequest2 = "gpt-3.5-turbo-instruct"
	CreateCompletionRequest2Davinci002         CreateCompletionRequest2 = "davinci-002"
	CreateCompletionRequest2Babbage002         CreateCompletionRequest2 = "babbage-002"
)

func (CreateCompletionRequest2) ToPointer

func (*CreateCompletionRequest2) UnmarshalJSON

func (e *CreateCompletionRequest2) UnmarshalJSON(data []byte) error

type CreateCompletionRequestModel

type CreateCompletionRequestModel struct {
	Str                      *string
	CreateCompletionRequest2 *CreateCompletionRequest2

	Type CreateCompletionRequestModelType
}

CreateCompletionRequestModel - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.

func CreateCreateCompletionRequestModelCreateCompletionRequest2

func CreateCreateCompletionRequestModelCreateCompletionRequest2(createCompletionRequest2 CreateCompletionRequest2) CreateCompletionRequestModel

func CreateCreateCompletionRequestModelStr

func CreateCreateCompletionRequestModelStr(str string) CreateCompletionRequestModel

func (CreateCompletionRequestModel) MarshalJSON

func (u CreateCompletionRequestModel) MarshalJSON() ([]byte, error)

func (*CreateCompletionRequestModel) UnmarshalJSON

func (u *CreateCompletionRequestModel) UnmarshalJSON(data []byte) error

type CreateCompletionRequestModelType

type CreateCompletionRequestModelType string
const (
	CreateCompletionRequestModelTypeStr                      CreateCompletionRequestModelType = "str"
	CreateCompletionRequestModelTypeCreateCompletionRequest2 CreateCompletionRequestModelType = "CreateCompletionRequest_2"
)

type CreateCompletionRequestStop

type CreateCompletionRequestStop struct {
	Str        *string
	ArrayOfstr []string

	Type CreateCompletionRequestStopType
}

CreateCompletionRequestStop - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.

func CreateCreateCompletionRequestStopArrayOfstr

func CreateCreateCompletionRequestStopArrayOfstr(arrayOfstr []string) CreateCompletionRequestStop

func CreateCreateCompletionRequestStopStr

func CreateCreateCompletionRequestStopStr(str string) CreateCompletionRequestStop

func (CreateCompletionRequestStop) MarshalJSON

func (u CreateCompletionRequestStop) MarshalJSON() ([]byte, error)

func (*CreateCompletionRequestStop) UnmarshalJSON

func (u *CreateCompletionRequestStop) UnmarshalJSON(data []byte) error

type CreateCompletionRequestStopType

type CreateCompletionRequestStopType string
const (
	CreateCompletionRequestStopTypeStr        CreateCompletionRequestStopType = "str"
	CreateCompletionRequestStopTypeArrayOfstr CreateCompletionRequestStopType = "arrayOfstr"
)

type CreateCompletionResponse

type CreateCompletionResponse struct {
	// The list of completion choices the model generated for the input prompt.
	Choices []CreateCompletionResponseChoices `json:"choices"`
	// The Unix timestamp (in seconds) of when the completion was created.
	Created int64 `json:"created"`
	// A unique identifier for the completion.
	ID string `json:"id"`
	// The model used for completion.
	Model string `json:"model"`
	// The object type, which is always "text_completion"
	Object CreateCompletionResponseObject `json:"object"`
	// This fingerprint represents the backend configuration that the model runs with.
	//
	// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
	//
	SystemFingerprint *string `json:"system_fingerprint,omitempty"`
	// Usage statistics for the completion request.
	Usage *CompletionUsage `json:"usage,omitempty"`
}

CreateCompletionResponse - Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).

func (*CreateCompletionResponse) GetChoices

func (*CreateCompletionResponse) GetCreated

func (o *CreateCompletionResponse) GetCreated() int64

func (*CreateCompletionResponse) GetID

func (o *CreateCompletionResponse) GetID() string

func (*CreateCompletionResponse) GetModel

func (o *CreateCompletionResponse) GetModel() string

func (*CreateCompletionResponse) GetObject

func (*CreateCompletionResponse) GetSystemFingerprint

func (o *CreateCompletionResponse) GetSystemFingerprint() *string

func (*CreateCompletionResponse) GetUsage

type CreateCompletionResponseChoices

type CreateCompletionResponseChoices struct {
	// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
	// `length` if the maximum number of tokens specified in the request was reached,
	// or `content_filter` if content was omitted due to a flag from our content filters.
	//
	FinishReason CreateCompletionResponseFinishReason `json:"finish_reason"`
	Index        int64                                `json:"index"`
	Logprobs     *CreateCompletionResponseLogprobs    `json:"logprobs"`
	Text         string                               `json:"text"`
}

func (*CreateCompletionResponseChoices) GetFinishReason

func (*CreateCompletionResponseChoices) GetIndex

func (o *CreateCompletionResponseChoices) GetIndex() int64

func (*CreateCompletionResponseChoices) GetLogprobs

func (*CreateCompletionResponseChoices) GetText

type CreateCompletionResponseFinishReason

type CreateCompletionResponseFinishReason string

CreateCompletionResponseFinishReason - The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, or `content_filter` if content was omitted due to a flag from our content filters.

const (
	CreateCompletionResponseFinishReasonStop          CreateCompletionResponseFinishReason = "stop"
	CreateCompletionResponseFinishReasonLength        CreateCompletionResponseFinishReason = "length"
	CreateCompletionResponseFinishReasonContentFilter CreateCompletionResponseFinishReason = "content_filter"
)

func (CreateCompletionResponseFinishReason) ToPointer

func (*CreateCompletionResponseFinishReason) UnmarshalJSON

func (e *CreateCompletionResponseFinishReason) UnmarshalJSON(data []byte) error

type CreateCompletionResponseLogprobs

type CreateCompletionResponseLogprobs struct {
	TextOffset    []int64              `json:"text_offset,omitempty"`
	TokenLogprobs []float64            `json:"token_logprobs,omitempty"`
	Tokens        []string             `json:"tokens,omitempty"`
	TopLogprobs   []map[string]float64 `json:"top_logprobs,omitempty"`
}

func (*CreateCompletionResponseLogprobs) GetTextOffset

func (o *CreateCompletionResponseLogprobs) GetTextOffset() []int64

func (*CreateCompletionResponseLogprobs) GetTokenLogprobs

func (o *CreateCompletionResponseLogprobs) GetTokenLogprobs() []float64

func (*CreateCompletionResponseLogprobs) GetTokens

func (o *CreateCompletionResponseLogprobs) GetTokens() []string

func (*CreateCompletionResponseLogprobs) GetTopLogprobs

func (o *CreateCompletionResponseLogprobs) GetTopLogprobs() []map[string]float64

type CreateCompletionResponseObject

type CreateCompletionResponseObject string

CreateCompletionResponseObject - The object type, which is always "text_completion"

const (
	CreateCompletionResponseObjectTextCompletion CreateCompletionResponseObject = "text_completion"
)

func (CreateCompletionResponseObject) ToPointer

func (*CreateCompletionResponseObject) UnmarshalJSON

func (e *CreateCompletionResponseObject) UnmarshalJSON(data []byte) error

type CreateEmbeddingRequest

type CreateEmbeddingRequest struct {
	// The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
	//
	Dimensions *int64 `json:"dimensions,omitempty"`
	// The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).
	EncodingFormat *EncodingFormat `default:"float" json:"encoding_format"`
	// Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.
	//
	Input Input `json:"input"`
	// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
	//
	Model CreateEmbeddingRequestModel `json:"model"`
	// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
	//
	User *string `json:"user,omitempty"`
}

func (*CreateEmbeddingRequest) GetDimensions

func (o *CreateEmbeddingRequest) GetDimensions() *int64

func (*CreateEmbeddingRequest) GetEncodingFormat

func (o *CreateEmbeddingRequest) GetEncodingFormat() *EncodingFormat

func (*CreateEmbeddingRequest) GetInput

func (o *CreateEmbeddingRequest) GetInput() Input

func (*CreateEmbeddingRequest) GetModel

func (*CreateEmbeddingRequest) GetUser

func (o *CreateEmbeddingRequest) GetUser() *string

func (CreateEmbeddingRequest) MarshalJSON

func (c CreateEmbeddingRequest) MarshalJSON() ([]byte, error)

func (*CreateEmbeddingRequest) UnmarshalJSON

func (c *CreateEmbeddingRequest) UnmarshalJSON(data []byte) error

type CreateEmbeddingRequest2

type CreateEmbeddingRequest2 string
const (
	CreateEmbeddingRequest2TextEmbeddingAda002 CreateEmbeddingRequest2 = "text-embedding-ada-002"
	CreateEmbeddingRequest2TextEmbedding3Small CreateEmbeddingRequest2 = "text-embedding-3-small"
	CreateEmbeddingRequest2TextEmbedding3Large CreateEmbeddingRequest2 = "text-embedding-3-large"
)

func (CreateEmbeddingRequest2) ToPointer

func (*CreateEmbeddingRequest2) UnmarshalJSON

func (e *CreateEmbeddingRequest2) UnmarshalJSON(data []byte) error

type CreateEmbeddingRequestModel

type CreateEmbeddingRequestModel struct {
	Str                     *string
	CreateEmbeddingRequest2 *CreateEmbeddingRequest2

	Type CreateEmbeddingRequestModelType
}

CreateEmbeddingRequestModel - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.

func CreateCreateEmbeddingRequestModelCreateEmbeddingRequest2

func CreateCreateEmbeddingRequestModelCreateEmbeddingRequest2(createEmbeddingRequest2 CreateEmbeddingRequest2) CreateEmbeddingRequestModel

func CreateCreateEmbeddingRequestModelStr

func CreateCreateEmbeddingRequestModelStr(str string) CreateEmbeddingRequestModel

func (CreateEmbeddingRequestModel) MarshalJSON

func (u CreateEmbeddingRequestModel) MarshalJSON() ([]byte, error)

func (*CreateEmbeddingRequestModel) UnmarshalJSON

func (u *CreateEmbeddingRequestModel) UnmarshalJSON(data []byte) error

type CreateEmbeddingRequestModelType

type CreateEmbeddingRequestModelType string
const (
	CreateEmbeddingRequestModelTypeStr                     CreateEmbeddingRequestModelType = "str"
	CreateEmbeddingRequestModelTypeCreateEmbeddingRequest2 CreateEmbeddingRequestModelType = "CreateEmbeddingRequest_2"
)

type CreateEmbeddingResponse

type CreateEmbeddingResponse struct {
	// The list of embeddings generated by the model.
	Data []Embedding `json:"data"`
	// The name of the model used to generate the embedding.
	Model string `json:"model"`
	// The object type, which is always "list".
	Object CreateEmbeddingResponseObject `json:"object"`
	// The usage information for the request.
	Usage Usage `json:"usage"`
}

func (*CreateEmbeddingResponse) GetData

func (o *CreateEmbeddingResponse) GetData() []Embedding

func (*CreateEmbeddingResponse) GetModel

func (o *CreateEmbeddingResponse) GetModel() string

func (*CreateEmbeddingResponse) GetObject

func (*CreateEmbeddingResponse) GetUsage

func (o *CreateEmbeddingResponse) GetUsage() Usage

type CreateEmbeddingResponseObject

type CreateEmbeddingResponseObject string

CreateEmbeddingResponseObject - The object type, which is always "list".

const (
	CreateEmbeddingResponseObjectList CreateEmbeddingResponseObject = "list"
)

func (CreateEmbeddingResponseObject) ToPointer

func (*CreateEmbeddingResponseObject) UnmarshalJSON

func (e *CreateEmbeddingResponseObject) UnmarshalJSON(data []byte) error

type CreateFileRequest

type CreateFileRequest struct {
	// The File object (not file name) to be uploaded.
	//
	File File `multipartForm:"file"`
	// The intended purpose of the uploaded file.
	//
	// Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning) and "assistants" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning.
	//
	Purpose Purpose `multipartForm:"name=purpose"`
}

func (*CreateFileRequest) GetFile

func (o *CreateFileRequest) GetFile() File

func (*CreateFileRequest) GetPurpose

func (o *CreateFileRequest) GetPurpose() Purpose

type CreateFineTuningJobRequest

type CreateFineTuningJobRequest struct {
	// The hyperparameters used for the fine-tuning job.
	Hyperparameters *Hyperparameters `json:"hyperparameters,omitempty"`
	// The name of the model to fine-tune. You can select one of the
	// [supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
	//
	Model CreateFineTuningJobRequestModel `json:"model"`
	// A string of up to 18 characters that will be added to your fine-tuned model name.
	//
	// For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.
	//
	Suffix *string `default:"null" json:"suffix"`
	// The ID of an uploaded file that contains training data.
	//
	// See [upload file](/docs/api-reference/files/upload) for how to upload a file.
	//
	// Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.
	//
	// See the [fine-tuning guide](/docs/guides/fine-tuning) for more details.
	//
	TrainingFile string `json:"training_file"`
	// The ID of an uploaded file that contains validation data.
	//
	// If you provide this file, the data is used to generate validation
	// metrics periodically during fine-tuning. These metrics can be viewed in
	// the fine-tuning results file.
	// The same data should not be present in both train and validation files.
	//
	// Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.
	//
	// See the [fine-tuning guide](/docs/guides/fine-tuning) for more details.
	//
	ValidationFile *string `json:"validation_file,omitempty"`
}

func (*CreateFineTuningJobRequest) GetHyperparameters

func (o *CreateFineTuningJobRequest) GetHyperparameters() *Hyperparameters

func (*CreateFineTuningJobRequest) GetModel

func (*CreateFineTuningJobRequest) GetSuffix

func (o *CreateFineTuningJobRequest) GetSuffix() *string

func (*CreateFineTuningJobRequest) GetTrainingFile

func (o *CreateFineTuningJobRequest) GetTrainingFile() string

func (*CreateFineTuningJobRequest) GetValidationFile

func (o *CreateFineTuningJobRequest) GetValidationFile() *string

func (CreateFineTuningJobRequest) MarshalJSON

func (c CreateFineTuningJobRequest) MarshalJSON() ([]byte, error)

func (*CreateFineTuningJobRequest) UnmarshalJSON

func (c *CreateFineTuningJobRequest) UnmarshalJSON(data []byte) error

type CreateFineTuningJobRequest1

type CreateFineTuningJobRequest1 string
const (
	CreateFineTuningJobRequest1Auto CreateFineTuningJobRequest1 = "auto"
)

func (CreateFineTuningJobRequest1) ToPointer

func (*CreateFineTuningJobRequest1) UnmarshalJSON

func (e *CreateFineTuningJobRequest1) UnmarshalJSON(data []byte) error

type CreateFineTuningJobRequest2

type CreateFineTuningJobRequest2 string
const (
	CreateFineTuningJobRequest2Babbage002 CreateFineTuningJobRequest2 = "babbage-002"
	CreateFineTuningJobRequest2Davinci002 CreateFineTuningJobRequest2 = "davinci-002"
	CreateFineTuningJobRequest2Gpt35Turbo CreateFineTuningJobRequest2 = "gpt-3.5-turbo"
)

func (CreateFineTuningJobRequest2) ToPointer

func (*CreateFineTuningJobRequest2) UnmarshalJSON

func (e *CreateFineTuningJobRequest2) UnmarshalJSON(data []byte) error

type CreateFineTuningJobRequestModel

type CreateFineTuningJobRequestModel struct {
	Str                         *string
	CreateFineTuningJobRequest2 *CreateFineTuningJobRequest2

	Type CreateFineTuningJobRequestModelType
}

CreateFineTuningJobRequestModel - The name of the model to fine-tune. You can select one of the [supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned).

func CreateCreateFineTuningJobRequestModelCreateFineTuningJobRequest2

func CreateCreateFineTuningJobRequestModelCreateFineTuningJobRequest2(createFineTuningJobRequest2 CreateFineTuningJobRequest2) CreateFineTuningJobRequestModel

func CreateCreateFineTuningJobRequestModelStr

func CreateCreateFineTuningJobRequestModelStr(str string) CreateFineTuningJobRequestModel

func (CreateFineTuningJobRequestModel) MarshalJSON

func (u CreateFineTuningJobRequestModel) MarshalJSON() ([]byte, error)

func (*CreateFineTuningJobRequestModel) UnmarshalJSON

func (u *CreateFineTuningJobRequestModel) UnmarshalJSON(data []byte) error

type CreateFineTuningJobRequestModelType

type CreateFineTuningJobRequestModelType string
const (
	CreateFineTuningJobRequestModelTypeStr                         CreateFineTuningJobRequestModelType = "str"
	CreateFineTuningJobRequestModelTypeCreateFineTuningJobRequest2 CreateFineTuningJobRequestModelType = "CreateFineTuningJobRequest_2"
)

type CreateFineTuningJobRequestSchemas1

type CreateFineTuningJobRequestSchemas1 string
const (
	CreateFineTuningJobRequestSchemas1Auto CreateFineTuningJobRequestSchemas1 = "auto"
)

func (CreateFineTuningJobRequestSchemas1) ToPointer

func (*CreateFineTuningJobRequestSchemas1) UnmarshalJSON

func (e *CreateFineTuningJobRequestSchemas1) UnmarshalJSON(data []byte) error

type CreateFineTuningJobRequestSchemasHyperparameters1

type CreateFineTuningJobRequestSchemasHyperparameters1 string
const (
	CreateFineTuningJobRequestSchemasHyperparameters1Auto CreateFineTuningJobRequestSchemasHyperparameters1 = "auto"
)

func (CreateFineTuningJobRequestSchemasHyperparameters1) ToPointer

func (*CreateFineTuningJobRequestSchemasHyperparameters1) UnmarshalJSON

type CreateImageEditRequest

type CreateImageEditRequest struct {
	// The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
	Image CreateImageEditRequestImage `multipartForm:"file"`
	// An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
	Mask *Mask `multipartForm:"file"`
	// The model to use for image generation. Only `dall-e-2` is supported at this time.
	Model *CreateImageEditRequestModel `multipartForm:"name=model"`
	// The number of images to generate. Must be between 1 and 10.
	N *int64 `default:"1" multipartForm:"name=n"`
	// A text description of the desired image(s). The maximum length is 1000 characters.
	Prompt string `multipartForm:"name=prompt"`
	// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
	ResponseFormat *CreateImageEditRequestResponseFormat `default:"url" multipartForm:"name=response_format"`
	// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
	Size *Size `default:"1024x1024" multipartForm:"name=size"`
	// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
	//
	User *string `multipartForm:"name=user"`
}

func (*CreateImageEditRequest) GetImage

func (*CreateImageEditRequest) GetMask

func (o *CreateImageEditRequest) GetMask() *Mask

func (*CreateImageEditRequest) GetModel

func (*CreateImageEditRequest) GetN

func (o *CreateImageEditRequest) GetN() *int64

func (*CreateImageEditRequest) GetPrompt

func (o *CreateImageEditRequest) GetPrompt() string

func (*CreateImageEditRequest) GetResponseFormat

func (*CreateImageEditRequest) GetSize

func (o *CreateImageEditRequest) GetSize() *Size

func (*CreateImageEditRequest) GetUser

func (o *CreateImageEditRequest) GetUser() *string

func (CreateImageEditRequest) MarshalJSON

func (c CreateImageEditRequest) MarshalJSON() ([]byte, error)

func (*CreateImageEditRequest) UnmarshalJSON

func (c *CreateImageEditRequest) UnmarshalJSON(data []byte) error

type CreateImageEditRequest2

type CreateImageEditRequest2 string
const (
	CreateImageEditRequest2DallE2 CreateImageEditRequest2 = "dall-e-2"
)

func (CreateImageEditRequest2) ToPointer

func (*CreateImageEditRequest2) UnmarshalJSON

func (e *CreateImageEditRequest2) UnmarshalJSON(data []byte) error

type CreateImageEditRequestImage

type CreateImageEditRequestImage struct {
	Content  []byte `multipartForm:"content"`
	FileName string `multipartForm:"name=image"`
}

func (*CreateImageEditRequestImage) GetContent

func (o *CreateImageEditRequestImage) GetContent() []byte

func (*CreateImageEditRequestImage) GetFileName

func (o *CreateImageEditRequestImage) GetFileName() string

type CreateImageEditRequestModel

type CreateImageEditRequestModel struct {
	Str                     *string
	CreateImageEditRequest2 *CreateImageEditRequest2

	Type CreateImageEditRequestModelType
}

CreateImageEditRequestModel - The model to use for image generation. Only `dall-e-2` is supported at this time.

func CreateCreateImageEditRequestModelCreateImageEditRequest2

func CreateCreateImageEditRequestModelCreateImageEditRequest2(createImageEditRequest2 CreateImageEditRequest2) CreateImageEditRequestModel

func CreateCreateImageEditRequestModelStr

func CreateCreateImageEditRequestModelStr(str string) CreateImageEditRequestModel

func (CreateImageEditRequestModel) MarshalJSON

func (u CreateImageEditRequestModel) MarshalJSON() ([]byte, error)

func (*CreateImageEditRequestModel) UnmarshalJSON

func (u *CreateImageEditRequestModel) UnmarshalJSON(data []byte) error

type CreateImageEditRequestModelType

type CreateImageEditRequestModelType string
const (
	CreateImageEditRequestModelTypeStr                     CreateImageEditRequestModelType = "str"
	CreateImageEditRequestModelTypeCreateImageEditRequest2 CreateImageEditRequestModelType = "CreateImageEditRequest_2"
)

type CreateImageEditRequestResponseFormat

type CreateImageEditRequestResponseFormat string

CreateImageEditRequestResponseFormat - The format in which the generated images are returned. Must be one of `url` or `b64_json`.

const (
	CreateImageEditRequestResponseFormatURL     CreateImageEditRequestResponseFormat = "url"
	CreateImageEditRequestResponseFormatB64JSON CreateImageEditRequestResponseFormat = "b64_json"
)

func (CreateImageEditRequestResponseFormat) ToPointer

func (*CreateImageEditRequestResponseFormat) UnmarshalJSON

func (e *CreateImageEditRequestResponseFormat) UnmarshalJSON(data []byte) error

type CreateImageRequest

type CreateImageRequest struct {
	// The model to use for image generation.
	Model *CreateImageRequestModel `json:"model,omitempty"`
	// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
	N *int64 `default:"1" json:"n"`
	// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
	Prompt string `json:"prompt"`
	// The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.
	Quality *Quality `default:"standard" json:"quality"`
	// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
	ResponseFormat *CreateImageRequestResponseFormat `default:"url" json:"response_format"`
	// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.
	Size *CreateImageRequestSize `default:"1024x1024" json:"size"`
	// The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.
	Style *Style `default:"vivid" json:"style"`
	// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
	//
	User *string `json:"user,omitempty"`
}

func (*CreateImageRequest) GetModel

func (*CreateImageRequest) GetN

func (o *CreateImageRequest) GetN() *int64

func (*CreateImageRequest) GetPrompt

func (o *CreateImageRequest) GetPrompt() string

func (*CreateImageRequest) GetQuality

func (o *CreateImageRequest) GetQuality() *Quality

func (*CreateImageRequest) GetResponseFormat

func (o *CreateImageRequest) GetResponseFormat() *CreateImageRequestResponseFormat

func (*CreateImageRequest) GetSize

func (*CreateImageRequest) GetStyle

func (o *CreateImageRequest) GetStyle() *Style

func (*CreateImageRequest) GetUser

func (o *CreateImageRequest) GetUser() *string

func (CreateImageRequest) MarshalJSON

func (c CreateImageRequest) MarshalJSON() ([]byte, error)

func (*CreateImageRequest) UnmarshalJSON

func (c *CreateImageRequest) UnmarshalJSON(data []byte) error

type CreateImageRequest2

type CreateImageRequest2 string
const (
	CreateImageRequest2DallE2 CreateImageRequest2 = "dall-e-2"
	CreateImageRequest2DallE3 CreateImageRequest2 = "dall-e-3"
)

func (CreateImageRequest2) ToPointer

func (*CreateImageRequest2) UnmarshalJSON

func (e *CreateImageRequest2) UnmarshalJSON(data []byte) error

type CreateImageRequestModel

type CreateImageRequestModel struct {
	Str                 *string
	CreateImageRequest2 *CreateImageRequest2

	Type CreateImageRequestModelType
}

CreateImageRequestModel - The model to use for image generation.

func CreateCreateImageRequestModelCreateImageRequest2

func CreateCreateImageRequestModelCreateImageRequest2(createImageRequest2 CreateImageRequest2) CreateImageRequestModel

func CreateCreateImageRequestModelStr

func CreateCreateImageRequestModelStr(str string) CreateImageRequestModel

func (CreateImageRequestModel) MarshalJSON

func (u CreateImageRequestModel) MarshalJSON() ([]byte, error)

func (*CreateImageRequestModel) UnmarshalJSON

func (u *CreateImageRequestModel) UnmarshalJSON(data []byte) error

type CreateImageRequestModelType

type CreateImageRequestModelType string
const (
	CreateImageRequestModelTypeStr                 CreateImageRequestModelType = "str"
	CreateImageRequestModelTypeCreateImageRequest2 CreateImageRequestModelType = "CreateImageRequest_2"
)

type CreateImageRequestResponseFormat

type CreateImageRequestResponseFormat string

CreateImageRequestResponseFormat - The format in which the generated images are returned. Must be one of `url` or `b64_json`.

const (
	CreateImageRequestResponseFormatURL     CreateImageRequestResponseFormat = "url"
	CreateImageRequestResponseFormatB64JSON CreateImageRequestResponseFormat = "b64_json"
)

func (CreateImageRequestResponseFormat) ToPointer

func (*CreateImageRequestResponseFormat) UnmarshalJSON

func (e *CreateImageRequestResponseFormat) UnmarshalJSON(data []byte) error

type CreateImageRequestSize

type CreateImageRequestSize string

CreateImageRequestSize - The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.

const (
	CreateImageRequestSizeTwoHundredAndFiftySixx256                CreateImageRequestSize = "256x256"
	CreateImageRequestSizeFiveHundredAndTwelvex512                 CreateImageRequestSize = "512x512"
	CreateImageRequestSizeOneThousandAndTwentyFourx1024            CreateImageRequestSize = "1024x1024"
	CreateImageRequestSizeOneThousandSevenHundredAndNinetyTwox1024 CreateImageRequestSize = "1792x1024"
	CreateImageRequestSizeOneThousandAndTwentyFourx1792            CreateImageRequestSize = "1024x1792"
)

func (CreateImageRequestSize) ToPointer

func (*CreateImageRequestSize) UnmarshalJSON

func (e *CreateImageRequestSize) UnmarshalJSON(data []byte) error

type CreateImageVariationRequest

type CreateImageVariationRequest struct {
	// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
	Image CreateImageVariationRequestImage `multipartForm:"file"`
	// The model to use for image generation. Only `dall-e-2` is supported at this time.
	Model *CreateImageVariationRequestModel `multipartForm:"name=model"`
	// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
	N *int64 `default:"1" multipartForm:"name=n"`
	// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
	ResponseFormat *CreateImageVariationRequestResponseFormat `default:"url" multipartForm:"name=response_format"`
	// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
	Size *CreateImageVariationRequestSize `default:"1024x1024" multipartForm:"name=size"`
	// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
	//
	User *string `multipartForm:"name=user"`
}

func (*CreateImageVariationRequest) GetImage

func (*CreateImageVariationRequest) GetModel

func (*CreateImageVariationRequest) GetN

func (*CreateImageVariationRequest) GetResponseFormat

func (*CreateImageVariationRequest) GetSize

func (*CreateImageVariationRequest) GetUser

func (o *CreateImageVariationRequest) GetUser() *string

func (CreateImageVariationRequest) MarshalJSON

func (c CreateImageVariationRequest) MarshalJSON() ([]byte, error)

func (*CreateImageVariationRequest) UnmarshalJSON

func (c *CreateImageVariationRequest) UnmarshalJSON(data []byte) error

type CreateImageVariationRequest2

type CreateImageVariationRequest2 string
const (
	CreateImageVariationRequest2DallE2 CreateImageVariationRequest2 = "dall-e-2"
)

func (CreateImageVariationRequest2) ToPointer

func (*CreateImageVariationRequest2) UnmarshalJSON

func (e *CreateImageVariationRequest2) UnmarshalJSON(data []byte) error

type CreateImageVariationRequestImage

type CreateImageVariationRequestImage struct {
	Content  []byte `multipartForm:"content"`
	FileName string `multipartForm:"name=image"`
}

func (*CreateImageVariationRequestImage) GetContent

func (o *CreateImageVariationRequestImage) GetContent() []byte

func (*CreateImageVariationRequestImage) GetFileName

func (o *CreateImageVariationRequestImage) GetFileName() string

type CreateImageVariationRequestModel

type CreateImageVariationRequestModel struct {
	Str                          *string
	CreateImageVariationRequest2 *CreateImageVariationRequest2

	Type CreateImageVariationRequestModelType
}

CreateImageVariationRequestModel - The model to use for image generation. Only `dall-e-2` is supported at this time.

func CreateCreateImageVariationRequestModelCreateImageVariationRequest2

func CreateCreateImageVariationRequestModelCreateImageVariationRequest2(createImageVariationRequest2 CreateImageVariationRequest2) CreateImageVariationRequestModel

func CreateCreateImageVariationRequestModelStr

func CreateCreateImageVariationRequestModelStr(str string) CreateImageVariationRequestModel

func (CreateImageVariationRequestModel) MarshalJSON

func (u CreateImageVariationRequestModel) MarshalJSON() ([]byte, error)

func (*CreateImageVariationRequestModel) UnmarshalJSON

func (u *CreateImageVariationRequestModel) UnmarshalJSON(data []byte) error

type CreateImageVariationRequestModelType

type CreateImageVariationRequestModelType string
const (
	CreateImageVariationRequestModelTypeStr                          CreateImageVariationRequestModelType = "str"
	CreateImageVariationRequestModelTypeCreateImageVariationRequest2 CreateImageVariationRequestModelType = "CreateImageVariationRequest_2"
)

type CreateImageVariationRequestResponseFormat

type CreateImageVariationRequestResponseFormat string

CreateImageVariationRequestResponseFormat - The format in which the generated images are returned. Must be one of `url` or `b64_json`.

const (
	CreateImageVariationRequestResponseFormatURL     CreateImageVariationRequestResponseFormat = "url"
	CreateImageVariationRequestResponseFormatB64JSON CreateImageVariationRequestResponseFormat = "b64_json"
)

func (CreateImageVariationRequestResponseFormat) ToPointer

func (*CreateImageVariationRequestResponseFormat) UnmarshalJSON

func (e *CreateImageVariationRequestResponseFormat) UnmarshalJSON(data []byte) error

type CreateImageVariationRequestSize

type CreateImageVariationRequestSize string

CreateImageVariationRequestSize - The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.

const (
	CreateImageVariationRequestSizeTwoHundredAndFiftySixx256     CreateImageVariationRequestSize = "256x256"
	CreateImageVariationRequestSizeFiveHundredAndTwelvex512      CreateImageVariationRequestSize = "512x512"
	CreateImageVariationRequestSizeOneThousandAndTwentyFourx1024 CreateImageVariationRequestSize = "1024x1024"
)

func (CreateImageVariationRequestSize) ToPointer

func (*CreateImageVariationRequestSize) UnmarshalJSON

func (e *CreateImageVariationRequestSize) UnmarshalJSON(data []byte) error

type CreateMessageRequest

type CreateMessageRequest struct {
	// The content of the message.
	Content string `json:"content"`
	// A list of [File](/docs/api-reference/files) IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like `retrieval` and `code_interpreter` that can access and use files.
	FileIds []string `json:"file_ids,omitempty"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *CreateMessageRequestMetadata `json:"metadata,omitempty"`
	// The role of the entity that is creating the message. Currently only `user` is supported.
	Role CreateMessageRequestRole `json:"role"`
}

func (*CreateMessageRequest) GetContent

func (o *CreateMessageRequest) GetContent() string

func (*CreateMessageRequest) GetFileIds

func (o *CreateMessageRequest) GetFileIds() []string

func (*CreateMessageRequest) GetMetadata

func (*CreateMessageRequest) GetRole

type CreateMessageRequestMetadata

type CreateMessageRequestMetadata struct {
}

CreateMessageRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type CreateMessageRequestRole

type CreateMessageRequestRole string

CreateMessageRequestRole - The role of the entity that is creating the message. Currently only `user` is supported.

const (
	CreateMessageRequestRoleUser CreateMessageRequestRole = "user"
)

func (CreateMessageRequestRole) ToPointer

func (*CreateMessageRequestRole) UnmarshalJSON

func (e *CreateMessageRequestRole) UnmarshalJSON(data []byte) error

type CreateModerationRequest

type CreateModerationRequest struct {
	// The input text to classify
	Input CreateModerationRequestInput `json:"input"`
	// Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`.
	//
	// The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.
	//
	Model *CreateModerationRequestModel `json:"model,omitempty"`
}

func (*CreateModerationRequest) GetInput

func (*CreateModerationRequest) GetModel

type CreateModerationRequest2

type CreateModerationRequest2 string
const (
	CreateModerationRequest2TextModerationLatest CreateModerationRequest2 = "text-moderation-latest"
	CreateModerationRequest2TextModerationStable CreateModerationRequest2 = "text-moderation-stable"
)

func (CreateModerationRequest2) ToPointer

func (*CreateModerationRequest2) UnmarshalJSON

func (e *CreateModerationRequest2) UnmarshalJSON(data []byte) error

type CreateModerationRequestInput

type CreateModerationRequestInput struct {
	Str        *string
	ArrayOfstr []string

	Type CreateModerationRequestInputType
}

CreateModerationRequestInput - The input text to classify

func CreateCreateModerationRequestInputArrayOfstr

func CreateCreateModerationRequestInputArrayOfstr(arrayOfstr []string) CreateModerationRequestInput

func CreateCreateModerationRequestInputStr

func CreateCreateModerationRequestInputStr(str string) CreateModerationRequestInput

func (CreateModerationRequestInput) MarshalJSON

func (u CreateModerationRequestInput) MarshalJSON() ([]byte, error)

func (*CreateModerationRequestInput) UnmarshalJSON

func (u *CreateModerationRequestInput) UnmarshalJSON(data []byte) error

type CreateModerationRequestInputType

type CreateModerationRequestInputType string
const (
	CreateModerationRequestInputTypeStr        CreateModerationRequestInputType = "str"
	CreateModerationRequestInputTypeArrayOfstr CreateModerationRequestInputType = "arrayOfstr"
)

type CreateModerationRequestModel

type CreateModerationRequestModel struct {
	Str                      *string
	CreateModerationRequest2 *CreateModerationRequest2

	Type CreateModerationRequestModelType
}

CreateModerationRequestModel - Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`.

The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.

func CreateCreateModerationRequestModelCreateModerationRequest2

func CreateCreateModerationRequestModelCreateModerationRequest2(createModerationRequest2 CreateModerationRequest2) CreateModerationRequestModel

func CreateCreateModerationRequestModelStr

func CreateCreateModerationRequestModelStr(str string) CreateModerationRequestModel

func (CreateModerationRequestModel) MarshalJSON

func (u CreateModerationRequestModel) MarshalJSON() ([]byte, error)

func (*CreateModerationRequestModel) UnmarshalJSON

func (u *CreateModerationRequestModel) UnmarshalJSON(data []byte) error

type CreateModerationRequestModelType

type CreateModerationRequestModelType string
const (
	CreateModerationRequestModelTypeStr                      CreateModerationRequestModelType = "str"
	CreateModerationRequestModelTypeCreateModerationRequest2 CreateModerationRequestModelType = "CreateModerationRequest_2"
)

type CreateModerationResponse

type CreateModerationResponse struct {
	// The unique identifier for the moderation request.
	ID string `json:"id"`
	// The model used to generate the moderation results.
	Model string `json:"model"`
	// A list of moderation objects.
	Results []Results `json:"results"`
}

CreateModerationResponse - Represents policy compliance report by OpenAI's content moderation model against a given input.

func (*CreateModerationResponse) GetID

func (o *CreateModerationResponse) GetID() string

func (*CreateModerationResponse) GetModel

func (o *CreateModerationResponse) GetModel() string

func (*CreateModerationResponse) GetResults

func (o *CreateModerationResponse) GetResults() []Results

type CreateRunRequest

type CreateRunRequest struct {
	// Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
	AdditionalInstructions *string `json:"additional_instructions,omitempty"`
	// The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
	AssistantID string `json:"assistant_id"`
	// Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
	Instructions *string `json:"instructions,omitempty"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *CreateRunRequestMetadata `json:"metadata,omitempty"`
	// The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
	Model *string `json:"model,omitempty"`
	// Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
	Tools []CreateRunRequestTools `json:"tools,omitempty"`
}

func (*CreateRunRequest) GetAdditionalInstructions

func (o *CreateRunRequest) GetAdditionalInstructions() *string

func (*CreateRunRequest) GetAssistantID

func (o *CreateRunRequest) GetAssistantID() string

func (*CreateRunRequest) GetInstructions

func (o *CreateRunRequest) GetInstructions() *string

func (*CreateRunRequest) GetMetadata

func (o *CreateRunRequest) GetMetadata() *CreateRunRequestMetadata

func (*CreateRunRequest) GetModel

func (o *CreateRunRequest) GetModel() *string

func (*CreateRunRequest) GetTools

func (o *CreateRunRequest) GetTools() []CreateRunRequestTools

type CreateRunRequestMetadata

type CreateRunRequestMetadata struct {
}

CreateRunRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type CreateRunRequestTools

type CreateRunRequestTools struct {
	AssistantToolsCode      *AssistantToolsCode
	AssistantToolsRetrieval *AssistantToolsRetrieval
	AssistantToolsFunction  *AssistantToolsFunction

	Type CreateRunRequestToolsType
}

func CreateCreateRunRequestToolsAssistantToolsCode

func CreateCreateRunRequestToolsAssistantToolsCode(assistantToolsCode AssistantToolsCode) CreateRunRequestTools

func CreateCreateRunRequestToolsAssistantToolsFunction

func CreateCreateRunRequestToolsAssistantToolsFunction(assistantToolsFunction AssistantToolsFunction) CreateRunRequestTools

func CreateCreateRunRequestToolsAssistantToolsRetrieval

func CreateCreateRunRequestToolsAssistantToolsRetrieval(assistantToolsRetrieval AssistantToolsRetrieval) CreateRunRequestTools

func (CreateRunRequestTools) MarshalJSON

func (u CreateRunRequestTools) MarshalJSON() ([]byte, error)

func (*CreateRunRequestTools) UnmarshalJSON

func (u *CreateRunRequestTools) UnmarshalJSON(data []byte) error

type CreateRunRequestToolsType

type CreateRunRequestToolsType string
const (
	CreateRunRequestToolsTypeAssistantToolsCode      CreateRunRequestToolsType = "AssistantToolsCode"
	CreateRunRequestToolsTypeAssistantToolsRetrieval CreateRunRequestToolsType = "AssistantToolsRetrieval"
	CreateRunRequestToolsTypeAssistantToolsFunction  CreateRunRequestToolsType = "AssistantToolsFunction"
)

type CreateSpeechRequest

type CreateSpeechRequest struct {
	// The text to generate audio for. The maximum length is 4096 characters.
	Input string `json:"input"`
	// One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd`
	//
	Model CreateSpeechRequestModel `json:"model"`
	// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`.
	ResponseFormat *CreateSpeechRequestResponseFormat `default:"mp3" json:"response_format"`
	// The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
	Speed *float64 `default:"1" json:"speed"`
	// The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech/voice-options).
	Voice Voice `json:"voice"`
}

func (*CreateSpeechRequest) GetInput

func (o *CreateSpeechRequest) GetInput() string

func (*CreateSpeechRequest) GetModel

func (*CreateSpeechRequest) GetResponseFormat

func (*CreateSpeechRequest) GetSpeed

func (o *CreateSpeechRequest) GetSpeed() *float64

func (*CreateSpeechRequest) GetVoice

func (o *CreateSpeechRequest) GetVoice() Voice

func (CreateSpeechRequest) MarshalJSON

func (c CreateSpeechRequest) MarshalJSON() ([]byte, error)

func (*CreateSpeechRequest) UnmarshalJSON

func (c *CreateSpeechRequest) UnmarshalJSON(data []byte) error

type CreateSpeechRequest2

type CreateSpeechRequest2 string
const (
	CreateSpeechRequest2Tts1   CreateSpeechRequest2 = "tts-1"
	CreateSpeechRequest2Tts1Hd CreateSpeechRequest2 = "tts-1-hd"
)

func (CreateSpeechRequest2) ToPointer

func (*CreateSpeechRequest2) UnmarshalJSON

func (e *CreateSpeechRequest2) UnmarshalJSON(data []byte) error

type CreateSpeechRequestModel

type CreateSpeechRequestModel struct {
	Str                  *string
	CreateSpeechRequest2 *CreateSpeechRequest2

	Type CreateSpeechRequestModelType
}

CreateSpeechRequestModel - One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd`

func CreateCreateSpeechRequestModelCreateSpeechRequest2

func CreateCreateSpeechRequestModelCreateSpeechRequest2(createSpeechRequest2 CreateSpeechRequest2) CreateSpeechRequestModel

func CreateCreateSpeechRequestModelStr

func CreateCreateSpeechRequestModelStr(str string) CreateSpeechRequestModel

func (CreateSpeechRequestModel) MarshalJSON

func (u CreateSpeechRequestModel) MarshalJSON() ([]byte, error)

func (*CreateSpeechRequestModel) UnmarshalJSON

func (u *CreateSpeechRequestModel) UnmarshalJSON(data []byte) error

type CreateSpeechRequestModelType

type CreateSpeechRequestModelType string
const (
	CreateSpeechRequestModelTypeStr                  CreateSpeechRequestModelType = "str"
	CreateSpeechRequestModelTypeCreateSpeechRequest2 CreateSpeechRequestModelType = "CreateSpeechRequest_2"
)

type CreateSpeechRequestResponseFormat

type CreateSpeechRequestResponseFormat string

CreateSpeechRequestResponseFormat - The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`.

const (
	CreateSpeechRequestResponseFormatMp3  CreateSpeechRequestResponseFormat = "mp3"
	CreateSpeechRequestResponseFormatOpus CreateSpeechRequestResponseFormat = "opus"
	CreateSpeechRequestResponseFormatAac  CreateSpeechRequestResponseFormat = "aac"
	CreateSpeechRequestResponseFormatFlac CreateSpeechRequestResponseFormat = "flac"
)

func (CreateSpeechRequestResponseFormat) ToPointer

func (*CreateSpeechRequestResponseFormat) UnmarshalJSON

func (e *CreateSpeechRequestResponseFormat) UnmarshalJSON(data []byte) error

type CreateThreadAndRunRequest

type CreateThreadAndRunRequest struct {
	// The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
	AssistantID string `json:"assistant_id"`
	// Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
	Instructions *string `json:"instructions,omitempty"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *CreateThreadAndRunRequestMetadata `json:"metadata,omitempty"`
	// The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
	Model  *string              `json:"model,omitempty"`
	Thread *CreateThreadRequest `json:"thread,omitempty"`
	// Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
	Tools []CreateThreadAndRunRequestTools `json:"tools,omitempty"`
}

func (*CreateThreadAndRunRequest) GetAssistantID

func (o *CreateThreadAndRunRequest) GetAssistantID() string

func (*CreateThreadAndRunRequest) GetInstructions

func (o *CreateThreadAndRunRequest) GetInstructions() *string

func (*CreateThreadAndRunRequest) GetMetadata

func (*CreateThreadAndRunRequest) GetModel

func (o *CreateThreadAndRunRequest) GetModel() *string

func (*CreateThreadAndRunRequest) GetThread

func (*CreateThreadAndRunRequest) GetTools

type CreateThreadAndRunRequestMetadata

type CreateThreadAndRunRequestMetadata struct {
}

CreateThreadAndRunRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type CreateThreadAndRunRequestTools

type CreateThreadAndRunRequestTools struct {
	AssistantToolsCode      *AssistantToolsCode
	AssistantToolsRetrieval *AssistantToolsRetrieval
	AssistantToolsFunction  *AssistantToolsFunction

	Type CreateThreadAndRunRequestToolsType
}

func CreateCreateThreadAndRunRequestToolsAssistantToolsCode

func CreateCreateThreadAndRunRequestToolsAssistantToolsCode(assistantToolsCode AssistantToolsCode) CreateThreadAndRunRequestTools

func CreateCreateThreadAndRunRequestToolsAssistantToolsFunction

func CreateCreateThreadAndRunRequestToolsAssistantToolsFunction(assistantToolsFunction AssistantToolsFunction) CreateThreadAndRunRequestTools

func CreateCreateThreadAndRunRequestToolsAssistantToolsRetrieval

func CreateCreateThreadAndRunRequestToolsAssistantToolsRetrieval(assistantToolsRetrieval AssistantToolsRetrieval) CreateThreadAndRunRequestTools

func (CreateThreadAndRunRequestTools) MarshalJSON

func (u CreateThreadAndRunRequestTools) MarshalJSON() ([]byte, error)

func (*CreateThreadAndRunRequestTools) UnmarshalJSON

func (u *CreateThreadAndRunRequestTools) UnmarshalJSON(data []byte) error

type CreateThreadAndRunRequestToolsType

type CreateThreadAndRunRequestToolsType string
const (
	CreateThreadAndRunRequestToolsTypeAssistantToolsCode      CreateThreadAndRunRequestToolsType = "AssistantToolsCode"
	CreateThreadAndRunRequestToolsTypeAssistantToolsRetrieval CreateThreadAndRunRequestToolsType = "AssistantToolsRetrieval"
	CreateThreadAndRunRequestToolsTypeAssistantToolsFunction  CreateThreadAndRunRequestToolsType = "AssistantToolsFunction"
)

type CreateThreadRequest

type CreateThreadRequest struct {
	// A list of [messages](/docs/api-reference/messages) to start the thread with.
	Messages []CreateMessageRequest `json:"messages,omitempty"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *CreateThreadRequestMetadata `json:"metadata,omitempty"`
}

func (*CreateThreadRequest) GetMessages

func (o *CreateThreadRequest) GetMessages() []CreateMessageRequest

func (*CreateThreadRequest) GetMetadata

type CreateThreadRequestMetadata

type CreateThreadRequestMetadata struct {
}

CreateThreadRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type CreateTranscriptionRequest

type CreateTranscriptionRequest struct {
	// The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
	//
	File CreateTranscriptionRequestFile `multipartForm:"file"`
	// The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
	//
	Language *string `multipartForm:"name=language"`
	// ID of the model to use. Only `whisper-1` is currently available.
	//
	Model CreateTranscriptionRequestModel `multipartForm:"name=model"`
	// An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
	//
	Prompt *string `multipartForm:"name=prompt"`
	// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.
	//
	ResponseFormat *CreateTranscriptionRequestResponseFormat `default:"json" multipartForm:"name=response_format"`
	// The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
	//
	Temperature *float64 `default:"0" multipartForm:"name=temperature"`
	// The timestamp granularities to populate for this transcription. Any of these options: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
	//
	TimestampGranularities []TimestampGranularities `multipartForm:"name=timestamp_granularities[]"`
}

func (*CreateTranscriptionRequest) GetFile

func (*CreateTranscriptionRequest) GetLanguage

func (o *CreateTranscriptionRequest) GetLanguage() *string

func (*CreateTranscriptionRequest) GetModel

func (*CreateTranscriptionRequest) GetPrompt

func (o *CreateTranscriptionRequest) GetPrompt() *string

func (*CreateTranscriptionRequest) GetResponseFormat

func (*CreateTranscriptionRequest) GetTemperature

func (o *CreateTranscriptionRequest) GetTemperature() *float64

func (*CreateTranscriptionRequest) GetTimestampGranularities

func (o *CreateTranscriptionRequest) GetTimestampGranularities() []TimestampGranularities

func (CreateTranscriptionRequest) MarshalJSON

func (c CreateTranscriptionRequest) MarshalJSON() ([]byte, error)

func (*CreateTranscriptionRequest) UnmarshalJSON

func (c *CreateTranscriptionRequest) UnmarshalJSON(data []byte) error

type CreateTranscriptionRequest2

type CreateTranscriptionRequest2 string
const (
	CreateTranscriptionRequest2Whisper1 CreateTranscriptionRequest2 = "whisper-1"
)

func (CreateTranscriptionRequest2) ToPointer

func (*CreateTranscriptionRequest2) UnmarshalJSON

func (e *CreateTranscriptionRequest2) UnmarshalJSON(data []byte) error

type CreateTranscriptionRequestFile

type CreateTranscriptionRequestFile struct {
	Content  []byte `multipartForm:"content"`
	FileName string `multipartForm:"name=file"`
}

func (*CreateTranscriptionRequestFile) GetContent

func (o *CreateTranscriptionRequestFile) GetContent() []byte

func (*CreateTranscriptionRequestFile) GetFileName

func (o *CreateTranscriptionRequestFile) GetFileName() string

type CreateTranscriptionRequestModel

type CreateTranscriptionRequestModel struct {
	Str                         *string
	CreateTranscriptionRequest2 *CreateTranscriptionRequest2

	Type CreateTranscriptionRequestModelType
}

CreateTranscriptionRequestModel - ID of the model to use. Only `whisper-1` is currently available.

func CreateCreateTranscriptionRequestModelCreateTranscriptionRequest2

func CreateCreateTranscriptionRequestModelCreateTranscriptionRequest2(createTranscriptionRequest2 CreateTranscriptionRequest2) CreateTranscriptionRequestModel

func CreateCreateTranscriptionRequestModelStr

func CreateCreateTranscriptionRequestModelStr(str string) CreateTranscriptionRequestModel

func (CreateTranscriptionRequestModel) MarshalJSON

func (u CreateTranscriptionRequestModel) MarshalJSON() ([]byte, error)

func (*CreateTranscriptionRequestModel) UnmarshalJSON

func (u *CreateTranscriptionRequestModel) UnmarshalJSON(data []byte) error

type CreateTranscriptionRequestModelType

type CreateTranscriptionRequestModelType string
const (
	CreateTranscriptionRequestModelTypeStr                         CreateTranscriptionRequestModelType = "str"
	CreateTranscriptionRequestModelTypeCreateTranscriptionRequest2 CreateTranscriptionRequestModelType = "CreateTranscriptionRequest_2"
)

type CreateTranscriptionRequestResponseFormat

type CreateTranscriptionRequestResponseFormat string

CreateTranscriptionRequestResponseFormat - The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.

const (
	CreateTranscriptionRequestResponseFormatJSON        CreateTranscriptionRequestResponseFormat = "json"
	CreateTranscriptionRequestResponseFormatText        CreateTranscriptionRequestResponseFormat = "text"
	CreateTranscriptionRequestResponseFormatSrt         CreateTranscriptionRequestResponseFormat = "srt"
	CreateTranscriptionRequestResponseFormatVerboseJSON CreateTranscriptionRequestResponseFormat = "verbose_json"
	CreateTranscriptionRequestResponseFormatVtt         CreateTranscriptionRequestResponseFormat = "vtt"
)

func (CreateTranscriptionRequestResponseFormat) ToPointer

func (*CreateTranscriptionRequestResponseFormat) UnmarshalJSON

func (e *CreateTranscriptionRequestResponseFormat) UnmarshalJSON(data []byte) error

type CreateTranscriptionResponse

type CreateTranscriptionResponse struct {
	Text string `json:"text"`
}

func (*CreateTranscriptionResponse) GetText

func (o *CreateTranscriptionResponse) GetText() string

type CreateTranslationRequest

type CreateTranslationRequest struct {
	// The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
	//
	File CreateTranslationRequestFile `multipartForm:"file"`
	// ID of the model to use. Only `whisper-1` is currently available.
	//
	Model CreateTranslationRequestModel `multipartForm:"name=model"`
	// An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.
	//
	Prompt *string `multipartForm:"name=prompt"`
	// The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.
	//
	ResponseFormat *string `default:"json" multipartForm:"name=response_format"`
	// The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
	//
	Temperature *float64 `default:"0" multipartForm:"name=temperature"`
}

func (*CreateTranslationRequest) GetFile

func (*CreateTranslationRequest) GetModel

func (*CreateTranslationRequest) GetPrompt

func (o *CreateTranslationRequest) GetPrompt() *string

func (*CreateTranslationRequest) GetResponseFormat

func (o *CreateTranslationRequest) GetResponseFormat() *string

func (*CreateTranslationRequest) GetTemperature

func (o *CreateTranslationRequest) GetTemperature() *float64

func (CreateTranslationRequest) MarshalJSON

func (c CreateTranslationRequest) MarshalJSON() ([]byte, error)

func (*CreateTranslationRequest) UnmarshalJSON

func (c *CreateTranslationRequest) UnmarshalJSON(data []byte) error

type CreateTranslationRequest2

type CreateTranslationRequest2 string
const (
	CreateTranslationRequest2Whisper1 CreateTranslationRequest2 = "whisper-1"
)

func (CreateTranslationRequest2) ToPointer

func (*CreateTranslationRequest2) UnmarshalJSON

func (e *CreateTranslationRequest2) UnmarshalJSON(data []byte) error

type CreateTranslationRequestFile

type CreateTranslationRequestFile struct {
	Content  []byte `multipartForm:"content"`
	FileName string `multipartForm:"name=file"`
}

func (*CreateTranslationRequestFile) GetContent

func (o *CreateTranslationRequestFile) GetContent() []byte

func (*CreateTranslationRequestFile) GetFileName

func (o *CreateTranslationRequestFile) GetFileName() string

type CreateTranslationRequestModel

type CreateTranslationRequestModel struct {
	Str                       *string
	CreateTranslationRequest2 *CreateTranslationRequest2

	Type CreateTranslationRequestModelType
}

CreateTranslationRequestModel - ID of the model to use. Only `whisper-1` is currently available.

func CreateCreateTranslationRequestModelCreateTranslationRequest2

func CreateCreateTranslationRequestModelCreateTranslationRequest2(createTranslationRequest2 CreateTranslationRequest2) CreateTranslationRequestModel

func CreateCreateTranslationRequestModelStr

func CreateCreateTranslationRequestModelStr(str string) CreateTranslationRequestModel

func (CreateTranslationRequestModel) MarshalJSON

func (u CreateTranslationRequestModel) MarshalJSON() ([]byte, error)

func (*CreateTranslationRequestModel) UnmarshalJSON

func (u *CreateTranslationRequestModel) UnmarshalJSON(data []byte) error

type CreateTranslationRequestModelType

type CreateTranslationRequestModelType string
const (
	CreateTranslationRequestModelTypeStr                       CreateTranslationRequestModelType = "str"
	CreateTranslationRequestModelTypeCreateTranslationRequest2 CreateTranslationRequestModelType = "CreateTranslationRequest_2"
)

type CreateTranslationResponse

type CreateTranslationResponse struct {
	Text string `json:"text"`
}

func (*CreateTranslationResponse) GetText

func (o *CreateTranslationResponse) GetText() string

type DeleteAssistantFileResponse

type DeleteAssistantFileResponse struct {
	Deleted bool                              `json:"deleted"`
	ID      string                            `json:"id"`
	Object  DeleteAssistantFileResponseObject `json:"object"`
}

DeleteAssistantFileResponse - Deletes the association between the assistant and the file, but does not delete the File(/docs/api-reference/files) object itself.

func (*DeleteAssistantFileResponse) GetDeleted

func (o *DeleteAssistantFileResponse) GetDeleted() bool

func (*DeleteAssistantFileResponse) GetID

func (*DeleteAssistantFileResponse) GetObject

type DeleteAssistantFileResponseObject

type DeleteAssistantFileResponseObject string
const (
	DeleteAssistantFileResponseObjectAssistantFileDeleted DeleteAssistantFileResponseObject = "assistant.file.deleted"
)

func (DeleteAssistantFileResponseObject) ToPointer

func (*DeleteAssistantFileResponseObject) UnmarshalJSON

func (e *DeleteAssistantFileResponseObject) UnmarshalJSON(data []byte) error

type DeleteAssistantResponse

type DeleteAssistantResponse struct {
	Deleted bool                          `json:"deleted"`
	ID      string                        `json:"id"`
	Object  DeleteAssistantResponseObject `json:"object"`
}

func (*DeleteAssistantResponse) GetDeleted

func (o *DeleteAssistantResponse) GetDeleted() bool

func (*DeleteAssistantResponse) GetID

func (o *DeleteAssistantResponse) GetID() string

func (*DeleteAssistantResponse) GetObject

type DeleteAssistantResponseObject

type DeleteAssistantResponseObject string
const (
	DeleteAssistantResponseObjectAssistantDeleted DeleteAssistantResponseObject = "assistant.deleted"
)

func (DeleteAssistantResponseObject) ToPointer

func (*DeleteAssistantResponseObject) UnmarshalJSON

func (e *DeleteAssistantResponseObject) UnmarshalJSON(data []byte) error

type DeleteFileResponse

type DeleteFileResponse struct {
	Deleted bool                     `json:"deleted"`
	ID      string                   `json:"id"`
	Object  DeleteFileResponseObject `json:"object"`
}

func (*DeleteFileResponse) GetDeleted

func (o *DeleteFileResponse) GetDeleted() bool

func (*DeleteFileResponse) GetID

func (o *DeleteFileResponse) GetID() string

func (*DeleteFileResponse) GetObject

type DeleteFileResponseObject

type DeleteFileResponseObject string
const (
	DeleteFileResponseObjectFile DeleteFileResponseObject = "file"
)

func (DeleteFileResponseObject) ToPointer

func (*DeleteFileResponseObject) UnmarshalJSON

func (e *DeleteFileResponseObject) UnmarshalJSON(data []byte) error

type DeleteModelResponse

type DeleteModelResponse struct {
	Deleted bool   `json:"deleted"`
	ID      string `json:"id"`
	Object  string `json:"object"`
}

func (*DeleteModelResponse) GetDeleted

func (o *DeleteModelResponse) GetDeleted() bool

func (*DeleteModelResponse) GetID

func (o *DeleteModelResponse) GetID() string

func (*DeleteModelResponse) GetObject

func (o *DeleteModelResponse) GetObject() string

type DeleteThreadResponse

type DeleteThreadResponse struct {
	Deleted bool                       `json:"deleted"`
	ID      string                     `json:"id"`
	Object  DeleteThreadResponseObject `json:"object"`
}

func (*DeleteThreadResponse) GetDeleted

func (o *DeleteThreadResponse) GetDeleted() bool

func (*DeleteThreadResponse) GetID

func (o *DeleteThreadResponse) GetID() string

func (*DeleteThreadResponse) GetObject

type DeleteThreadResponseObject

type DeleteThreadResponseObject string
const (
	DeleteThreadResponseObjectThreadDeleted DeleteThreadResponseObject = "thread.deleted"
)

func (DeleteThreadResponseObject) ToPointer

func (*DeleteThreadResponseObject) UnmarshalJSON

func (e *DeleteThreadResponseObject) UnmarshalJSON(data []byte) error

type Detail

type Detail string

Detail - Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision/low-or-high-fidelity-image-understanding).

const (
	DetailAuto Detail = "auto"
	DetailLow  Detail = "low"
	DetailHigh Detail = "high"
)

func (Detail) ToPointer

func (e Detail) ToPointer() *Detail

func (*Detail) UnmarshalJSON

func (e *Detail) UnmarshalJSON(data []byte) error

type Embedding

type Embedding struct {
	// The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings).
	//
	Embedding []float64 `json:"embedding"`
	// The index of the embedding in the list of embeddings.
	Index int64 `json:"index"`
	// The object type, which is always "embedding".
	Object EmbeddingObject `json:"object"`
}

Embedding - Represents an embedding vector returned by embedding endpoint.

func (*Embedding) GetEmbedding

func (o *Embedding) GetEmbedding() []float64

func (*Embedding) GetIndex

func (o *Embedding) GetIndex() int64

func (*Embedding) GetObject

func (o *Embedding) GetObject() EmbeddingObject

type EmbeddingObject

type EmbeddingObject string

EmbeddingObject - The object type, which is always "embedding".

const (
	EmbeddingObjectEmbedding EmbeddingObject = "embedding"
)

func (EmbeddingObject) ToPointer

func (e EmbeddingObject) ToPointer() *EmbeddingObject

func (*EmbeddingObject) UnmarshalJSON

func (e *EmbeddingObject) UnmarshalJSON(data []byte) error

type EncodingFormat

type EncodingFormat string

EncodingFormat - The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).

const (
	EncodingFormatFloat  EncodingFormat = "float"
	EncodingFormatBase64 EncodingFormat = "base64"
)

func (EncodingFormat) ToPointer

func (e EncodingFormat) ToPointer() *EncodingFormat

func (*EncodingFormat) UnmarshalJSON

func (e *EncodingFormat) UnmarshalJSON(data []byte) error

type Error

type Error struct {
	// A machine-readable error code.
	Code string `json:"code"`
	// A human-readable error message.
	Message string `json:"message"`
	// The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.
	Param *string `json:"param"`
}

Error - For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.

func (*Error) GetCode

func (o *Error) GetCode() string

func (*Error) GetMessage

func (o *Error) GetMessage() string

func (*Error) GetParam

func (o *Error) GetParam() *string

type File

type File struct {
	Content  []byte `multipartForm:"content"`
	FileName string `multipartForm:"name=file"`
}

func (*File) GetContent

func (o *File) GetContent() []byte

func (*File) GetFileName

func (o *File) GetFileName() string

type FileCitation

type FileCitation struct {
	// The ID of the specific File the citation is from.
	FileID string `json:"file_id"`
	// The specific quote in the file.
	Quote string `json:"quote"`
}

func (*FileCitation) GetFileID

func (o *FileCitation) GetFileID() string

func (*FileCitation) GetQuote

func (o *FileCitation) GetQuote() string

type FilePath

type FilePath struct {
	// The ID of the file that was generated.
	FileID string `json:"file_id"`
}

func (*FilePath) GetFileID

func (o *FilePath) GetFileID() string

type FineTuningJob

type FineTuningJob struct {
	// The Unix timestamp (in seconds) for when the fine-tuning job was created.
	CreatedAt int64 `json:"created_at"`
	// For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.
	Error *Error `json:"error"`
	// The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.
	FineTunedModel *string `json:"fine_tuned_model"`
	// The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.
	FinishedAt *int64 `json:"finished_at"`
	// The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details.
	Hyperparameters FineTuningJobHyperparameters `json:"hyperparameters"`
	// The object identifier, which can be referenced in the API endpoints.
	ID string `json:"id"`
	// The base model that is being fine-tuned.
	Model string `json:"model"`
	// The object type, which is always "fine_tuning.job".
	Object FineTuningJobObject `json:"object"`
	// The organization that owns the fine-tuning job.
	OrganizationID string `json:"organization_id"`
	// The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents).
	ResultFiles []string `json:"result_files"`
	// The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.
	Status Status `json:"status"`
	// The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.
	TrainedTokens *int64 `json:"trained_tokens"`
	// The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents).
	TrainingFile string `json:"training_file"`
	// The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents).
	ValidationFile *string `json:"validation_file"`
}

FineTuningJob - The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.

func (*FineTuningJob) GetCreatedAt

func (o *FineTuningJob) GetCreatedAt() int64

func (*FineTuningJob) GetError

func (o *FineTuningJob) GetError() *Error

func (*FineTuningJob) GetFineTunedModel

func (o *FineTuningJob) GetFineTunedModel() *string

func (*FineTuningJob) GetFinishedAt

func (o *FineTuningJob) GetFinishedAt() *int64

func (*FineTuningJob) GetHyperparameters

func (o *FineTuningJob) GetHyperparameters() FineTuningJobHyperparameters

func (*FineTuningJob) GetID

func (o *FineTuningJob) GetID() string

func (*FineTuningJob) GetModel

func (o *FineTuningJob) GetModel() string

func (*FineTuningJob) GetObject

func (o *FineTuningJob) GetObject() FineTuningJobObject

func (*FineTuningJob) GetOrganizationID

func (o *FineTuningJob) GetOrganizationID() string

func (*FineTuningJob) GetResultFiles

func (o *FineTuningJob) GetResultFiles() []string

func (*FineTuningJob) GetStatus

func (o *FineTuningJob) GetStatus() Status

func (*FineTuningJob) GetTrainedTokens

func (o *FineTuningJob) GetTrainedTokens() *int64

func (*FineTuningJob) GetTrainingFile

func (o *FineTuningJob) GetTrainingFile() string

func (*FineTuningJob) GetValidationFile

func (o *FineTuningJob) GetValidationFile() *string

type FineTuningJob1

type FineTuningJob1 string
const (
	FineTuningJob1Auto FineTuningJob1 = "auto"
)

func (FineTuningJob1) ToPointer

func (e FineTuningJob1) ToPointer() *FineTuningJob1

func (*FineTuningJob1) UnmarshalJSON

func (e *FineTuningJob1) UnmarshalJSON(data []byte) error

type FineTuningJobEvent

type FineTuningJobEvent struct {
	CreatedAt int64                    `json:"created_at"`
	ID        string                   `json:"id"`
	Level     Level                    `json:"level"`
	Message   string                   `json:"message"`
	Object    FineTuningJobEventObject `json:"object"`
}

FineTuningJobEvent - Fine-tuning job event object

func (*FineTuningJobEvent) GetCreatedAt

func (o *FineTuningJobEvent) GetCreatedAt() int64

func (*FineTuningJobEvent) GetID

func (o *FineTuningJobEvent) GetID() string

func (*FineTuningJobEvent) GetLevel

func (o *FineTuningJobEvent) GetLevel() Level

func (*FineTuningJobEvent) GetMessage

func (o *FineTuningJobEvent) GetMessage() string

func (*FineTuningJobEvent) GetObject

type FineTuningJobEventObject

type FineTuningJobEventObject string
const (
	FineTuningJobEventObjectFineTuningJobEvent FineTuningJobEventObject = "fine_tuning.job.event"
)

func (FineTuningJobEventObject) ToPointer

func (*FineTuningJobEventObject) UnmarshalJSON

func (e *FineTuningJobEventObject) UnmarshalJSON(data []byte) error

type FineTuningJobHyperparameters

type FineTuningJobHyperparameters struct {
	// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
	// "auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.
	NEpochs FineTuningJobNEpochs `json:"n_epochs"`
}

FineTuningJobHyperparameters - The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details.

func (*FineTuningJobHyperparameters) GetNEpochs

type FineTuningJobNEpochs

type FineTuningJobNEpochs struct {
	FineTuningJob1 *FineTuningJob1
	Integer        *int64

	Type FineTuningJobNEpochsType
}

FineTuningJobNEpochs - The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. "auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.

func CreateFineTuningJobNEpochsFineTuningJob1

func CreateFineTuningJobNEpochsFineTuningJob1(fineTuningJob1 FineTuningJob1) FineTuningJobNEpochs

func CreateFineTuningJobNEpochsInteger

func CreateFineTuningJobNEpochsInteger(integer int64) FineTuningJobNEpochs

func (FineTuningJobNEpochs) MarshalJSON

func (u FineTuningJobNEpochs) MarshalJSON() ([]byte, error)

func (*FineTuningJobNEpochs) UnmarshalJSON

func (u *FineTuningJobNEpochs) UnmarshalJSON(data []byte) error

type FineTuningJobNEpochsType

type FineTuningJobNEpochsType string
const (
	FineTuningJobNEpochsTypeFineTuningJob1 FineTuningJobNEpochsType = "FineTuningJob_1"
	FineTuningJobNEpochsTypeInteger        FineTuningJobNEpochsType = "integer"
)

type FineTuningJobObject

type FineTuningJobObject string

FineTuningJobObject - The object type, which is always "fine_tuning.job".

const (
	FineTuningJobObjectFineTuningJob FineTuningJobObject = "fine_tuning.job"
)

func (FineTuningJobObject) ToPointer

func (*FineTuningJobObject) UnmarshalJSON

func (e *FineTuningJobObject) UnmarshalJSON(data []byte) error

type FinishReason

type FinishReason string

FinishReason - The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.

const (
	FinishReasonStop          FinishReason = "stop"
	FinishReasonLength        FinishReason = "length"
	FinishReasonToolCalls     FinishReason = "tool_calls"
	FinishReasonContentFilter FinishReason = "content_filter"
	FinishReasonFunctionCall  FinishReason = "function_call"
)

func (FinishReason) ToPointer

func (e FinishReason) ToPointer() *FinishReason

func (*FinishReason) UnmarshalJSON

func (e *FinishReason) UnmarshalJSON(data []byte) error

type Function

type Function struct {
	// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
	Arguments string `json:"arguments"`
	// The name of the function to call.
	Name string `json:"name"`
}

Function - The function that the model called.

func (*Function) GetArguments

func (o *Function) GetArguments() string

func (*Function) GetName

func (o *Function) GetName() string

type FunctionCall

type FunctionCall struct {
	// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
	Arguments string `json:"arguments"`
	// The name of the function to call.
	Name string `json:"name"`
}

FunctionCall - Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.

Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FunctionCall) GetArguments

func (o *FunctionCall) GetArguments() string

func (*FunctionCall) GetName

func (o *FunctionCall) GetName() string

type FunctionObject

type FunctionObject struct {
	// A description of what the function does, used by the model to choose when and how to call the function.
	Description *string `json:"description,omitempty"`
	// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
	Name string `json:"name"`
	// The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
	//
	// Omitting `parameters` defines a function with an empty parameter list.
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

func (*FunctionObject) GetDescription

func (o *FunctionObject) GetDescription() *string

func (*FunctionObject) GetName

func (o *FunctionObject) GetName() string

func (*FunctionObject) GetParameters

func (o *FunctionObject) GetParameters() map[string]interface{}

type Hyperparameters

type Hyperparameters struct {
	// Number of examples in each batch. A larger batch size means that model parameters
	// are updated less frequently, but with lower variance.
	//
	BatchSize *BatchSize `json:"batch_size,omitempty"`
	// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid
	// overfitting.
	//
	LearningRateMultiplier *LearningRateMultiplier `json:"learning_rate_multiplier,omitempty"`
	// The number of epochs to train the model for. An epoch refers to one full cycle
	// through the training dataset.
	//
	NEpochs *NEpochs `json:"n_epochs,omitempty"`
}

Hyperparameters - The hyperparameters used for the fine-tuning job.

func (*Hyperparameters) GetBatchSize

func (o *Hyperparameters) GetBatchSize() *BatchSize

func (*Hyperparameters) GetLearningRateMultiplier

func (o *Hyperparameters) GetLearningRateMultiplier() *LearningRateMultiplier

func (*Hyperparameters) GetNEpochs

func (o *Hyperparameters) GetNEpochs() *NEpochs

type Image

type Image struct {
	// The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.
	B64JSON *string `json:"b64_json,omitempty"`
	// The prompt that was used to generate the image, if there was any revision to the prompt.
	RevisedPrompt *string `json:"revised_prompt,omitempty"`
	// The URL of the generated image, if `response_format` is `url` (default).
	URL *string `json:"url,omitempty"`
}

Image - Represents the url or the content of an image generated by the OpenAI API.

func (*Image) GetB64JSON

func (o *Image) GetB64JSON() *string

func (*Image) GetRevisedPrompt

func (o *Image) GetRevisedPrompt() *string

func (*Image) GetURL

func (o *Image) GetURL() *string

type ImageFile

type ImageFile struct {
	// The [File](/docs/api-reference/files) ID of the image in the message content.
	FileID string `json:"file_id"`
}

func (*ImageFile) GetFileID

func (o *ImageFile) GetFileID() string

type ImageURL

type ImageURL struct {
	// Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision/low-or-high-fidelity-image-understanding).
	Detail *Detail `default:"auto" json:"detail"`
	// Either a URL of the image or the base64 encoded image data.
	URL string `json:"url"`
}

func (*ImageURL) GetDetail

func (o *ImageURL) GetDetail() *Detail

func (*ImageURL) GetURL

func (o *ImageURL) GetURL() string

func (ImageURL) MarshalJSON

func (i ImageURL) MarshalJSON() ([]byte, error)

func (*ImageURL) UnmarshalJSON

func (i *ImageURL) UnmarshalJSON(data []byte) error

type ImagesResponse

type ImagesResponse struct {
	Created int64   `json:"created"`
	Data    []Image `json:"data"`
}

func (*ImagesResponse) GetCreated

func (o *ImagesResponse) GetCreated() int64

func (*ImagesResponse) GetData

func (o *ImagesResponse) GetData() []Image

type Input

type Input struct {
	Str                   *string
	ArrayOfstr            []string
	ArrayOfinteger        []int64
	ArrayOfarrayOfinteger [][]int64

	Type InputType
}

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.

func CreateInputArrayOfarrayOfinteger

func CreateInputArrayOfarrayOfinteger(arrayOfarrayOfinteger [][]int64) Input

func CreateInputArrayOfinteger

func CreateInputArrayOfinteger(arrayOfinteger []int64) Input

func CreateInputArrayOfstr

func CreateInputArrayOfstr(arrayOfstr []string) Input

func CreateInputStr

func CreateInputStr(str string) Input

func (Input) MarshalJSON

func (u Input) MarshalJSON() ([]byte, error)

func (*Input) UnmarshalJSON

func (u *Input) UnmarshalJSON(data []byte) error

type InputType

type InputType string
const (
	InputTypeStr                   InputType = "str"
	InputTypeArrayOfstr            InputType = "arrayOfstr"
	InputTypeArrayOfinteger        InputType = "arrayOfinteger"
	InputTypeArrayOfarrayOfinteger InputType = "arrayOfarrayOfinteger"
)

type LastError

type LastError struct {
	// One of `server_error` or `rate_limit_exceeded`.
	Code Code `json:"code"`
	// A human-readable description of the error.
	Message string `json:"message"`
}

LastError - The last error associated with this run. Will be `null` if there are no errors.

func (*LastError) GetCode

func (o *LastError) GetCode() Code

func (*LastError) GetMessage

func (o *LastError) GetMessage() string

type LearningRateMultiplier

type LearningRateMultiplier struct {
	CreateFineTuningJobRequestSchemas1 *CreateFineTuningJobRequestSchemas1
	Number                             *float64

	Type LearningRateMultiplierType
}

LearningRateMultiplier - Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

func CreateLearningRateMultiplierCreateFineTuningJobRequestSchemas1

func CreateLearningRateMultiplierCreateFineTuningJobRequestSchemas1(createFineTuningJobRequestSchemas1 CreateFineTuningJobRequestSchemas1) LearningRateMultiplier

func CreateLearningRateMultiplierNumber

func CreateLearningRateMultiplierNumber(number float64) LearningRateMultiplier

func (LearningRateMultiplier) MarshalJSON

func (u LearningRateMultiplier) MarshalJSON() ([]byte, error)

func (*LearningRateMultiplier) UnmarshalJSON

func (u *LearningRateMultiplier) UnmarshalJSON(data []byte) error

type LearningRateMultiplierType

type LearningRateMultiplierType string
const (
	LearningRateMultiplierTypeCreateFineTuningJobRequestSchemas1 LearningRateMultiplierType = "CreateFineTuningJobRequest_Schemas_1"
	LearningRateMultiplierTypeNumber                             LearningRateMultiplierType = "number"
)

type Level

type Level string
const (
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
)

func (Level) ToPointer

func (e Level) ToPointer() *Level

func (*Level) UnmarshalJSON

func (e *Level) UnmarshalJSON(data []byte) error

type ListAssistantFilesResponse

type ListAssistantFilesResponse struct {
	Data    []AssistantFileObject `json:"data"`
	FirstID string                `json:"first_id"`
	HasMore bool                  `json:"has_more"`
	LastID  string                `json:"last_id"`
	Object  string                `json:"object"`
}

func (*ListAssistantFilesResponse) GetData

func (*ListAssistantFilesResponse) GetFirstID

func (o *ListAssistantFilesResponse) GetFirstID() string

func (*ListAssistantFilesResponse) GetHasMore

func (o *ListAssistantFilesResponse) GetHasMore() bool

func (*ListAssistantFilesResponse) GetLastID

func (o *ListAssistantFilesResponse) GetLastID() string

func (*ListAssistantFilesResponse) GetObject

func (o *ListAssistantFilesResponse) GetObject() string

type ListAssistantsResponse

type ListAssistantsResponse struct {
	Data    []AssistantObject `json:"data"`
	FirstID string            `json:"first_id"`
	HasMore bool              `json:"has_more"`
	LastID  string            `json:"last_id"`
	Object  string            `json:"object"`
}

func (*ListAssistantsResponse) GetData

func (o *ListAssistantsResponse) GetData() []AssistantObject

func (*ListAssistantsResponse) GetFirstID

func (o *ListAssistantsResponse) GetFirstID() string

func (*ListAssistantsResponse) GetHasMore

func (o *ListAssistantsResponse) GetHasMore() bool

func (*ListAssistantsResponse) GetLastID

func (o *ListAssistantsResponse) GetLastID() string

func (*ListAssistantsResponse) GetObject

func (o *ListAssistantsResponse) GetObject() string

type ListFilesResponse

type ListFilesResponse struct {
	Data   []OpenAIFile            `json:"data"`
	Object ListFilesResponseObject `json:"object"`
}

func (*ListFilesResponse) GetData

func (o *ListFilesResponse) GetData() []OpenAIFile

func (*ListFilesResponse) GetObject

type ListFilesResponseObject

type ListFilesResponseObject string
const (
	ListFilesResponseObjectList ListFilesResponseObject = "list"
)

func (ListFilesResponseObject) ToPointer

func (*ListFilesResponseObject) UnmarshalJSON

func (e *ListFilesResponseObject) UnmarshalJSON(data []byte) error

type ListFineTuningJobEventsResponse

type ListFineTuningJobEventsResponse struct {
	Data   []FineTuningJobEvent                  `json:"data"`
	Object ListFineTuningJobEventsResponseObject `json:"object"`
}

func (*ListFineTuningJobEventsResponse) GetData

func (*ListFineTuningJobEventsResponse) GetObject

type ListFineTuningJobEventsResponseObject

type ListFineTuningJobEventsResponseObject string
const (
	ListFineTuningJobEventsResponseObjectList ListFineTuningJobEventsResponseObject = "list"
)

func (ListFineTuningJobEventsResponseObject) ToPointer

func (*ListFineTuningJobEventsResponseObject) UnmarshalJSON

func (e *ListFineTuningJobEventsResponseObject) UnmarshalJSON(data []byte) error

type ListMessageFilesResponse

type ListMessageFilesResponse struct {
	Data    []MessageFileObject `json:"data"`
	FirstID string              `json:"first_id"`
	HasMore bool                `json:"has_more"`
	LastID  string              `json:"last_id"`
	Object  string              `json:"object"`
}

func (*ListMessageFilesResponse) GetData

func (*ListMessageFilesResponse) GetFirstID

func (o *ListMessageFilesResponse) GetFirstID() string

func (*ListMessageFilesResponse) GetHasMore

func (o *ListMessageFilesResponse) GetHasMore() bool

func (*ListMessageFilesResponse) GetLastID

func (o *ListMessageFilesResponse) GetLastID() string

func (*ListMessageFilesResponse) GetObject

func (o *ListMessageFilesResponse) GetObject() string

type ListMessagesResponse

type ListMessagesResponse struct {
	Data    []MessageObject `json:"data"`
	FirstID string          `json:"first_id"`
	HasMore bool            `json:"has_more"`
	LastID  string          `json:"last_id"`
	Object  string          `json:"object"`
}

func (*ListMessagesResponse) GetData

func (o *ListMessagesResponse) GetData() []MessageObject

func (*ListMessagesResponse) GetFirstID

func (o *ListMessagesResponse) GetFirstID() string

func (*ListMessagesResponse) GetHasMore

func (o *ListMessagesResponse) GetHasMore() bool

func (*ListMessagesResponse) GetLastID

func (o *ListMessagesResponse) GetLastID() string

func (*ListMessagesResponse) GetObject

func (o *ListMessagesResponse) GetObject() string

type ListModelsResponse

type ListModelsResponse struct {
	Data   []Model                  `json:"data"`
	Object ListModelsResponseObject `json:"object"`
}

func (*ListModelsResponse) GetData

func (o *ListModelsResponse) GetData() []Model

func (*ListModelsResponse) GetObject

type ListModelsResponseObject

type ListModelsResponseObject string
const (
	ListModelsResponseObjectList ListModelsResponseObject = "list"
)

func (ListModelsResponseObject) ToPointer

func (*ListModelsResponseObject) UnmarshalJSON

func (e *ListModelsResponseObject) UnmarshalJSON(data []byte) error

type ListPaginatedFineTuningJobsResponse

type ListPaginatedFineTuningJobsResponse struct {
	Data    []FineTuningJob                           `json:"data"`
	HasMore bool                                      `json:"has_more"`
	Object  ListPaginatedFineTuningJobsResponseObject `json:"object"`
}

func (*ListPaginatedFineTuningJobsResponse) GetData

func (*ListPaginatedFineTuningJobsResponse) GetHasMore

func (o *ListPaginatedFineTuningJobsResponse) GetHasMore() bool

func (*ListPaginatedFineTuningJobsResponse) GetObject

type ListPaginatedFineTuningJobsResponseObject

type ListPaginatedFineTuningJobsResponseObject string
const (
	ListPaginatedFineTuningJobsResponseObjectList ListPaginatedFineTuningJobsResponseObject = "list"
)

func (ListPaginatedFineTuningJobsResponseObject) ToPointer

func (*ListPaginatedFineTuningJobsResponseObject) UnmarshalJSON

func (e *ListPaginatedFineTuningJobsResponseObject) UnmarshalJSON(data []byte) error

type ListRunStepsResponse

type ListRunStepsResponse struct {
	Data    []RunStepObject `json:"data"`
	FirstID string          `json:"first_id"`
	HasMore bool            `json:"has_more"`
	LastID  string          `json:"last_id"`
	Object  string          `json:"object"`
}

func (*ListRunStepsResponse) GetData

func (o *ListRunStepsResponse) GetData() []RunStepObject

func (*ListRunStepsResponse) GetFirstID

func (o *ListRunStepsResponse) GetFirstID() string

func (*ListRunStepsResponse) GetHasMore

func (o *ListRunStepsResponse) GetHasMore() bool

func (*ListRunStepsResponse) GetLastID

func (o *ListRunStepsResponse) GetLastID() string

func (*ListRunStepsResponse) GetObject

func (o *ListRunStepsResponse) GetObject() string

type ListRunsResponse

type ListRunsResponse struct {
	Data    []RunObject `json:"data"`
	FirstID string      `json:"first_id"`
	HasMore bool        `json:"has_more"`
	LastID  string      `json:"last_id"`
	Object  string      `json:"object"`
}

func (*ListRunsResponse) GetData

func (o *ListRunsResponse) GetData() []RunObject

func (*ListRunsResponse) GetFirstID

func (o *ListRunsResponse) GetFirstID() string

func (*ListRunsResponse) GetHasMore

func (o *ListRunsResponse) GetHasMore() bool

func (*ListRunsResponse) GetLastID

func (o *ListRunsResponse) GetLastID() string

func (*ListRunsResponse) GetObject

func (o *ListRunsResponse) GetObject() string

type Logprobs

type Logprobs struct {
	// A list of message content tokens with log probability information.
	Content []ChatCompletionTokenLogprob `json:"content"`
}

Logprobs - Log probability information for the choice.

func (*Logprobs) GetContent

func (o *Logprobs) GetContent() []ChatCompletionTokenLogprob

type Mask

type Mask struct {
	Content  []byte `multipartForm:"content"`
	FileName string `multipartForm:"name=mask"`
}

func (*Mask) GetContent

func (o *Mask) GetContent() []byte

func (*Mask) GetFileName

func (o *Mask) GetFileName() string

type MessageContentImageFileObject

type MessageContentImageFileObject struct {
	ImageFile ImageFile `json:"image_file"`
	// Always `image_file`.
	Type MessageContentImageFileObjectType `json:"type"`
}

MessageContentImageFileObject - References an image File(/docs/api-reference/files) in the content of a message.

func (*MessageContentImageFileObject) GetImageFile

func (o *MessageContentImageFileObject) GetImageFile() ImageFile

func (*MessageContentImageFileObject) GetType

type MessageContentImageFileObjectType

type MessageContentImageFileObjectType string

MessageContentImageFileObjectType - Always `image_file`.

const (
	MessageContentImageFileObjectTypeImageFile MessageContentImageFileObjectType = "image_file"
)

func (MessageContentImageFileObjectType) ToPointer

func (*MessageContentImageFileObjectType) UnmarshalJSON

func (e *MessageContentImageFileObjectType) UnmarshalJSON(data []byte) error

type MessageContentTextAnnotationsFileCitationObject

type MessageContentTextAnnotationsFileCitationObject struct {
	EndIndex     int64        `json:"end_index"`
	FileCitation FileCitation `json:"file_citation"`
	StartIndex   int64        `json:"start_index"`
	// The text in the message content that needs to be replaced.
	Text string `json:"text"`
	// Always `file_citation`.
	Type MessageContentTextAnnotationsFileCitationObjectType `json:"type"`
}

MessageContentTextAnnotationsFileCitationObject - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files.

func (*MessageContentTextAnnotationsFileCitationObject) GetEndIndex

func (*MessageContentTextAnnotationsFileCitationObject) GetFileCitation

func (*MessageContentTextAnnotationsFileCitationObject) GetStartIndex

func (*MessageContentTextAnnotationsFileCitationObject) GetText

func (*MessageContentTextAnnotationsFileCitationObject) GetType

type MessageContentTextAnnotationsFileCitationObjectType

type MessageContentTextAnnotationsFileCitationObjectType string

MessageContentTextAnnotationsFileCitationObjectType - Always `file_citation`.

const (
	MessageContentTextAnnotationsFileCitationObjectTypeFileCitation MessageContentTextAnnotationsFileCitationObjectType = "file_citation"
)

func (MessageContentTextAnnotationsFileCitationObjectType) ToPointer

func (*MessageContentTextAnnotationsFileCitationObjectType) UnmarshalJSON

type MessageContentTextAnnotationsFilePathObject

type MessageContentTextAnnotationsFilePathObject struct {
	EndIndex   int64    `json:"end_index"`
	FilePath   FilePath `json:"file_path"`
	StartIndex int64    `json:"start_index"`
	// The text in the message content that needs to be replaced.
	Text string `json:"text"`
	// Always `file_path`.
	Type MessageContentTextAnnotationsFilePathObjectType `json:"type"`
}

MessageContentTextAnnotationsFilePathObject - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.

func (*MessageContentTextAnnotationsFilePathObject) GetEndIndex

func (*MessageContentTextAnnotationsFilePathObject) GetFilePath

func (*MessageContentTextAnnotationsFilePathObject) GetStartIndex

func (*MessageContentTextAnnotationsFilePathObject) GetText

func (*MessageContentTextAnnotationsFilePathObject) GetType

type MessageContentTextAnnotationsFilePathObjectType

type MessageContentTextAnnotationsFilePathObjectType string

MessageContentTextAnnotationsFilePathObjectType - Always `file_path`.

const (
	MessageContentTextAnnotationsFilePathObjectTypeFilePath MessageContentTextAnnotationsFilePathObjectType = "file_path"
)

func (MessageContentTextAnnotationsFilePathObjectType) ToPointer

func (*MessageContentTextAnnotationsFilePathObjectType) UnmarshalJSON

type MessageContentTextObject

type MessageContentTextObject struct {
	Text Text `json:"text"`
	// Always `text`.
	Type MessageContentTextObjectType `json:"type"`
}

MessageContentTextObject - The text content that is part of a message.

func (*MessageContentTextObject) GetText

func (o *MessageContentTextObject) GetText() Text

func (*MessageContentTextObject) GetType

type MessageContentTextObjectType

type MessageContentTextObjectType string

MessageContentTextObjectType - Always `text`.

const (
	MessageContentTextObjectTypeText MessageContentTextObjectType = "text"
)

func (MessageContentTextObjectType) ToPointer

func (*MessageContentTextObjectType) UnmarshalJSON

func (e *MessageContentTextObjectType) UnmarshalJSON(data []byte) error

type MessageCreation

type MessageCreation struct {
	// The ID of the message that was created by this run step.
	MessageID string `json:"message_id"`
}

func (*MessageCreation) GetMessageID

func (o *MessageCreation) GetMessageID() string

type MessageFileObject

type MessageFileObject struct {
	// The Unix timestamp (in seconds) for when the message file was created.
	CreatedAt int64 `json:"created_at"`
	// The identifier, which can be referenced in API endpoints.
	ID string `json:"id"`
	// The ID of the [message](/docs/api-reference/messages) that the [File](/docs/api-reference/files) is attached to.
	MessageID string `json:"message_id"`
	// The object type, which is always `thread.message.file`.
	Object MessageFileObjectObject `json:"object"`
}

MessageFileObject - A list of files attached to a `message`.

func (*MessageFileObject) GetCreatedAt

func (o *MessageFileObject) GetCreatedAt() int64

func (*MessageFileObject) GetID

func (o *MessageFileObject) GetID() string

func (*MessageFileObject) GetMessageID

func (o *MessageFileObject) GetMessageID() string

func (*MessageFileObject) GetObject

type MessageFileObjectObject

type MessageFileObjectObject string

MessageFileObjectObject - The object type, which is always `thread.message.file`.

const (
	MessageFileObjectObjectThreadMessageFile MessageFileObjectObject = "thread.message.file"
)

func (MessageFileObjectObject) ToPointer

func (*MessageFileObjectObject) UnmarshalJSON

func (e *MessageFileObjectObject) UnmarshalJSON(data []byte) error

type MessageObject

type MessageObject struct {
	// If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.
	AssistantID *string `json:"assistant_id"`
	// The content of the message in array of text and/or images.
	Content []MessageObjectContent `json:"content"`
	// The Unix timestamp (in seconds) for when the message was created.
	CreatedAt int64 `json:"created_at"`
	// A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message.
	FileIds []string `json:"file_ids"`
	// The identifier, which can be referenced in API endpoints.
	ID string `json:"id"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *MessageObjectMetadata `json:"metadata"`
	// The object type, which is always `thread.message`.
	Object MessageObjectObject `json:"object"`
	// The entity that produced the message. One of `user` or `assistant`.
	Role MessageObjectRole `json:"role"`
	// If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message.
	RunID *string `json:"run_id"`
	// The [thread](/docs/api-reference/threads) ID that this message belongs to.
	ThreadID string `json:"thread_id"`
}

MessageObject - Represents a message within a [thread](/docs/api-reference/threads).

func (*MessageObject) GetAssistantID

func (o *MessageObject) GetAssistantID() *string

func (*MessageObject) GetContent

func (o *MessageObject) GetContent() []MessageObjectContent

func (*MessageObject) GetCreatedAt

func (o *MessageObject) GetCreatedAt() int64

func (*MessageObject) GetFileIds

func (o *MessageObject) GetFileIds() []string

func (*MessageObject) GetID

func (o *MessageObject) GetID() string

func (*MessageObject) GetMetadata

func (o *MessageObject) GetMetadata() *MessageObjectMetadata

func (*MessageObject) GetObject

func (o *MessageObject) GetObject() MessageObjectObject

func (*MessageObject) GetRole

func (o *MessageObject) GetRole() MessageObjectRole

func (*MessageObject) GetRunID

func (o *MessageObject) GetRunID() *string

func (*MessageObject) GetThreadID

func (o *MessageObject) GetThreadID() string

type MessageObjectContent

type MessageObjectContent struct {
	MessageContentImageFileObject *MessageContentImageFileObject
	MessageContentTextObject      *MessageContentTextObject

	Type MessageObjectContentType
}

func CreateMessageObjectContentMessageContentImageFileObject

func CreateMessageObjectContentMessageContentImageFileObject(messageContentImageFileObject MessageContentImageFileObject) MessageObjectContent

func CreateMessageObjectContentMessageContentTextObject

func CreateMessageObjectContentMessageContentTextObject(messageContentTextObject MessageContentTextObject) MessageObjectContent

func (MessageObjectContent) MarshalJSON

func (u MessageObjectContent) MarshalJSON() ([]byte, error)

func (*MessageObjectContent) UnmarshalJSON

func (u *MessageObjectContent) UnmarshalJSON(data []byte) error

type MessageObjectContentType

type MessageObjectContentType string
const (
	MessageObjectContentTypeMessageContentImageFileObject MessageObjectContentType = "MessageContentImageFileObject"
	MessageObjectContentTypeMessageContentTextObject      MessageObjectContentType = "MessageContentTextObject"
)

type MessageObjectMetadata

type MessageObjectMetadata struct {
}

MessageObjectMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type MessageObjectObject

type MessageObjectObject string

MessageObjectObject - The object type, which is always `thread.message`.

const (
	MessageObjectObjectThreadMessage MessageObjectObject = "thread.message"
)

func (MessageObjectObject) ToPointer

func (*MessageObjectObject) UnmarshalJSON

func (e *MessageObjectObject) UnmarshalJSON(data []byte) error

type MessageObjectRole

type MessageObjectRole string

MessageObjectRole - The entity that produced the message. One of `user` or `assistant`.

const (
	MessageObjectRoleUser      MessageObjectRole = "user"
	MessageObjectRoleAssistant MessageObjectRole = "assistant"
)

func (MessageObjectRole) ToPointer

func (e MessageObjectRole) ToPointer() *MessageObjectRole

func (*MessageObjectRole) UnmarshalJSON

func (e *MessageObjectRole) UnmarshalJSON(data []byte) error

type Metadata

type Metadata struct {
}

Metadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type Model

type Model struct {
	// The Unix timestamp (in seconds) when the model was created.
	Created int64 `json:"created"`
	// The model identifier, which can be referenced in the API endpoints.
	ID string `json:"id"`
	// The object type, which is always "model".
	Object ModelObject `json:"object"`
	// The organization that owns the model.
	OwnedBy string `json:"owned_by"`
}

Model - Describes an OpenAI model offering that can be used with the API.

func (*Model) GetCreated

func (o *Model) GetCreated() int64

func (*Model) GetID

func (o *Model) GetID() string

func (*Model) GetObject

func (o *Model) GetObject() ModelObject

func (*Model) GetOwnedBy

func (o *Model) GetOwnedBy() string

type ModelObject

type ModelObject string

ModelObject - The object type, which is always "model".

const (
	ModelObjectModel ModelObject = "model"
)

func (ModelObject) ToPointer

func (e ModelObject) ToPointer() *ModelObject

func (*ModelObject) UnmarshalJSON

func (e *ModelObject) UnmarshalJSON(data []byte) error

type ModifyAssistantRequest

type ModifyAssistantRequest struct {
	// The description of the assistant. The maximum length is 512 characters.
	//
	Description *string `json:"description,omitempty"`
	// A list of [File](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. If a file was previously attached to the list but does not show up in the list, it will be deleted from the assistant.
	//
	FileIds []string `json:"file_ids,omitempty"`
	// The system instructions that the assistant uses. The maximum length is 32768 characters.
	//
	Instructions *string `json:"instructions,omitempty"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *ModifyAssistantRequestMetadata `json:"metadata,omitempty"`
	// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
	//
	Model *string `json:"model,omitempty"`
	// The name of the assistant. The maximum length is 256 characters.
	//
	Name *string `json:"name,omitempty"`
	// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
	//
	Tools []ModifyAssistantRequestTools `json:"tools,omitempty"`
}

func (*ModifyAssistantRequest) GetDescription

func (o *ModifyAssistantRequest) GetDescription() *string

func (*ModifyAssistantRequest) GetFileIds

func (o *ModifyAssistantRequest) GetFileIds() []string

func (*ModifyAssistantRequest) GetInstructions

func (o *ModifyAssistantRequest) GetInstructions() *string

func (*ModifyAssistantRequest) GetMetadata

func (*ModifyAssistantRequest) GetModel

func (o *ModifyAssistantRequest) GetModel() *string

func (*ModifyAssistantRequest) GetName

func (o *ModifyAssistantRequest) GetName() *string

func (*ModifyAssistantRequest) GetTools

type ModifyAssistantRequestMetadata

type ModifyAssistantRequestMetadata struct {
}

ModifyAssistantRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type ModifyAssistantRequestTools

type ModifyAssistantRequestTools struct {
	AssistantToolsCode      *AssistantToolsCode
	AssistantToolsRetrieval *AssistantToolsRetrieval
	AssistantToolsFunction  *AssistantToolsFunction

	Type ModifyAssistantRequestToolsType
}

func CreateModifyAssistantRequestToolsAssistantToolsCode

func CreateModifyAssistantRequestToolsAssistantToolsCode(assistantToolsCode AssistantToolsCode) ModifyAssistantRequestTools

func CreateModifyAssistantRequestToolsAssistantToolsFunction

func CreateModifyAssistantRequestToolsAssistantToolsFunction(assistantToolsFunction AssistantToolsFunction) ModifyAssistantRequestTools

func CreateModifyAssistantRequestToolsAssistantToolsRetrieval

func CreateModifyAssistantRequestToolsAssistantToolsRetrieval(assistantToolsRetrieval AssistantToolsRetrieval) ModifyAssistantRequestTools

func (ModifyAssistantRequestTools) MarshalJSON

func (u ModifyAssistantRequestTools) MarshalJSON() ([]byte, error)

func (*ModifyAssistantRequestTools) UnmarshalJSON

func (u *ModifyAssistantRequestTools) UnmarshalJSON(data []byte) error

type ModifyAssistantRequestToolsType

type ModifyAssistantRequestToolsType string
const (
	ModifyAssistantRequestToolsTypeAssistantToolsCode      ModifyAssistantRequestToolsType = "AssistantToolsCode"
	ModifyAssistantRequestToolsTypeAssistantToolsRetrieval ModifyAssistantRequestToolsType = "AssistantToolsRetrieval"
	ModifyAssistantRequestToolsTypeAssistantToolsFunction  ModifyAssistantRequestToolsType = "AssistantToolsFunction"
)

type ModifyMessageRequest

type ModifyMessageRequest struct {
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *ModifyMessageRequestMetadata `json:"metadata,omitempty"`
}

func (*ModifyMessageRequest) GetMetadata

type ModifyMessageRequestMetadata

type ModifyMessageRequestMetadata struct {
}

ModifyMessageRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type ModifyRunRequest

type ModifyRunRequest struct {
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *ModifyRunRequestMetadata `json:"metadata,omitempty"`
}

func (*ModifyRunRequest) GetMetadata

func (o *ModifyRunRequest) GetMetadata() *ModifyRunRequestMetadata

type ModifyRunRequestMetadata

type ModifyRunRequestMetadata struct {
}

ModifyRunRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type ModifyThreadRequest

type ModifyThreadRequest struct {
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *ModifyThreadRequestMetadata `json:"metadata,omitempty"`
}

func (*ModifyThreadRequest) GetMetadata

type ModifyThreadRequestMetadata

type ModifyThreadRequestMetadata struct {
}

ModifyThreadRequestMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type NEpochs

type NEpochs struct {
	CreateFineTuningJobRequestSchemasHyperparameters1 *CreateFineTuningJobRequestSchemasHyperparameters1
	Integer                                           *int64

	Type NEpochsType
}

NEpochs - The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

func CreateNEpochsCreateFineTuningJobRequestSchemasHyperparameters1

func CreateNEpochsCreateFineTuningJobRequestSchemasHyperparameters1(createFineTuningJobRequestSchemasHyperparameters1 CreateFineTuningJobRequestSchemasHyperparameters1) NEpochs

func CreateNEpochsInteger

func CreateNEpochsInteger(integer int64) NEpochs

func (NEpochs) MarshalJSON

func (u NEpochs) MarshalJSON() ([]byte, error)

func (*NEpochs) UnmarshalJSON

func (u *NEpochs) UnmarshalJSON(data []byte) error

type NEpochsType

type NEpochsType string
const (
	NEpochsTypeCreateFineTuningJobRequestSchemasHyperparameters1 NEpochsType = "CreateFineTuningJobRequest_Schemas_hyperparameters_1"
	NEpochsTypeInteger                                           NEpochsType = "integer"
)

type Object

type Object string

Object - The object type, which is always `assistant.file`.

const (
	ObjectAssistantFile Object = "assistant.file"
)

func (Object) ToPointer

func (e Object) ToPointer() *Object

func (*Object) UnmarshalJSON

func (e *Object) UnmarshalJSON(data []byte) error

type One

type One string

One - `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function.

const (
	OneNone One = "none"
	OneAuto One = "auto"
)

func (One) ToPointer

func (e One) ToPointer() *One

func (*One) UnmarshalJSON

func (e *One) UnmarshalJSON(data []byte) error

type OpenAIFile

type OpenAIFile struct {
	// The size of the file, in bytes.
	Bytes int64 `json:"bytes"`
	// The Unix timestamp (in seconds) for when the file was created.
	CreatedAt int64 `json:"created_at"`
	// The name of the file.
	Filename string `json:"filename"`
	// The file identifier, which can be referenced in the API endpoints.
	ID string `json:"id"`
	// The object type, which is always `file`.
	Object OpenAIFileObject `json:"object"`
	// The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`.
	Purpose OpenAIFilePurpose `json:"purpose"`
	// Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
	//
	// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
	Status OpenAIFileStatus `json:"status"`
	// Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
	//
	// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
	StatusDetails *string `json:"status_details,omitempty"`
}

OpenAIFile - The `File` object represents a document that has been uploaded to OpenAI.

func (*OpenAIFile) GetBytes

func (o *OpenAIFile) GetBytes() int64

func (*OpenAIFile) GetCreatedAt

func (o *OpenAIFile) GetCreatedAt() int64

func (*OpenAIFile) GetFilename

func (o *OpenAIFile) GetFilename() string

func (*OpenAIFile) GetID

func (o *OpenAIFile) GetID() string

func (*OpenAIFile) GetObject

func (o *OpenAIFile) GetObject() OpenAIFileObject

func (*OpenAIFile) GetPurpose

func (o *OpenAIFile) GetPurpose() OpenAIFilePurpose

func (*OpenAIFile) GetStatus

func (o *OpenAIFile) GetStatus() OpenAIFileStatus

func (*OpenAIFile) GetStatusDetails

func (o *OpenAIFile) GetStatusDetails() *string

type OpenAIFileObject

type OpenAIFileObject string

OpenAIFileObject - The object type, which is always `file`.

const (
	OpenAIFileObjectFile OpenAIFileObject = "file"
)

func (OpenAIFileObject) ToPointer

func (e OpenAIFileObject) ToPointer() *OpenAIFileObject

func (*OpenAIFileObject) UnmarshalJSON

func (e *OpenAIFileObject) UnmarshalJSON(data []byte) error

type OpenAIFilePurpose

type OpenAIFilePurpose string

OpenAIFilePurpose - The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`.

const (
	OpenAIFilePurposeFineTune         OpenAIFilePurpose = "fine-tune"
	OpenAIFilePurposeFineTuneResults  OpenAIFilePurpose = "fine-tune-results"
	OpenAIFilePurposeAssistants       OpenAIFilePurpose = "assistants"
	OpenAIFilePurposeAssistantsOutput OpenAIFilePurpose = "assistants_output"
)

func (OpenAIFilePurpose) ToPointer

func (e OpenAIFilePurpose) ToPointer() *OpenAIFilePurpose

func (*OpenAIFilePurpose) UnmarshalJSON

func (e *OpenAIFilePurpose) UnmarshalJSON(data []byte) error

type OpenAIFileStatus

type OpenAIFileStatus string

OpenAIFileStatus - Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.

Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.

const (
	OpenAIFileStatusUploaded  OpenAIFileStatus = "uploaded"
	OpenAIFileStatusProcessed OpenAIFileStatus = "processed"
	OpenAIFileStatusError     OpenAIFileStatus = "error"
)

func (OpenAIFileStatus) ToPointer

func (e OpenAIFileStatus) ToPointer() *OpenAIFileStatus

func (*OpenAIFileStatus) UnmarshalJSON

func (e *OpenAIFileStatus) UnmarshalJSON(data []byte) error

type Outputs

type Outputs struct {
	RunStepDetailsToolCallsCodeOutputLogsObject  *RunStepDetailsToolCallsCodeOutputLogsObject
	RunStepDetailsToolCallsCodeOutputImageObject *RunStepDetailsToolCallsCodeOutputImageObject

	Type OutputsType
}

func CreateOutputsRunStepDetailsToolCallsCodeOutputImageObject

func CreateOutputsRunStepDetailsToolCallsCodeOutputImageObject(runStepDetailsToolCallsCodeOutputImageObject RunStepDetailsToolCallsCodeOutputImageObject) Outputs

func CreateOutputsRunStepDetailsToolCallsCodeOutputLogsObject

func CreateOutputsRunStepDetailsToolCallsCodeOutputLogsObject(runStepDetailsToolCallsCodeOutputLogsObject RunStepDetailsToolCallsCodeOutputLogsObject) Outputs

func (Outputs) MarshalJSON

func (u Outputs) MarshalJSON() ([]byte, error)

func (*Outputs) UnmarshalJSON

func (u *Outputs) UnmarshalJSON(data []byte) error

type OutputsType

type OutputsType string
const (
	OutputsTypeRunStepDetailsToolCallsCodeOutputLogsObject  OutputsType = "RunStepDetailsToolCallsCodeOutputLogsObject"
	OutputsTypeRunStepDetailsToolCallsCodeOutputImageObject OutputsType = "RunStepDetailsToolCallsCodeOutputImageObject"
)

type Prompt

type Prompt struct {
	Str                   *string
	ArrayOfstr            []string
	ArrayOfinteger        []int64
	ArrayOfarrayOfinteger [][]int64

	Type PromptType
}

Prompt - The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.

Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.

func CreatePromptArrayOfarrayOfinteger

func CreatePromptArrayOfarrayOfinteger(arrayOfarrayOfinteger [][]int64) Prompt

func CreatePromptArrayOfinteger

func CreatePromptArrayOfinteger(arrayOfinteger []int64) Prompt

func CreatePromptArrayOfstr

func CreatePromptArrayOfstr(arrayOfstr []string) Prompt

func CreatePromptStr

func CreatePromptStr(str string) Prompt

func (Prompt) MarshalJSON

func (u Prompt) MarshalJSON() ([]byte, error)

func (*Prompt) UnmarshalJSON

func (u *Prompt) UnmarshalJSON(data []byte) error

type PromptType

type PromptType string
const (
	PromptTypeStr                   PromptType = "str"
	PromptTypeArrayOfstr            PromptType = "arrayOfstr"
	PromptTypeArrayOfinteger        PromptType = "arrayOfinteger"
	PromptTypeArrayOfarrayOfinteger PromptType = "arrayOfarrayOfinteger"
)

type Purpose

type Purpose string

Purpose - The intended purpose of the uploaded file.

Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning) and "assistants" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning.

const (
	PurposeFineTune   Purpose = "fine-tune"
	PurposeAssistants Purpose = "assistants"
)

func (Purpose) ToPointer

func (e Purpose) ToPointer() *Purpose

func (*Purpose) UnmarshalJSON

func (e *Purpose) UnmarshalJSON(data []byte) error

type Quality

type Quality string

Quality - The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.

const (
	QualityStandard Quality = "standard"
	QualityHd       Quality = "hd"
)

func (Quality) ToPointer

func (e Quality) ToPointer() *Quality

func (*Quality) UnmarshalJSON

func (e *Quality) UnmarshalJSON(data []byte) error

type RequiredAction

type RequiredAction struct {
	// Details on the tool outputs needed for this run to continue.
	SubmitToolOutputs SubmitToolOutputs `json:"submit_tool_outputs"`
	// For now, this is always `submit_tool_outputs`.
	Type RunObjectType `json:"type"`
}

RequiredAction - Details on the action required to continue the run. Will be `null` if no action is required.

func (*RequiredAction) GetSubmitToolOutputs

func (o *RequiredAction) GetSubmitToolOutputs() SubmitToolOutputs

func (*RequiredAction) GetType

func (o *RequiredAction) GetType() RunObjectType

type ResponseFormat

type ResponseFormat struct {
	// Must be one of `text` or `json_object`.
	Type *CreateChatCompletionRequestType `default:"text" json:"type"`
}

ResponseFormat - An object specifying the format that the model must output. Compatible with [GPT-4 Turbo](/docs/models/gpt-4-and-gpt-4-turbo) and all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.

Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.

**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.

func (*ResponseFormat) GetType

func (ResponseFormat) MarshalJSON

func (r ResponseFormat) MarshalJSON() ([]byte, error)

func (*ResponseFormat) UnmarshalJSON

func (r *ResponseFormat) UnmarshalJSON(data []byte) error

type Results

type Results struct {
	// A list of the categories, and whether they are flagged or not.
	Categories Categories `json:"categories"`
	// A list of the categories along with their scores as predicted by model.
	CategoryScores CategoryScores `json:"category_scores"`
	// Whether the content violates [OpenAI's usage policies](/policies/usage-policies).
	Flagged bool `json:"flagged"`
}

func (*Results) GetCategories

func (o *Results) GetCategories() Categories

func (*Results) GetCategoryScores

func (o *Results) GetCategoryScores() CategoryScores

func (*Results) GetFlagged

func (o *Results) GetFlagged() bool

type Retrieval

type Retrieval struct {
}

Retrieval - For now, this is always going to be an empty object.

type Role

type Role string

Role - The role of the messages author, in this case `assistant`.

const (
	RoleAssistant Role = "assistant"
)

func (Role) ToPointer

func (e Role) ToPointer() *Role

func (*Role) UnmarshalJSON

func (e *Role) UnmarshalJSON(data []byte) error

type RunCompletionUsage

type RunCompletionUsage struct {
	// Number of completion tokens used over the course of the run.
	CompletionTokens int64 `json:"completion_tokens"`
	// Number of prompt tokens used over the course of the run.
	PromptTokens int64 `json:"prompt_tokens"`
	// Total number of tokens used (prompt + completion).
	TotalTokens int64 `json:"total_tokens"`
}

RunCompletionUsage - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).

func (*RunCompletionUsage) GetCompletionTokens

func (o *RunCompletionUsage) GetCompletionTokens() int64

func (*RunCompletionUsage) GetPromptTokens

func (o *RunCompletionUsage) GetPromptTokens() int64

func (*RunCompletionUsage) GetTotalTokens

func (o *RunCompletionUsage) GetTotalTokens() int64

type RunObject

type RunObject struct {
	// The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.
	AssistantID string `json:"assistant_id"`
	// The Unix timestamp (in seconds) for when the run was cancelled.
	CancelledAt *int64 `json:"cancelled_at"`
	// The Unix timestamp (in seconds) for when the run was completed.
	CompletedAt *int64 `json:"completed_at"`
	// The Unix timestamp (in seconds) for when the run was created.
	CreatedAt int64 `json:"created_at"`
	// The Unix timestamp (in seconds) for when the run will expire.
	ExpiresAt int64 `json:"expires_at"`
	// The Unix timestamp (in seconds) for when the run failed.
	FailedAt *int64 `json:"failed_at"`
	// The list of [File](/docs/api-reference/files) IDs the [assistant](/docs/api-reference/assistants) used for this run.
	FileIds []string `json:"file_ids"`
	// The identifier, which can be referenced in API endpoints.
	ID string `json:"id"`
	// The instructions that the [assistant](/docs/api-reference/assistants) used for this run.
	Instructions string `json:"instructions"`
	// The last error associated with this run. Will be `null` if there are no errors.
	LastError *LastError `json:"last_error"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *RunObjectMetadata `json:"metadata"`
	// The model that the [assistant](/docs/api-reference/assistants) used for this run.
	Model string `json:"model"`
	// The object type, which is always `thread.run`.
	Object RunObjectObject `json:"object"`
	// Details on the action required to continue the run. Will be `null` if no action is required.
	RequiredAction *RequiredAction `json:"required_action"`
	// The Unix timestamp (in seconds) for when the run was started.
	StartedAt *int64 `json:"started_at"`
	// The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`.
	Status RunObjectStatus `json:"status"`
	// The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.
	ThreadID string `json:"thread_id"`
	// The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.
	Tools []RunObjectTools `json:"tools"`
	// Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).
	Usage *RunCompletionUsage `json:"usage"`
}

RunObject - Represents an execution run on a [thread](/docs/api-reference/threads).

func (*RunObject) GetAssistantID

func (o *RunObject) GetAssistantID() string

func (*RunObject) GetCancelledAt

func (o *RunObject) GetCancelledAt() *int64

func (*RunObject) GetCompletedAt

func (o *RunObject) GetCompletedAt() *int64

func (*RunObject) GetCreatedAt

func (o *RunObject) GetCreatedAt() int64

func (*RunObject) GetExpiresAt

func (o *RunObject) GetExpiresAt() int64

func (*RunObject) GetFailedAt

func (o *RunObject) GetFailedAt() *int64

func (*RunObject) GetFileIds

func (o *RunObject) GetFileIds() []string

func (*RunObject) GetID

func (o *RunObject) GetID() string

func (*RunObject) GetInstructions

func (o *RunObject) GetInstructions() string

func (*RunObject) GetLastError

func (o *RunObject) GetLastError() *LastError

func (*RunObject) GetMetadata

func (o *RunObject) GetMetadata() *RunObjectMetadata

func (*RunObject) GetModel

func (o *RunObject) GetModel() string

func (*RunObject) GetObject

func (o *RunObject) GetObject() RunObjectObject

func (*RunObject) GetRequiredAction

func (o *RunObject) GetRequiredAction() *RequiredAction

func (*RunObject) GetStartedAt

func (o *RunObject) GetStartedAt() *int64

func (*RunObject) GetStatus

func (o *RunObject) GetStatus() RunObjectStatus

func (*RunObject) GetThreadID

func (o *RunObject) GetThreadID() string

func (*RunObject) GetTools

func (o *RunObject) GetTools() []RunObjectTools

func (*RunObject) GetUsage

func (o *RunObject) GetUsage() *RunCompletionUsage

type RunObjectMetadata

type RunObjectMetadata struct {
}

RunObjectMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type RunObjectObject

type RunObjectObject string

RunObjectObject - The object type, which is always `thread.run`.

const (
	RunObjectObjectThreadRun RunObjectObject = "thread.run"
)

func (RunObjectObject) ToPointer

func (e RunObjectObject) ToPointer() *RunObjectObject

func (*RunObjectObject) UnmarshalJSON

func (e *RunObjectObject) UnmarshalJSON(data []byte) error

type RunObjectStatus

type RunObjectStatus string

RunObjectStatus - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`.

const (
	RunObjectStatusQueued         RunObjectStatus = "queued"
	RunObjectStatusInProgress     RunObjectStatus = "in_progress"
	RunObjectStatusRequiresAction RunObjectStatus = "requires_action"
	RunObjectStatusCancelling     RunObjectStatus = "cancelling"
	RunObjectStatusCancelled      RunObjectStatus = "cancelled"
	RunObjectStatusFailed         RunObjectStatus = "failed"
	RunObjectStatusCompleted      RunObjectStatus = "completed"
	RunObjectStatusExpired        RunObjectStatus = "expired"
)

func (RunObjectStatus) ToPointer

func (e RunObjectStatus) ToPointer() *RunObjectStatus

func (*RunObjectStatus) UnmarshalJSON

func (e *RunObjectStatus) UnmarshalJSON(data []byte) error

type RunObjectTools

type RunObjectTools struct {
	AssistantToolsCode      *AssistantToolsCode
	AssistantToolsRetrieval *AssistantToolsRetrieval
	AssistantToolsFunction  *AssistantToolsFunction

	Type RunObjectToolsType
}

func CreateRunObjectToolsAssistantToolsCode

func CreateRunObjectToolsAssistantToolsCode(assistantToolsCode AssistantToolsCode) RunObjectTools

func CreateRunObjectToolsAssistantToolsFunction

func CreateRunObjectToolsAssistantToolsFunction(assistantToolsFunction AssistantToolsFunction) RunObjectTools

func CreateRunObjectToolsAssistantToolsRetrieval

func CreateRunObjectToolsAssistantToolsRetrieval(assistantToolsRetrieval AssistantToolsRetrieval) RunObjectTools

func (RunObjectTools) MarshalJSON

func (u RunObjectTools) MarshalJSON() ([]byte, error)

func (*RunObjectTools) UnmarshalJSON

func (u *RunObjectTools) UnmarshalJSON(data []byte) error

type RunObjectToolsType

type RunObjectToolsType string
const (
	RunObjectToolsTypeAssistantToolsCode      RunObjectToolsType = "AssistantToolsCode"
	RunObjectToolsTypeAssistantToolsRetrieval RunObjectToolsType = "AssistantToolsRetrieval"
	RunObjectToolsTypeAssistantToolsFunction  RunObjectToolsType = "AssistantToolsFunction"
)

type RunObjectType

type RunObjectType string

RunObjectType - For now, this is always `submit_tool_outputs`.

const (
	RunObjectTypeSubmitToolOutputs RunObjectType = "submit_tool_outputs"
)

func (RunObjectType) ToPointer

func (e RunObjectType) ToPointer() *RunObjectType

func (*RunObjectType) UnmarshalJSON

func (e *RunObjectType) UnmarshalJSON(data []byte) error

type RunStepCompletionUsage

type RunStepCompletionUsage struct {
	// Number of completion tokens used over the course of the run step.
	CompletionTokens int64 `json:"completion_tokens"`
	// Number of prompt tokens used over the course of the run step.
	PromptTokens int64 `json:"prompt_tokens"`
	// Total number of tokens used (prompt + completion).
	TotalTokens int64 `json:"total_tokens"`
}

RunStepCompletionUsage - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.

func (*RunStepCompletionUsage) GetCompletionTokens

func (o *RunStepCompletionUsage) GetCompletionTokens() int64

func (*RunStepCompletionUsage) GetPromptTokens

func (o *RunStepCompletionUsage) GetPromptTokens() int64

func (*RunStepCompletionUsage) GetTotalTokens

func (o *RunStepCompletionUsage) GetTotalTokens() int64

type RunStepDetailsMessageCreationObject

type RunStepDetailsMessageCreationObject struct {
	MessageCreation MessageCreation `json:"message_creation"`
	// Always `message_creation`.
	Type RunStepDetailsMessageCreationObjectType `json:"type"`
}

RunStepDetailsMessageCreationObject - Details of the message creation by the run step.

func (*RunStepDetailsMessageCreationObject) GetMessageCreation

func (o *RunStepDetailsMessageCreationObject) GetMessageCreation() MessageCreation

func (*RunStepDetailsMessageCreationObject) GetType

type RunStepDetailsMessageCreationObjectType

type RunStepDetailsMessageCreationObjectType string

RunStepDetailsMessageCreationObjectType - Always `message_creation`.

const (
	RunStepDetailsMessageCreationObjectTypeMessageCreation RunStepDetailsMessageCreationObjectType = "message_creation"
)

func (RunStepDetailsMessageCreationObjectType) ToPointer

func (*RunStepDetailsMessageCreationObjectType) UnmarshalJSON

func (e *RunStepDetailsMessageCreationObjectType) UnmarshalJSON(data []byte) error

type RunStepDetailsToolCallsCodeObject

type RunStepDetailsToolCallsCodeObject struct {
	// The Code Interpreter tool call definition.
	CodeInterpreter CodeInterpreter `json:"code_interpreter"`
	// The ID of the tool call.
	ID string `json:"id"`
	// The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
	Type RunStepDetailsToolCallsCodeObjectType `json:"type"`
}

RunStepDetailsToolCallsCodeObject - Details of the Code Interpreter tool call the run step was involved in.

func (*RunStepDetailsToolCallsCodeObject) GetCodeInterpreter

func (o *RunStepDetailsToolCallsCodeObject) GetCodeInterpreter() CodeInterpreter

func (*RunStepDetailsToolCallsCodeObject) GetID

func (*RunStepDetailsToolCallsCodeObject) GetType

type RunStepDetailsToolCallsCodeObjectType

type RunStepDetailsToolCallsCodeObjectType string

RunStepDetailsToolCallsCodeObjectType - The type of tool call. This is always going to be `code_interpreter` for this type of tool call.

const (
	RunStepDetailsToolCallsCodeObjectTypeCodeInterpreter RunStepDetailsToolCallsCodeObjectType = "code_interpreter"
)

func (RunStepDetailsToolCallsCodeObjectType) ToPointer

func (*RunStepDetailsToolCallsCodeObjectType) UnmarshalJSON

func (e *RunStepDetailsToolCallsCodeObjectType) UnmarshalJSON(data []byte) error

type RunStepDetailsToolCallsCodeOutputImageObject

type RunStepDetailsToolCallsCodeOutputImageObject struct {
	Image RunStepDetailsToolCallsCodeOutputImageObjectImage `json:"image"`
	// Always `image`.
	Type RunStepDetailsToolCallsCodeOutputImageObjectType `json:"type"`
}

func (*RunStepDetailsToolCallsCodeOutputImageObject) GetImage

func (*RunStepDetailsToolCallsCodeOutputImageObject) GetType

type RunStepDetailsToolCallsCodeOutputImageObjectImage

type RunStepDetailsToolCallsCodeOutputImageObjectImage struct {
	// The [file](/docs/api-reference/files) ID of the image.
	FileID string `json:"file_id"`
}

func (*RunStepDetailsToolCallsCodeOutputImageObjectImage) GetFileID

type RunStepDetailsToolCallsCodeOutputImageObjectType

type RunStepDetailsToolCallsCodeOutputImageObjectType string

RunStepDetailsToolCallsCodeOutputImageObjectType - Always `image`.

const (
	RunStepDetailsToolCallsCodeOutputImageObjectTypeImage RunStepDetailsToolCallsCodeOutputImageObjectType = "image"
)

func (RunStepDetailsToolCallsCodeOutputImageObjectType) ToPointer

func (*RunStepDetailsToolCallsCodeOutputImageObjectType) UnmarshalJSON

type RunStepDetailsToolCallsCodeOutputLogsObject

type RunStepDetailsToolCallsCodeOutputLogsObject struct {
	// The text output from the Code Interpreter tool call.
	Logs string `json:"logs"`
	// Always `logs`.
	Type RunStepDetailsToolCallsCodeOutputLogsObjectType `json:"type"`
}

RunStepDetailsToolCallsCodeOutputLogsObject - Text output from the Code Interpreter tool call as part of a run step.

func (*RunStepDetailsToolCallsCodeOutputLogsObject) GetLogs

func (*RunStepDetailsToolCallsCodeOutputLogsObject) GetType

type RunStepDetailsToolCallsCodeOutputLogsObjectType

type RunStepDetailsToolCallsCodeOutputLogsObjectType string

RunStepDetailsToolCallsCodeOutputLogsObjectType - Always `logs`.

const (
	RunStepDetailsToolCallsCodeOutputLogsObjectTypeLogs RunStepDetailsToolCallsCodeOutputLogsObjectType = "logs"
)

func (RunStepDetailsToolCallsCodeOutputLogsObjectType) ToPointer

func (*RunStepDetailsToolCallsCodeOutputLogsObjectType) UnmarshalJSON

type RunStepDetailsToolCallsFunctionObject

type RunStepDetailsToolCallsFunctionObject struct {
	// The definition of the function that was called.
	Function RunStepDetailsToolCallsFunctionObjectFunction `json:"function"`
	// The ID of the tool call object.
	ID string `json:"id"`
	// The type of tool call. This is always going to be `function` for this type of tool call.
	Type RunStepDetailsToolCallsFunctionObjectType `json:"type"`
}

func (*RunStepDetailsToolCallsFunctionObject) GetFunction

func (*RunStepDetailsToolCallsFunctionObject) GetID

func (*RunStepDetailsToolCallsFunctionObject) GetType

type RunStepDetailsToolCallsFunctionObjectFunction

type RunStepDetailsToolCallsFunctionObjectFunction struct {
	// The arguments passed to the function.
	Arguments string `json:"arguments"`
	// The name of the function.
	Name string `json:"name"`
	// The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.
	Output *string `json:"output"`
}

RunStepDetailsToolCallsFunctionObjectFunction - The definition of the function that was called.

func (*RunStepDetailsToolCallsFunctionObjectFunction) GetArguments

func (*RunStepDetailsToolCallsFunctionObjectFunction) GetName

func (*RunStepDetailsToolCallsFunctionObjectFunction) GetOutput

type RunStepDetailsToolCallsFunctionObjectType

type RunStepDetailsToolCallsFunctionObjectType string

RunStepDetailsToolCallsFunctionObjectType - The type of tool call. This is always going to be `function` for this type of tool call.

const (
	RunStepDetailsToolCallsFunctionObjectTypeFunction RunStepDetailsToolCallsFunctionObjectType = "function"
)

func (RunStepDetailsToolCallsFunctionObjectType) ToPointer

func (*RunStepDetailsToolCallsFunctionObjectType) UnmarshalJSON

func (e *RunStepDetailsToolCallsFunctionObjectType) UnmarshalJSON(data []byte) error

type RunStepDetailsToolCallsObject

type RunStepDetailsToolCallsObject struct {
	// An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`.
	//
	ToolCalls []ToolCalls `json:"tool_calls"`
	// Always `tool_calls`.
	Type RunStepDetailsToolCallsObjectType `json:"type"`
}

RunStepDetailsToolCallsObject - Details of the tool call.

func (*RunStepDetailsToolCallsObject) GetToolCalls

func (o *RunStepDetailsToolCallsObject) GetToolCalls() []ToolCalls

func (*RunStepDetailsToolCallsObject) GetType

type RunStepDetailsToolCallsObjectType

type RunStepDetailsToolCallsObjectType string

RunStepDetailsToolCallsObjectType - Always `tool_calls`.

const (
	RunStepDetailsToolCallsObjectTypeToolCalls RunStepDetailsToolCallsObjectType = "tool_calls"
)

func (RunStepDetailsToolCallsObjectType) ToPointer

func (*RunStepDetailsToolCallsObjectType) UnmarshalJSON

func (e *RunStepDetailsToolCallsObjectType) UnmarshalJSON(data []byte) error

type RunStepDetailsToolCallsRetrievalObject

type RunStepDetailsToolCallsRetrievalObject struct {
	// The ID of the tool call object.
	ID string `json:"id"`
	// For now, this is always going to be an empty object.
	Retrieval Retrieval `json:"retrieval"`
	// The type of tool call. This is always going to be `retrieval` for this type of tool call.
	Type RunStepDetailsToolCallsRetrievalObjectType `json:"type"`
}

func (*RunStepDetailsToolCallsRetrievalObject) GetID

func (*RunStepDetailsToolCallsRetrievalObject) GetRetrieval

func (*RunStepDetailsToolCallsRetrievalObject) GetType

type RunStepDetailsToolCallsRetrievalObjectType

type RunStepDetailsToolCallsRetrievalObjectType string

RunStepDetailsToolCallsRetrievalObjectType - The type of tool call. This is always going to be `retrieval` for this type of tool call.

const (
	RunStepDetailsToolCallsRetrievalObjectTypeRetrieval RunStepDetailsToolCallsRetrievalObjectType = "retrieval"
)

func (RunStepDetailsToolCallsRetrievalObjectType) ToPointer

func (*RunStepDetailsToolCallsRetrievalObjectType) UnmarshalJSON

func (e *RunStepDetailsToolCallsRetrievalObjectType) UnmarshalJSON(data []byte) error

type RunStepObject

type RunStepObject struct {
	// The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.
	AssistantID string `json:"assistant_id"`
	// The Unix timestamp (in seconds) for when the run step was cancelled.
	CancelledAt *int64 `json:"cancelled_at"`
	// The Unix timestamp (in seconds) for when the run step completed.
	CompletedAt *int64 `json:"completed_at"`
	// The Unix timestamp (in seconds) for when the run step was created.
	CreatedAt int64 `json:"created_at"`
	// The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
	ExpiredAt *int64 `json:"expired_at"`
	// The Unix timestamp (in seconds) for when the run step failed.
	FailedAt *int64 `json:"failed_at"`
	// The identifier of the run step, which can be referenced in API endpoints.
	ID string `json:"id"`
	// The last error associated with this run step. Will be `null` if there are no errors.
	LastError *RunStepObjectLastError `json:"last_error"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *RunStepObjectMetadata `json:"metadata"`
	// The object type, which is always `thread.run.step`.
	Object RunStepObjectObject `json:"object"`
	// The ID of the [run](/docs/api-reference/runs) that this run step is a part of.
	RunID string `json:"run_id"`
	// The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
	Status RunStepObjectStatus `json:"status"`
	// The details of the run step.
	StepDetails StepDetails `json:"step_details"`
	// The ID of the [thread](/docs/api-reference/threads) that was run.
	ThreadID string `json:"thread_id"`
	// The type of run step, which can be either `message_creation` or `tool_calls`.
	Type RunStepObjectType `json:"type"`
	// Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
	Usage *RunStepCompletionUsage `json:"usage"`
}

RunStepObject - Represents a step in execution of a run.

func (*RunStepObject) GetAssistantID

func (o *RunStepObject) GetAssistantID() string

func (*RunStepObject) GetCancelledAt

func (o *RunStepObject) GetCancelledAt() *int64

func (*RunStepObject) GetCompletedAt

func (o *RunStepObject) GetCompletedAt() *int64

func (*RunStepObject) GetCreatedAt

func (o *RunStepObject) GetCreatedAt() int64

func (*RunStepObject) GetExpiredAt

func (o *RunStepObject) GetExpiredAt() *int64

func (*RunStepObject) GetFailedAt

func (o *RunStepObject) GetFailedAt() *int64

func (*RunStepObject) GetID

func (o *RunStepObject) GetID() string

func (*RunStepObject) GetLastError

func (o *RunStepObject) GetLastError() *RunStepObjectLastError

func (*RunStepObject) GetMetadata

func (o *RunStepObject) GetMetadata() *RunStepObjectMetadata

func (*RunStepObject) GetObject

func (o *RunStepObject) GetObject() RunStepObjectObject

func (*RunStepObject) GetRunID

func (o *RunStepObject) GetRunID() string

func (*RunStepObject) GetStatus

func (o *RunStepObject) GetStatus() RunStepObjectStatus

func (*RunStepObject) GetStepDetails

func (o *RunStepObject) GetStepDetails() StepDetails

func (*RunStepObject) GetThreadID

func (o *RunStepObject) GetThreadID() string

func (*RunStepObject) GetType

func (o *RunStepObject) GetType() RunStepObjectType

func (*RunStepObject) GetUsage

func (o *RunStepObject) GetUsage() *RunStepCompletionUsage

type RunStepObjectCode

type RunStepObjectCode string

RunStepObjectCode - One of `server_error` or `rate_limit_exceeded`.

const (
	RunStepObjectCodeServerError       RunStepObjectCode = "server_error"
	RunStepObjectCodeRateLimitExceeded RunStepObjectCode = "rate_limit_exceeded"
)

func (RunStepObjectCode) ToPointer

func (e RunStepObjectCode) ToPointer() *RunStepObjectCode

func (*RunStepObjectCode) UnmarshalJSON

func (e *RunStepObjectCode) UnmarshalJSON(data []byte) error

type RunStepObjectLastError

type RunStepObjectLastError struct {
	// One of `server_error` or `rate_limit_exceeded`.
	Code RunStepObjectCode `json:"code"`
	// A human-readable description of the error.
	Message string `json:"message"`
}

RunStepObjectLastError - The last error associated with this run step. Will be `null` if there are no errors.

func (*RunStepObjectLastError) GetCode

func (*RunStepObjectLastError) GetMessage

func (o *RunStepObjectLastError) GetMessage() string

type RunStepObjectMetadata

type RunStepObjectMetadata struct {
}

RunStepObjectMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type RunStepObjectObject

type RunStepObjectObject string

RunStepObjectObject - The object type, which is always `thread.run.step`.

const (
	RunStepObjectObjectThreadRunStep RunStepObjectObject = "thread.run.step"
)

func (RunStepObjectObject) ToPointer

func (*RunStepObjectObject) UnmarshalJSON

func (e *RunStepObjectObject) UnmarshalJSON(data []byte) error

type RunStepObjectStatus

type RunStepObjectStatus string

RunStepObjectStatus - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.

const (
	RunStepObjectStatusInProgress RunStepObjectStatus = "in_progress"
	RunStepObjectStatusCancelled  RunStepObjectStatus = "cancelled"
	RunStepObjectStatusFailed     RunStepObjectStatus = "failed"
	RunStepObjectStatusCompleted  RunStepObjectStatus = "completed"
	RunStepObjectStatusExpired    RunStepObjectStatus = "expired"
)

func (RunStepObjectStatus) ToPointer

func (*RunStepObjectStatus) UnmarshalJSON

func (e *RunStepObjectStatus) UnmarshalJSON(data []byte) error

type RunStepObjectType

type RunStepObjectType string

RunStepObjectType - The type of run step, which can be either `message_creation` or `tool_calls`.

const (
	RunStepObjectTypeMessageCreation RunStepObjectType = "message_creation"
	RunStepObjectTypeToolCalls       RunStepObjectType = "tool_calls"
)

func (RunStepObjectType) ToPointer

func (e RunStepObjectType) ToPointer() *RunStepObjectType

func (*RunStepObjectType) UnmarshalJSON

func (e *RunStepObjectType) UnmarshalJSON(data []byte) error

type RunToolCallObject

type RunToolCallObject struct {
	// The function definition.
	Function RunToolCallObjectFunction `json:"function"`
	// The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.
	ID string `json:"id"`
	// The type of tool call the output is required for. For now, this is always `function`.
	Type RunToolCallObjectType `json:"type"`
}

RunToolCallObject - Tool call objects

func (*RunToolCallObject) GetFunction

func (*RunToolCallObject) GetID

func (o *RunToolCallObject) GetID() string

func (*RunToolCallObject) GetType

type RunToolCallObjectFunction

type RunToolCallObjectFunction struct {
	// The arguments that the model expects you to pass to the function.
	Arguments string `json:"arguments"`
	// The name of the function.
	Name string `json:"name"`
}

RunToolCallObjectFunction - The function definition.

func (*RunToolCallObjectFunction) GetArguments

func (o *RunToolCallObjectFunction) GetArguments() string

func (*RunToolCallObjectFunction) GetName

func (o *RunToolCallObjectFunction) GetName() string

type RunToolCallObjectType

type RunToolCallObjectType string

RunToolCallObjectType - The type of tool call the output is required for. For now, this is always `function`.

const (
	RunToolCallObjectTypeFunction RunToolCallObjectType = "function"
)

func (RunToolCallObjectType) ToPointer

func (*RunToolCallObjectType) UnmarshalJSON

func (e *RunToolCallObjectType) UnmarshalJSON(data []byte) error

type Security

type Security struct {
	APIKeyAuth string `security:"scheme,type=http,subtype=bearer,name=Authorization"`
}

func (*Security) GetAPIKeyAuth

func (o *Security) GetAPIKeyAuth() string

type Size

type Size string

Size - The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.

const (
	SizeTwoHundredAndFiftySixx256     Size = "256x256"
	SizeFiveHundredAndTwelvex512      Size = "512x512"
	SizeOneThousandAndTwentyFourx1024 Size = "1024x1024"
)

func (Size) ToPointer

func (e Size) ToPointer() *Size

func (*Size) UnmarshalJSON

func (e *Size) UnmarshalJSON(data []byte) error

type Status

type Status string

Status - The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.

const (
	StatusValidatingFiles Status = "validating_files"
	StatusQueued          Status = "queued"
	StatusRunning         Status = "running"
	StatusSucceeded       Status = "succeeded"
	StatusFailed          Status = "failed"
	StatusCancelled       Status = "cancelled"
)

func (Status) ToPointer

func (e Status) ToPointer() *Status

func (*Status) UnmarshalJSON

func (e *Status) UnmarshalJSON(data []byte) error

type StepDetails

type StepDetails struct {
	RunStepDetailsMessageCreationObject *RunStepDetailsMessageCreationObject
	RunStepDetailsToolCallsObject       *RunStepDetailsToolCallsObject

	Type StepDetailsType
}

StepDetails - The details of the run step.

func CreateStepDetailsRunStepDetailsMessageCreationObject

func CreateStepDetailsRunStepDetailsMessageCreationObject(runStepDetailsMessageCreationObject RunStepDetailsMessageCreationObject) StepDetails

func CreateStepDetailsRunStepDetailsToolCallsObject

func CreateStepDetailsRunStepDetailsToolCallsObject(runStepDetailsToolCallsObject RunStepDetailsToolCallsObject) StepDetails

func (StepDetails) MarshalJSON

func (u StepDetails) MarshalJSON() ([]byte, error)

func (*StepDetails) UnmarshalJSON

func (u *StepDetails) UnmarshalJSON(data []byte) error

type StepDetailsType

type StepDetailsType string
const (
	StepDetailsTypeRunStepDetailsMessageCreationObject StepDetailsType = "RunStepDetailsMessageCreationObject"
	StepDetailsTypeRunStepDetailsToolCallsObject       StepDetailsType = "RunStepDetailsToolCallsObject"
)

type Stop

type Stop struct {
	Str        *string
	ArrayOfstr []string

	Type StopType
}

Stop - Up to 4 sequences where the API will stop generating further tokens.

func CreateStopArrayOfstr

func CreateStopArrayOfstr(arrayOfstr []string) Stop

func CreateStopStr

func CreateStopStr(str string) Stop

func (Stop) MarshalJSON

func (u Stop) MarshalJSON() ([]byte, error)

func (*Stop) UnmarshalJSON

func (u *Stop) UnmarshalJSON(data []byte) error

type StopType

type StopType string
const (
	StopTypeStr        StopType = "str"
	StopTypeArrayOfstr StopType = "arrayOfstr"
)

type Style

type Style string

Style - The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.

const (
	StyleVivid   Style = "vivid"
	StyleNatural Style = "natural"
)

func (Style) ToPointer

func (e Style) ToPointer() *Style

func (*Style) UnmarshalJSON

func (e *Style) UnmarshalJSON(data []byte) error

type SubmitToolOutputs

type SubmitToolOutputs struct {
	// A list of the relevant tool calls.
	ToolCalls []RunToolCallObject `json:"tool_calls"`
}

SubmitToolOutputs - Details on the tool outputs needed for this run to continue.

func (*SubmitToolOutputs) GetToolCalls

func (o *SubmitToolOutputs) GetToolCalls() []RunToolCallObject

type SubmitToolOutputsRunRequest

type SubmitToolOutputsRunRequest struct {
	// A list of tools for which the outputs are being submitted.
	ToolOutputs []ToolOutputs `json:"tool_outputs"`
}

func (*SubmitToolOutputsRunRequest) GetToolOutputs

func (o *SubmitToolOutputsRunRequest) GetToolOutputs() []ToolOutputs

type Text

type Text struct {
	Annotations []Annotations `json:"annotations"`
	// The data that makes up the text.
	Value string `json:"value"`
}

func (*Text) GetAnnotations

func (o *Text) GetAnnotations() []Annotations

func (*Text) GetValue

func (o *Text) GetValue() string

type ThreadObject

type ThreadObject struct {
	// The Unix timestamp (in seconds) for when the thread was created.
	CreatedAt int64 `json:"created_at"`
	// The identifier, which can be referenced in API endpoints.
	ID string `json:"id"`
	// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
	//
	Metadata *ThreadObjectMetadata `json:"metadata"`
	// The object type, which is always `thread`.
	Object ThreadObjectObject `json:"object"`
}

ThreadObject - Represents a thread that contains [messages](/docs/api-reference/messages).

func (*ThreadObject) GetCreatedAt

func (o *ThreadObject) GetCreatedAt() int64

func (*ThreadObject) GetID

func (o *ThreadObject) GetID() string

func (*ThreadObject) GetMetadata

func (o *ThreadObject) GetMetadata() *ThreadObjectMetadata

func (*ThreadObject) GetObject

func (o *ThreadObject) GetObject() ThreadObjectObject

type ThreadObjectMetadata

type ThreadObjectMetadata struct {
}

ThreadObjectMetadata - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

type ThreadObjectObject

type ThreadObjectObject string

ThreadObjectObject - The object type, which is always `thread`.

const (
	ThreadObjectObjectThread ThreadObjectObject = "thread"
)

func (ThreadObjectObject) ToPointer

func (e ThreadObjectObject) ToPointer() *ThreadObjectObject

func (*ThreadObjectObject) UnmarshalJSON

func (e *ThreadObjectObject) UnmarshalJSON(data []byte) error

type TimestampGranularities

type TimestampGranularities string
const (
	TimestampGranularitiesWord    TimestampGranularities = "word"
	TimestampGranularitiesSegment TimestampGranularities = "segment"
)

func (TimestampGranularities) ToPointer

func (*TimestampGranularities) UnmarshalJSON

func (e *TimestampGranularities) UnmarshalJSON(data []byte) error

type ToolCalls

type ToolCalls struct {
	RunStepDetailsToolCallsCodeObject      *RunStepDetailsToolCallsCodeObject
	RunStepDetailsToolCallsRetrievalObject *RunStepDetailsToolCallsRetrievalObject
	RunStepDetailsToolCallsFunctionObject  *RunStepDetailsToolCallsFunctionObject

	Type ToolCallsType
}

func CreateToolCallsRunStepDetailsToolCallsCodeObject

func CreateToolCallsRunStepDetailsToolCallsCodeObject(runStepDetailsToolCallsCodeObject RunStepDetailsToolCallsCodeObject) ToolCalls

func CreateToolCallsRunStepDetailsToolCallsFunctionObject

func CreateToolCallsRunStepDetailsToolCallsFunctionObject(runStepDetailsToolCallsFunctionObject RunStepDetailsToolCallsFunctionObject) ToolCalls

func CreateToolCallsRunStepDetailsToolCallsRetrievalObject

func CreateToolCallsRunStepDetailsToolCallsRetrievalObject(runStepDetailsToolCallsRetrievalObject RunStepDetailsToolCallsRetrievalObject) ToolCalls

func (ToolCalls) MarshalJSON

func (u ToolCalls) MarshalJSON() ([]byte, error)

func (*ToolCalls) UnmarshalJSON

func (u *ToolCalls) UnmarshalJSON(data []byte) error

type ToolCallsType

type ToolCallsType string
const (
	ToolCallsTypeRunStepDetailsToolCallsCodeObject      ToolCallsType = "RunStepDetailsToolCallsCodeObject"
	ToolCallsTypeRunStepDetailsToolCallsRetrievalObject ToolCallsType = "RunStepDetailsToolCallsRetrievalObject"
	ToolCallsTypeRunStepDetailsToolCallsFunctionObject  ToolCallsType = "RunStepDetailsToolCallsFunctionObject"
)

type ToolOutputs

type ToolOutputs struct {
	// The output of the tool call to be submitted to continue the run.
	Output *string `json:"output,omitempty"`
	// The ID of the tool call in the `required_action` object within the run object the output is being submitted for.
	ToolCallID *string `json:"tool_call_id,omitempty"`
}

func (*ToolOutputs) GetOutput

func (o *ToolOutputs) GetOutput() *string

func (*ToolOutputs) GetToolCallID

func (o *ToolOutputs) GetToolCallID() *string

type Tools

type Tools struct {
	AssistantToolsCode      *AssistantToolsCode
	AssistantToolsRetrieval *AssistantToolsRetrieval
	AssistantToolsFunction  *AssistantToolsFunction

	Type ToolsType
}

func CreateToolsAssistantToolsCode

func CreateToolsAssistantToolsCode(assistantToolsCode AssistantToolsCode) Tools

func CreateToolsAssistantToolsFunction

func CreateToolsAssistantToolsFunction(assistantToolsFunction AssistantToolsFunction) Tools

func CreateToolsAssistantToolsRetrieval

func CreateToolsAssistantToolsRetrieval(assistantToolsRetrieval AssistantToolsRetrieval) Tools

func (Tools) MarshalJSON

func (u Tools) MarshalJSON() ([]byte, error)

func (*Tools) UnmarshalJSON

func (u *Tools) UnmarshalJSON(data []byte) error

type ToolsType

type ToolsType string
const (
	ToolsTypeAssistantToolsCode      ToolsType = "AssistantToolsCode"
	ToolsTypeAssistantToolsRetrieval ToolsType = "AssistantToolsRetrieval"
	ToolsTypeAssistantToolsFunction  ToolsType = "AssistantToolsFunction"
)

type TopLogprobs

type TopLogprobs struct {
	// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
	Bytes []int64 `json:"bytes"`
	// The log probability of this token.
	Logprob float64 `json:"logprob"`
	// The token.
	Token string `json:"token"`
}

func (*TopLogprobs) GetBytes

func (o *TopLogprobs) GetBytes() []int64

func (*TopLogprobs) GetLogprob

func (o *TopLogprobs) GetLogprob() float64

func (*TopLogprobs) GetToken

func (o *TopLogprobs) GetToken() string

type Two

type Two string
const (
	TwoGpt40125Preview   Two = "gpt-4-0125-preview"
	TwoGpt4TurboPreview  Two = "gpt-4-turbo-preview"
	TwoGpt41106Preview   Two = "gpt-4-1106-preview"
	TwoGpt4VisionPreview Two = "gpt-4-vision-preview"
	TwoGpt4              Two = "gpt-4"
	TwoGpt40314          Two = "gpt-4-0314"
	TwoGpt40613          Two = "gpt-4-0613"
	TwoGpt432k           Two = "gpt-4-32k"
	TwoGpt432k0314       Two = "gpt-4-32k-0314"
	TwoGpt432k0613       Two = "gpt-4-32k-0613"
	TwoGpt35Turbo        Two = "gpt-3.5-turbo"
	TwoGpt35Turbo16k     Two = "gpt-3.5-turbo-16k"
	TwoGpt35Turbo0301    Two = "gpt-3.5-turbo-0301"
	TwoGpt35Turbo0613    Two = "gpt-3.5-turbo-0613"
	TwoGpt35Turbo1106    Two = "gpt-3.5-turbo-1106"
	TwoGpt35Turbo0125    Two = "gpt-3.5-turbo-0125"
	TwoGpt35Turbo16k0613 Two = "gpt-3.5-turbo-16k-0613"
)

func (Two) ToPointer

func (e Two) ToPointer() *Two

func (*Two) UnmarshalJSON

func (e *Two) UnmarshalJSON(data []byte) error

type Type

type Type string

Type - The type of tool being defined: `code_interpreter`

const (
	TypeCodeInterpreter Type = "code_interpreter"
)

func (Type) ToPointer

func (e Type) ToPointer() *Type

func (*Type) UnmarshalJSON

func (e *Type) UnmarshalJSON(data []byte) error

type Usage

type Usage struct {
	// The number of tokens used by the prompt.
	PromptTokens int64 `json:"prompt_tokens"`
	// The total number of tokens used by the request.
	TotalTokens int64 `json:"total_tokens"`
}

Usage - The usage information for the request.

func (*Usage) GetPromptTokens

func (o *Usage) GetPromptTokens() int64

func (*Usage) GetTotalTokens

func (o *Usage) GetTotalTokens() int64

type Voice

type Voice string

Voice - The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech/voice-options).

const (
	VoiceAlloy   Voice = "alloy"
	VoiceEcho    Voice = "echo"
	VoiceFable   Voice = "fable"
	VoiceOnyx    Voice = "onyx"
	VoiceNova    Voice = "nova"
	VoiceShimmer Voice = "shimmer"
)

func (Voice) ToPointer

func (e Voice) ToPointer() *Voice

func (*Voice) UnmarshalJSON

func (e *Voice) UnmarshalJSON(data []byte) error

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL