api

package
v0.0.0-...-2c50256 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type CancelFineTuneParams

type CancelFineTuneParams struct {
	// The ID of the fine-tune job to cancel.
	FineTuneID string
}

CancelFineTuneParams is parameters of cancelFineTune operation.

type ChatCompletionRequestMessage

type ChatCompletionRequestMessage struct {
	// The role of the author of this message.
	Role ChatCompletionRequestMessageRole `json:"role"`
	// The contents of the message.
	Content string `json:"content"`
	// The name of the user in a multi-user chat.
	Name OptString `json:"name"`
}

Ref: #/components/schemas/ChatCompletionRequestMessage

func (*ChatCompletionRequestMessage) Decode

Decode decodes ChatCompletionRequestMessage from json.

func (*ChatCompletionRequestMessage) Encode

func (s *ChatCompletionRequestMessage) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ChatCompletionRequestMessage) GetContent

func (s *ChatCompletionRequestMessage) GetContent() string

GetContent returns the value of Content.

func (*ChatCompletionRequestMessage) GetName

GetName returns the value of Name.

func (*ChatCompletionRequestMessage) GetRole

GetRole returns the value of Role.

func (*ChatCompletionRequestMessage) MarshalJSON

func (s *ChatCompletionRequestMessage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionRequestMessage) SetContent

func (s *ChatCompletionRequestMessage) SetContent(val string)

SetContent sets the value of Content.

func (*ChatCompletionRequestMessage) SetName

func (s *ChatCompletionRequestMessage) SetName(val OptString)

SetName sets the value of Name.

func (*ChatCompletionRequestMessage) SetRole

SetRole sets the value of Role.

func (*ChatCompletionRequestMessage) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionRequestMessage) Validate

func (s *ChatCompletionRequestMessage) Validate() error

type ChatCompletionRequestMessageRole

type ChatCompletionRequestMessageRole string

The role of the author of this message.

const (
	ChatCompletionRequestMessageRoleSystem    ChatCompletionRequestMessageRole = "system"
	ChatCompletionRequestMessageRoleUser      ChatCompletionRequestMessageRole = "user"
	ChatCompletionRequestMessageRoleAssistant ChatCompletionRequestMessageRole = "assistant"
)

func (ChatCompletionRequestMessageRole) AllValues

AllValues returns all ChatCompletionRequestMessageRole values.

func (*ChatCompletionRequestMessageRole) Decode

Decode decodes ChatCompletionRequestMessageRole from json.

func (ChatCompletionRequestMessageRole) Encode

Encode encodes ChatCompletionRequestMessageRole as json.

func (ChatCompletionRequestMessageRole) MarshalJSON

func (s ChatCompletionRequestMessageRole) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionRequestMessageRole) MarshalText

func (s ChatCompletionRequestMessageRole) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionRequestMessageRole) UnmarshalJSON

func (s *ChatCompletionRequestMessageRole) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionRequestMessageRole) UnmarshalText

func (s *ChatCompletionRequestMessageRole) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionRequestMessageRole) Validate

type ChatCompletionResponseMessage

type ChatCompletionResponseMessage struct {
	// The role of the author of this message.
	Role ChatCompletionResponseMessageRole `json:"role"`
	// The contents of the message.
	Content string `json:"content"`
}

Ref: #/components/schemas/ChatCompletionResponseMessage

func (*ChatCompletionResponseMessage) Decode

Decode decodes ChatCompletionResponseMessage from json.

func (*ChatCompletionResponseMessage) Encode

Encode implements json.Marshaler.

func (*ChatCompletionResponseMessage) GetContent

func (s *ChatCompletionResponseMessage) GetContent() string

GetContent returns the value of Content.

func (*ChatCompletionResponseMessage) GetRole

GetRole returns the value of Role.

func (*ChatCompletionResponseMessage) MarshalJSON

func (s *ChatCompletionResponseMessage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionResponseMessage) SetContent

func (s *ChatCompletionResponseMessage) SetContent(val string)

SetContent sets the value of Content.

func (*ChatCompletionResponseMessage) SetRole

SetRole sets the value of Role.

func (*ChatCompletionResponseMessage) UnmarshalJSON

func (s *ChatCompletionResponseMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionResponseMessage) Validate

func (s *ChatCompletionResponseMessage) Validate() error

type ChatCompletionResponseMessageRole

type ChatCompletionResponseMessageRole string

The role of the author of this message.

const (
	ChatCompletionResponseMessageRoleSystem    ChatCompletionResponseMessageRole = "system"
	ChatCompletionResponseMessageRoleUser      ChatCompletionResponseMessageRole = "user"
	ChatCompletionResponseMessageRoleAssistant ChatCompletionResponseMessageRole = "assistant"
)

func (ChatCompletionResponseMessageRole) AllValues

AllValues returns all ChatCompletionResponseMessageRole values.

func (*ChatCompletionResponseMessageRole) Decode

Decode decodes ChatCompletionResponseMessageRole from json.

func (ChatCompletionResponseMessageRole) Encode

Encode encodes ChatCompletionResponseMessageRole as json.

func (ChatCompletionResponseMessageRole) MarshalJSON

func (s ChatCompletionResponseMessageRole) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionResponseMessageRole) MarshalText

func (s ChatCompletionResponseMessageRole) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionResponseMessageRole) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionResponseMessageRole) UnmarshalText

func (s *ChatCompletionResponseMessageRole) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionResponseMessageRole) Validate

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) CancelFineTune

func (c *Client) CancelFineTune(ctx context.Context, params CancelFineTuneParams) (FineTune, error)

CancelFineTune invokes cancelFineTune operation.

Immediately cancel a fine-tune job.

POST /fine-tunes/{fine_tune_id}/cancel

func (*Client) CreateAnswer deprecated

func (c *Client) CreateAnswer(ctx context.Context, request *CreateAnswerRequest) (*CreateAnswerResponse, error)

CreateAnswer invokes createAnswer operation.

Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).

Deprecated: schema marks this operation as deprecated.

POST /answers

func (*Client) CreateChatCompletion

func (c *Client) CreateChatCompletion(ctx context.Context, request *CreateChatCompletionRequest) (*CreateChatCompletionResponse, error)

CreateChatCompletion invokes createChatCompletion operation.

Creates a completion for the chat message.

POST /chat/completions

func (*Client) CreateClassification deprecated

func (c *Client) CreateClassification(ctx context.Context, request *CreateClassificationRequest) (*CreateClassificationResponse, error)

CreateClassification invokes createClassification operation.

Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.

Deprecated: schema marks this operation as deprecated.

POST /classifications

func (*Client) CreateCompletion

func (c *Client) CreateCompletion(ctx context.Context, request *CreateCompletionRequest) (*CreateCompletionResponse, error)

CreateCompletion invokes createCompletion operation.

Creates a completion for the provided prompt and parameters.

POST /completions

func (*Client) CreateEdit

func (c *Client) CreateEdit(ctx context.Context, request *CreateEditRequest) (*CreateEditResponse, error)

CreateEdit invokes createEdit operation.

Creates a new edit for the provided input, instruction, and parameters.

POST /edits

func (*Client) CreateEmbedding

func (c *Client) CreateEmbedding(ctx context.Context, request *CreateEmbeddingRequest) (*CreateEmbeddingResponse, error)

CreateEmbedding invokes createEmbedding operation.

Creates an embedding vector representing the input text.

POST /embeddings

func (*Client) CreateFile

func (c *Client) CreateFile(ctx context.Context, request *CreateFileRequestMultipart) (OpenAIFile, error)

CreateFile invokes createFile operation.

Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.

POST /files

func (*Client) CreateFineTune

func (c *Client) CreateFineTune(ctx context.Context, request *CreateFineTuneRequest) (FineTune, error)

CreateFineTune invokes createFineTune operation.

Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning).

POST /fine-tunes

func (*Client) CreateImage

func (c *Client) CreateImage(ctx context.Context, request *CreateImageRequest) (ImagesResponse, error)

CreateImage invokes createImage operation.

Creates an image given a prompt.

POST /images/generations

func (*Client) CreateImageEdit

func (c *Client) CreateImageEdit(ctx context.Context, request *CreateImageEditRequestMultipart) (ImagesResponse, error)

CreateImageEdit invokes createImageEdit operation.

Creates an edited or extended image given an original image and a prompt.

POST /images/edits

func (*Client) CreateImageVariation

func (c *Client) CreateImageVariation(ctx context.Context, request *CreateImageVariationRequestMultipart) (ImagesResponse, error)

CreateImageVariation invokes createImageVariation operation.

Creates a variation of a given image.

POST /images/variations

func (*Client) CreateModeration

func (c *Client) CreateModeration(ctx context.Context, request *CreateModerationRequest) (*CreateModerationResponse, error)

CreateModeration invokes createModeration operation.

Classifies if text violates OpenAI's Content Policy.

POST /moderations

func (*Client) CreateSearch deprecated

func (c *Client) CreateSearch(ctx context.Context, request *CreateSearchRequest, params CreateSearchParams) (*CreateSearchResponse, error)

CreateSearch invokes createSearch operation.

The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.

Deprecated: schema marks this operation as deprecated.

POST /engines/{engine_id}/search

func (*Client) CreateTranscription

CreateTranscription invokes createTranscription operation.

Transcribes audio into the input language.

POST /audio/transcriptions

func (*Client) CreateTranslation

CreateTranslation invokes createTranslation operation.

Translates audio into into English.

POST /audio/translations

func (*Client) DeleteFile

func (c *Client) DeleteFile(ctx context.Context, params DeleteFileParams) (*DeleteFileResponse, error)

DeleteFile invokes deleteFile operation.

Delete a file.

DELETE /files/{file_id}

func (*Client) DeleteModel

func (c *Client) DeleteModel(ctx context.Context, params DeleteModelParams) (*DeleteModelResponse, error)

DeleteModel invokes deleteModel operation.

Delete a fine-tuned model. You must have the Owner role in your organization.

DELETE /models/{model}

func (*Client) DownloadFile

func (c *Client) DownloadFile(ctx context.Context, params DownloadFileParams) (string, error)

DownloadFile invokes downloadFile operation.

Returns the contents of the specified file.

GET /files/{file_id}/content

func (*Client) ListEngines deprecated

func (c *Client) ListEngines(ctx context.Context) (*ListEnginesResponse, error)

ListEngines invokes listEngines operation.

Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.

Deprecated: schema marks this operation as deprecated.

GET /engines

func (*Client) ListFiles

func (c *Client) ListFiles(ctx context.Context) (*ListFilesResponse, error)

ListFiles invokes listFiles operation.

Returns a list of files that belong to the user's organization.

GET /files

func (*Client) ListFineTuneEvents

func (c *Client) ListFineTuneEvents(ctx context.Context, params ListFineTuneEventsParams) (*ListFineTuneEventsResponse, error)

ListFineTuneEvents invokes listFineTuneEvents operation.

Get fine-grained status updates for a fine-tune job.

GET /fine-tunes/{fine_tune_id}/events

func (*Client) ListFineTunes

func (c *Client) ListFineTunes(ctx context.Context) (*ListFineTunesResponse, error)

ListFineTunes invokes listFineTunes operation.

List your organization's fine-tuning jobs.

GET /fine-tunes

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context) (*ListModelsResponse, error)

ListModels invokes listModels operation.

Lists the currently available models, and provides basic information about each one such as the owner and availability.

GET /models

func (*Client) RetrieveEngine deprecated

func (c *Client) RetrieveEngine(ctx context.Context, params RetrieveEngineParams) (Engine, error)

RetrieveEngine invokes retrieveEngine operation.

Retrieves a model instance, providing basic information about it such as the owner and availability.

Deprecated: schema marks this operation as deprecated.

GET /engines/{engine_id}

func (*Client) RetrieveFile

func (c *Client) RetrieveFile(ctx context.Context, params RetrieveFileParams) (OpenAIFile, error)

RetrieveFile invokes retrieveFile operation.

Returns information about a specific file.

GET /files/{file_id}

func (*Client) RetrieveFineTune

func (c *Client) RetrieveFineTune(ctx context.Context, params RetrieveFineTuneParams) (FineTune, error)

RetrieveFineTune invokes retrieveFineTune operation.

Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning).

GET /fine-tunes/{fine_tune_id}

func (*Client) RetrieveModel

func (c *Client) RetrieveModel(ctx context.Context, params RetrieveModelParams) (Model, error)

RetrieveModel invokes retrieveModel operation.

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

GET /models/{model}

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type CreateAnswerRequest

type CreateAnswerRequest struct {
	// ID of the model to use for completion. You can select one of `ada`, `babbage`, `curie`, or
	// `davinci`.
	Model string `json:"model"`
	// Question to get answered.
	Question string `json:"question"`
	// List of (question, answer) pairs that will help steer the model towards the tone and answer format
	// you'd like. We recommend adding 2 to 3 examples.
	Examples [][]string `json:"examples"`
	// A text snippet containing the contextual information used to generate the answers for the
	// `examples` you provide.
	ExamplesContext string `json:"examples_context"`
	// List of documents from which the answer for the input `question` should be derived. If this is an
	// empty list, the question will be answered based on the question-answer examples.
	// You should specify either `documents` or a `file`, but not both.
	Documents OptNilStringArray `json:"documents"`
	// The ID of an uploaded file that contains documents to search over. See [upload
	// file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose.
	// You should specify either `documents` or a `file`, but not both.
	File OptNilString `json:"file"`
	// ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of
	// `ada`, `babbage`, `curie`, or `davinci`.
	SearchModel OptNilString `json:"search_model"`
	// The maximum number of documents to be ranked by [Search](/docs/api-reference/searches/create) when
	// using `file`. Setting it to a higher value leads to improved accuracy but with increased latency
	// and cost.
	MaxRerank OptNilInt `json:"max_rerank"`
	// 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.
	Temperature OptNilFloat64 `json:"temperature"`
	// Include the log probabilities on the `logprobs` most likely 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. If you need more than this, please contact us through our
	// [Help center](https://help.openai.com) and describe your use case.
	// When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
	Logprobs OptNilInt `json:"logprobs"`
	// The maximum number of tokens allowed for the generated answer.
	MaxTokens OptNilInt `json:"max_tokens"`
	// Up to 4 sequences where the API will stop generating further tokens. The returned text will not
	// contain the stop sequence.
	Stop OptNilCreateAnswerRequestStop `json:"stop"`
	// How many answers to generate for each question.
	N OptNilInt `json:"n"`
	// 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)
	// (which works for both GPT-2 and GPT-3) 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 OptCreateAnswerRequestLogitBias `json:"logit_bias"`
	// A special boolean flag for showing metadata. If set to `true`, each document entry in the returned
	// JSON will contain a "metadata" field.
	// This flag only takes effect when `file` is set.
	ReturnMetadata OptNilBool `json:"return_metadata"`
	// If set to `true`, the returned JSON will include a "prompt" field containing the final prompt that
	// was used to request a completion. This is mainly useful for debugging purposes.
	ReturnPrompt OptNilBool `json:"return_prompt"`
	// If an object name is in the list, we provide the full information of the object; otherwise, we
	// only provide the object ID. Currently we support `completion` and `file` objects for expansion.
	Expand OptNilAnyArray `json:"expand"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateAnswerRequest

func (*CreateAnswerRequest) Decode

func (s *CreateAnswerRequest) Decode(d *jx.Decoder) error

Decode decodes CreateAnswerRequest from json.

func (*CreateAnswerRequest) Encode

func (s *CreateAnswerRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateAnswerRequest) GetDocuments

func (s *CreateAnswerRequest) GetDocuments() OptNilStringArray

GetDocuments returns the value of Documents.

func (*CreateAnswerRequest) GetExamples

func (s *CreateAnswerRequest) GetExamples() [][]string

GetExamples returns the value of Examples.

func (*CreateAnswerRequest) GetExamplesContext

func (s *CreateAnswerRequest) GetExamplesContext() string

GetExamplesContext returns the value of ExamplesContext.

func (*CreateAnswerRequest) GetExpand

func (s *CreateAnswerRequest) GetExpand() OptNilAnyArray

GetExpand returns the value of Expand.

func (*CreateAnswerRequest) GetFile

func (s *CreateAnswerRequest) GetFile() OptNilString

GetFile returns the value of File.

func (*CreateAnswerRequest) GetLogitBias

GetLogitBias returns the value of LogitBias.

func (*CreateAnswerRequest) GetLogprobs

func (s *CreateAnswerRequest) GetLogprobs() OptNilInt

GetLogprobs returns the value of Logprobs.

func (*CreateAnswerRequest) GetMaxRerank

func (s *CreateAnswerRequest) GetMaxRerank() OptNilInt

GetMaxRerank returns the value of MaxRerank.

func (*CreateAnswerRequest) GetMaxTokens

func (s *CreateAnswerRequest) GetMaxTokens() OptNilInt

GetMaxTokens returns the value of MaxTokens.

func (*CreateAnswerRequest) GetModel

func (s *CreateAnswerRequest) GetModel() string

GetModel returns the value of Model.

func (*CreateAnswerRequest) GetN

func (s *CreateAnswerRequest) GetN() OptNilInt

GetN returns the value of N.

func (*CreateAnswerRequest) GetQuestion

func (s *CreateAnswerRequest) GetQuestion() string

GetQuestion returns the value of Question.

func (*CreateAnswerRequest) GetReturnMetadata

func (s *CreateAnswerRequest) GetReturnMetadata() OptNilBool

GetReturnMetadata returns the value of ReturnMetadata.

func (*CreateAnswerRequest) GetReturnPrompt

func (s *CreateAnswerRequest) GetReturnPrompt() OptNilBool

GetReturnPrompt returns the value of ReturnPrompt.

func (*CreateAnswerRequest) GetSearchModel

func (s *CreateAnswerRequest) GetSearchModel() OptNilString

GetSearchModel returns the value of SearchModel.

func (*CreateAnswerRequest) GetStop

GetStop returns the value of Stop.

func (*CreateAnswerRequest) GetTemperature

func (s *CreateAnswerRequest) GetTemperature() OptNilFloat64

GetTemperature returns the value of Temperature.

func (*CreateAnswerRequest) GetUser

func (s *CreateAnswerRequest) GetUser() OptString

GetUser returns the value of User.

func (*CreateAnswerRequest) MarshalJSON

func (s *CreateAnswerRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateAnswerRequest) SetDocuments

func (s *CreateAnswerRequest) SetDocuments(val OptNilStringArray)

SetDocuments sets the value of Documents.

func (*CreateAnswerRequest) SetExamples

func (s *CreateAnswerRequest) SetExamples(val [][]string)

SetExamples sets the value of Examples.

func (*CreateAnswerRequest) SetExamplesContext

func (s *CreateAnswerRequest) SetExamplesContext(val string)

SetExamplesContext sets the value of ExamplesContext.

func (*CreateAnswerRequest) SetExpand

func (s *CreateAnswerRequest) SetExpand(val OptNilAnyArray)

SetExpand sets the value of Expand.

func (*CreateAnswerRequest) SetFile

func (s *CreateAnswerRequest) SetFile(val OptNilString)

SetFile sets the value of File.

func (*CreateAnswerRequest) SetLogitBias

SetLogitBias sets the value of LogitBias.

func (*CreateAnswerRequest) SetLogprobs

func (s *CreateAnswerRequest) SetLogprobs(val OptNilInt)

SetLogprobs sets the value of Logprobs.

func (*CreateAnswerRequest) SetMaxRerank

func (s *CreateAnswerRequest) SetMaxRerank(val OptNilInt)

SetMaxRerank sets the value of MaxRerank.

func (*CreateAnswerRequest) SetMaxTokens

func (s *CreateAnswerRequest) SetMaxTokens(val OptNilInt)

SetMaxTokens sets the value of MaxTokens.

func (*CreateAnswerRequest) SetModel

func (s *CreateAnswerRequest) SetModel(val string)

SetModel sets the value of Model.

func (*CreateAnswerRequest) SetN

func (s *CreateAnswerRequest) SetN(val OptNilInt)

SetN sets the value of N.

func (*CreateAnswerRequest) SetQuestion

func (s *CreateAnswerRequest) SetQuestion(val string)

SetQuestion sets the value of Question.

func (*CreateAnswerRequest) SetReturnMetadata

func (s *CreateAnswerRequest) SetReturnMetadata(val OptNilBool)

SetReturnMetadata sets the value of ReturnMetadata.

func (*CreateAnswerRequest) SetReturnPrompt

func (s *CreateAnswerRequest) SetReturnPrompt(val OptNilBool)

SetReturnPrompt sets the value of ReturnPrompt.

func (*CreateAnswerRequest) SetSearchModel

func (s *CreateAnswerRequest) SetSearchModel(val OptNilString)

SetSearchModel sets the value of SearchModel.

func (*CreateAnswerRequest) SetStop

SetStop sets the value of Stop.

func (*CreateAnswerRequest) SetTemperature

func (s *CreateAnswerRequest) SetTemperature(val OptNilFloat64)

SetTemperature sets the value of Temperature.

func (*CreateAnswerRequest) SetUser

func (s *CreateAnswerRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateAnswerRequest) UnmarshalJSON

func (s *CreateAnswerRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateAnswerRequest) Validate

func (s *CreateAnswerRequest) Validate() error

type CreateAnswerRequestLogitBias

type CreateAnswerRequestLogitBias struct{}

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) (which works for both GPT-2 and GPT-3) 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.

func (*CreateAnswerRequestLogitBias) Decode

Decode decodes CreateAnswerRequestLogitBias from json.

func (*CreateAnswerRequestLogitBias) Encode

func (s *CreateAnswerRequestLogitBias) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateAnswerRequestLogitBias) MarshalJSON

func (s *CreateAnswerRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateAnswerRequestLogitBias) UnmarshalJSON

func (s *CreateAnswerRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateAnswerRequestStop

type CreateAnswerRequestStop struct {
	Type        CreateAnswerRequestStopType // switch on this field
	String      string
	StringArray []string
}

Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. CreateAnswerRequestStop represents sum type.

func NewStringArrayCreateAnswerRequestStop

func NewStringArrayCreateAnswerRequestStop(v []string) CreateAnswerRequestStop

NewStringArrayCreateAnswerRequestStop returns new CreateAnswerRequestStop from []string.

func NewStringCreateAnswerRequestStop

func NewStringCreateAnswerRequestStop(v string) CreateAnswerRequestStop

NewStringCreateAnswerRequestStop returns new CreateAnswerRequestStop from string.

func (*CreateAnswerRequestStop) Decode

func (s *CreateAnswerRequestStop) Decode(d *jx.Decoder) error

Decode decodes CreateAnswerRequestStop from json.

func (CreateAnswerRequestStop) Encode

func (s CreateAnswerRequestStop) Encode(e *jx.Encoder)

Encode encodes CreateAnswerRequestStop as json.

func (CreateAnswerRequestStop) GetString

func (s CreateAnswerRequestStop) GetString() (v string, ok bool)

GetString returns string and true boolean if CreateAnswerRequestStop is string.

func (CreateAnswerRequestStop) GetStringArray

func (s CreateAnswerRequestStop) GetStringArray() (v []string, ok bool)

GetStringArray returns []string and true boolean if CreateAnswerRequestStop is []string.

func (CreateAnswerRequestStop) IsString

func (s CreateAnswerRequestStop) IsString() bool

IsString reports whether CreateAnswerRequestStop is string.

func (CreateAnswerRequestStop) IsStringArray

func (s CreateAnswerRequestStop) IsStringArray() bool

IsStringArray reports whether CreateAnswerRequestStop is []string.

func (CreateAnswerRequestStop) MarshalJSON

func (s CreateAnswerRequestStop) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateAnswerRequestStop) SetString

func (s *CreateAnswerRequestStop) SetString(v string)

SetString sets CreateAnswerRequestStop to string.

func (*CreateAnswerRequestStop) SetStringArray

func (s *CreateAnswerRequestStop) SetStringArray(v []string)

SetStringArray sets CreateAnswerRequestStop to []string.

func (*CreateAnswerRequestStop) UnmarshalJSON

func (s *CreateAnswerRequestStop) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateAnswerRequestStop) Validate

func (s CreateAnswerRequestStop) Validate() error

type CreateAnswerRequestStopType

type CreateAnswerRequestStopType string

CreateAnswerRequestStopType is oneOf type of CreateAnswerRequestStop.

const (
	StringCreateAnswerRequestStop      CreateAnswerRequestStopType = "string"
	StringArrayCreateAnswerRequestStop CreateAnswerRequestStopType = "[]string"
)

Possible values for CreateAnswerRequestStopType.

type CreateAnswerResponse

type CreateAnswerResponse struct {
	Object            OptString                                   `json:"object"`
	Model             OptString                                   `json:"model"`
	SearchModel       OptString                                   `json:"search_model"`
	Completion        OptString                                   `json:"completion"`
	Answers           []string                                    `json:"answers"`
	SelectedDocuments []CreateAnswerResponseSelectedDocumentsItem `json:"selected_documents"`
}

Ref: #/components/schemas/CreateAnswerResponse

func (*CreateAnswerResponse) Decode

func (s *CreateAnswerResponse) Decode(d *jx.Decoder) error

Decode decodes CreateAnswerResponse from json.

func (*CreateAnswerResponse) Encode

func (s *CreateAnswerResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateAnswerResponse) GetAnswers

func (s *CreateAnswerResponse) GetAnswers() []string

GetAnswers returns the value of Answers.

func (*CreateAnswerResponse) GetCompletion

func (s *CreateAnswerResponse) GetCompletion() OptString

GetCompletion returns the value of Completion.

func (*CreateAnswerResponse) GetModel

func (s *CreateAnswerResponse) GetModel() OptString

GetModel returns the value of Model.

func (*CreateAnswerResponse) GetObject

func (s *CreateAnswerResponse) GetObject() OptString

GetObject returns the value of Object.

func (*CreateAnswerResponse) GetSearchModel

func (s *CreateAnswerResponse) GetSearchModel() OptString

GetSearchModel returns the value of SearchModel.

func (*CreateAnswerResponse) GetSelectedDocuments

GetSelectedDocuments returns the value of SelectedDocuments.

func (*CreateAnswerResponse) MarshalJSON

func (s *CreateAnswerResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateAnswerResponse) SetAnswers

func (s *CreateAnswerResponse) SetAnswers(val []string)

SetAnswers sets the value of Answers.

func (*CreateAnswerResponse) SetCompletion

func (s *CreateAnswerResponse) SetCompletion(val OptString)

SetCompletion sets the value of Completion.

func (*CreateAnswerResponse) SetModel

func (s *CreateAnswerResponse) SetModel(val OptString)

SetModel sets the value of Model.

func (*CreateAnswerResponse) SetObject

func (s *CreateAnswerResponse) SetObject(val OptString)

SetObject sets the value of Object.

func (*CreateAnswerResponse) SetSearchModel

func (s *CreateAnswerResponse) SetSearchModel(val OptString)

SetSearchModel sets the value of SearchModel.

func (*CreateAnswerResponse) SetSelectedDocuments

func (s *CreateAnswerResponse) SetSelectedDocuments(val []CreateAnswerResponseSelectedDocumentsItem)

SetSelectedDocuments sets the value of SelectedDocuments.

func (*CreateAnswerResponse) UnmarshalJSON

func (s *CreateAnswerResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateAnswerResponseSelectedDocumentsItem

type CreateAnswerResponseSelectedDocumentsItem struct {
	Document OptInt    `json:"document"`
	Text     OptString `json:"text"`
}

func (*CreateAnswerResponseSelectedDocumentsItem) Decode

Decode decodes CreateAnswerResponseSelectedDocumentsItem from json.

func (*CreateAnswerResponseSelectedDocumentsItem) Encode

Encode implements json.Marshaler.

func (*CreateAnswerResponseSelectedDocumentsItem) GetDocument

GetDocument returns the value of Document.

func (*CreateAnswerResponseSelectedDocumentsItem) GetText

GetText returns the value of Text.

func (*CreateAnswerResponseSelectedDocumentsItem) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateAnswerResponseSelectedDocumentsItem) SetDocument

SetDocument sets the value of Document.

func (*CreateAnswerResponseSelectedDocumentsItem) SetText

SetText sets the value of Text.

func (*CreateAnswerResponseSelectedDocumentsItem) UnmarshalJSON

func (s *CreateAnswerResponseSelectedDocumentsItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateChatCompletionRequest

type CreateChatCompletionRequest struct {
	// ID of the model to use. Currently, only `gpt-3.5-turbo` and `gpt-3.5-turbo-0301` are supported.
	Model string `json:"model"`
	// The messages to generate chat completions for, in the [chat
	// format](/docs/guides/chat/introduction).
	Messages []ChatCompletionRequestMessage `json:"messages"`
	// 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 OptNilFloat64 `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 OptNilFloat64 `json:"top_p"`
	// How many chat completion choices to generate for each input message.
	N OptNilInt `json:"n"`
	// 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.
	Stream OptNilBool `json:"stream"`
	// Up to 4 sequences where the API will stop generating further tokens.
	Stop OptNilCreateChatCompletionRequestStop `json:"stop"`
	// The maximum number of tokens allowed for the generated answer. By default, the number of tokens
	// the model can return will be (4096 - prompt tokens).
	MaxTokens OptInt `json:"max_tokens"`
	// 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/api-reference/parameter-details).
	PresencePenalty OptNilFloat64 `json:"presence_penalty"`
	// 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/api-reference/parameter-details).
	FrequencyPenalty OptNilFloat64 `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 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 OptCreateChatCompletionRequestLogitBias `json:"logit_bias"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateChatCompletionRequest

func (*CreateChatCompletionRequest) Decode

Decode decodes CreateChatCompletionRequest from json.

func (*CreateChatCompletionRequest) Encode

func (s *CreateChatCompletionRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateChatCompletionRequest) GetFrequencyPenalty

func (s *CreateChatCompletionRequest) GetFrequencyPenalty() OptNilFloat64

GetFrequencyPenalty returns the value of FrequencyPenalty.

func (*CreateChatCompletionRequest) GetLogitBias

GetLogitBias returns the value of LogitBias.

func (*CreateChatCompletionRequest) GetMaxTokens

func (s *CreateChatCompletionRequest) GetMaxTokens() OptInt

GetMaxTokens returns the value of MaxTokens.

func (*CreateChatCompletionRequest) GetMessages

GetMessages returns the value of Messages.

func (*CreateChatCompletionRequest) GetModel

func (s *CreateChatCompletionRequest) GetModel() string

GetModel returns the value of Model.

func (*CreateChatCompletionRequest) GetN

GetN returns the value of N.

func (*CreateChatCompletionRequest) GetPresencePenalty

func (s *CreateChatCompletionRequest) GetPresencePenalty() OptNilFloat64

GetPresencePenalty returns the value of PresencePenalty.

func (*CreateChatCompletionRequest) GetStop

GetStop returns the value of Stop.

func (*CreateChatCompletionRequest) GetStream

func (s *CreateChatCompletionRequest) GetStream() OptNilBool

GetStream returns the value of Stream.

func (*CreateChatCompletionRequest) GetTemperature

func (s *CreateChatCompletionRequest) GetTemperature() OptNilFloat64

GetTemperature returns the value of Temperature.

func (*CreateChatCompletionRequest) GetTopP

GetTopP returns the value of TopP.

func (*CreateChatCompletionRequest) GetUser

GetUser returns the value of User.

func (*CreateChatCompletionRequest) MarshalJSON

func (s *CreateChatCompletionRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionRequest) SetFrequencyPenalty

func (s *CreateChatCompletionRequest) SetFrequencyPenalty(val OptNilFloat64)

SetFrequencyPenalty sets the value of FrequencyPenalty.

func (*CreateChatCompletionRequest) SetLogitBias

SetLogitBias sets the value of LogitBias.

func (*CreateChatCompletionRequest) SetMaxTokens

func (s *CreateChatCompletionRequest) SetMaxTokens(val OptInt)

SetMaxTokens sets the value of MaxTokens.

func (*CreateChatCompletionRequest) SetMessages

SetMessages sets the value of Messages.

func (*CreateChatCompletionRequest) SetModel

func (s *CreateChatCompletionRequest) SetModel(val string)

SetModel sets the value of Model.

func (*CreateChatCompletionRequest) SetN

SetN sets the value of N.

func (*CreateChatCompletionRequest) SetPresencePenalty

func (s *CreateChatCompletionRequest) SetPresencePenalty(val OptNilFloat64)

SetPresencePenalty sets the value of PresencePenalty.

func (*CreateChatCompletionRequest) SetStop

SetStop sets the value of Stop.

func (*CreateChatCompletionRequest) SetStream

func (s *CreateChatCompletionRequest) SetStream(val OptNilBool)

SetStream sets the value of Stream.

func (*CreateChatCompletionRequest) SetTemperature

func (s *CreateChatCompletionRequest) SetTemperature(val OptNilFloat64)

SetTemperature sets the value of Temperature.

func (*CreateChatCompletionRequest) SetTopP

SetTopP sets the value of TopP.

func (*CreateChatCompletionRequest) SetUser

func (s *CreateChatCompletionRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateChatCompletionRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateChatCompletionRequest) Validate

func (s *CreateChatCompletionRequest) Validate() error

type CreateChatCompletionRequestLogitBias

type CreateChatCompletionRequestLogitBias struct{}

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.

func (*CreateChatCompletionRequestLogitBias) Decode

Decode decodes CreateChatCompletionRequestLogitBias from json.

func (*CreateChatCompletionRequestLogitBias) Encode

Encode implements json.Marshaler.

func (*CreateChatCompletionRequestLogitBias) MarshalJSON

func (s *CreateChatCompletionRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionRequestLogitBias) UnmarshalJSON

func (s *CreateChatCompletionRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateChatCompletionRequestStop

type CreateChatCompletionRequestStop struct {
	Type        CreateChatCompletionRequestStopType // switch on this field
	String      string
	StringArray []string
}

Up to 4 sequences where the API will stop generating further tokens. CreateChatCompletionRequestStop represents sum type.

func NewStringArrayCreateChatCompletionRequestStop

func NewStringArrayCreateChatCompletionRequestStop(v []string) CreateChatCompletionRequestStop

NewStringArrayCreateChatCompletionRequestStop returns new CreateChatCompletionRequestStop from []string.

func NewStringCreateChatCompletionRequestStop

func NewStringCreateChatCompletionRequestStop(v string) CreateChatCompletionRequestStop

NewStringCreateChatCompletionRequestStop returns new CreateChatCompletionRequestStop from string.

func (*CreateChatCompletionRequestStop) Decode

Decode decodes CreateChatCompletionRequestStop from json.

func (CreateChatCompletionRequestStop) Encode

Encode encodes CreateChatCompletionRequestStop as json.

func (CreateChatCompletionRequestStop) GetString

func (s CreateChatCompletionRequestStop) GetString() (v string, ok bool)

GetString returns string and true boolean if CreateChatCompletionRequestStop is string.

func (CreateChatCompletionRequestStop) GetStringArray

func (s CreateChatCompletionRequestStop) GetStringArray() (v []string, ok bool)

GetStringArray returns []string and true boolean if CreateChatCompletionRequestStop is []string.

func (CreateChatCompletionRequestStop) IsString

IsString reports whether CreateChatCompletionRequestStop is string.

func (CreateChatCompletionRequestStop) IsStringArray

func (s CreateChatCompletionRequestStop) IsStringArray() bool

IsStringArray reports whether CreateChatCompletionRequestStop is []string.

func (CreateChatCompletionRequestStop) MarshalJSON

func (s CreateChatCompletionRequestStop) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionRequestStop) SetString

func (s *CreateChatCompletionRequestStop) SetString(v string)

SetString sets CreateChatCompletionRequestStop to string.

func (*CreateChatCompletionRequestStop) SetStringArray

func (s *CreateChatCompletionRequestStop) SetStringArray(v []string)

SetStringArray sets CreateChatCompletionRequestStop to []string.

func (*CreateChatCompletionRequestStop) UnmarshalJSON

func (s *CreateChatCompletionRequestStop) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateChatCompletionRequestStop) Validate

type CreateChatCompletionRequestStopType

type CreateChatCompletionRequestStopType string

CreateChatCompletionRequestStopType is oneOf type of CreateChatCompletionRequestStop.

const (
	StringCreateChatCompletionRequestStop      CreateChatCompletionRequestStopType = "string"
	StringArrayCreateChatCompletionRequestStop CreateChatCompletionRequestStopType = "[]string"
)

Possible values for CreateChatCompletionRequestStopType.

type CreateChatCompletionResponse

type CreateChatCompletionResponse struct {
	ID      string                                    `json:"id"`
	Object  string                                    `json:"object"`
	Created int                                       `json:"created"`
	Model   string                                    `json:"model"`
	Choices []CreateChatCompletionResponseChoicesItem `json:"choices"`
	Usage   OptCreateChatCompletionResponseUsage      `json:"usage"`
}

Ref: #/components/schemas/CreateChatCompletionResponse

func (*CreateChatCompletionResponse) Decode

Decode decodes CreateChatCompletionResponse from json.

func (*CreateChatCompletionResponse) Encode

func (s *CreateChatCompletionResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateChatCompletionResponse) GetChoices

GetChoices returns the value of Choices.

func (*CreateChatCompletionResponse) GetCreated

func (s *CreateChatCompletionResponse) GetCreated() int

GetCreated returns the value of Created.

func (*CreateChatCompletionResponse) GetID

GetID returns the value of ID.

func (*CreateChatCompletionResponse) GetModel

func (s *CreateChatCompletionResponse) GetModel() string

GetModel returns the value of Model.

func (*CreateChatCompletionResponse) GetObject

func (s *CreateChatCompletionResponse) GetObject() string

GetObject returns the value of Object.

func (*CreateChatCompletionResponse) GetUsage

GetUsage returns the value of Usage.

func (*CreateChatCompletionResponse) MarshalJSON

func (s *CreateChatCompletionResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionResponse) SetChoices

SetChoices sets the value of Choices.

func (*CreateChatCompletionResponse) SetCreated

func (s *CreateChatCompletionResponse) SetCreated(val int)

SetCreated sets the value of Created.

func (*CreateChatCompletionResponse) SetID

func (s *CreateChatCompletionResponse) SetID(val string)

SetID sets the value of ID.

func (*CreateChatCompletionResponse) SetModel

func (s *CreateChatCompletionResponse) SetModel(val string)

SetModel sets the value of Model.

func (*CreateChatCompletionResponse) SetObject

func (s *CreateChatCompletionResponse) SetObject(val string)

SetObject sets the value of Object.

func (*CreateChatCompletionResponse) SetUsage

SetUsage sets the value of Usage.

func (*CreateChatCompletionResponse) UnmarshalJSON

func (s *CreateChatCompletionResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateChatCompletionResponse) Validate

func (s *CreateChatCompletionResponse) Validate() error

type CreateChatCompletionResponseChoicesItem

type CreateChatCompletionResponseChoicesItem struct {
	Index        OptInt                           `json:"index"`
	Message      OptChatCompletionResponseMessage `json:"message"`
	FinishReason OptString                        `json:"finish_reason"`
}

func (*CreateChatCompletionResponseChoicesItem) Decode

Decode decodes CreateChatCompletionResponseChoicesItem from json.

func (*CreateChatCompletionResponseChoicesItem) Encode

Encode implements json.Marshaler.

func (*CreateChatCompletionResponseChoicesItem) GetFinishReason

GetFinishReason returns the value of FinishReason.

func (*CreateChatCompletionResponseChoicesItem) GetIndex

GetIndex returns the value of Index.

func (*CreateChatCompletionResponseChoicesItem) GetMessage

GetMessage returns the value of Message.

func (*CreateChatCompletionResponseChoicesItem) MarshalJSON

func (s *CreateChatCompletionResponseChoicesItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionResponseChoicesItem) SetFinishReason

func (s *CreateChatCompletionResponseChoicesItem) SetFinishReason(val OptString)

SetFinishReason sets the value of FinishReason.

func (*CreateChatCompletionResponseChoicesItem) SetIndex

SetIndex sets the value of Index.

func (*CreateChatCompletionResponseChoicesItem) SetMessage

SetMessage sets the value of Message.

func (*CreateChatCompletionResponseChoicesItem) UnmarshalJSON

func (s *CreateChatCompletionResponseChoicesItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateChatCompletionResponseChoicesItem) Validate

type CreateChatCompletionResponseUsage

type CreateChatCompletionResponseUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

func (*CreateChatCompletionResponseUsage) Decode

Decode decodes CreateChatCompletionResponseUsage from json.

func (*CreateChatCompletionResponseUsage) Encode

Encode implements json.Marshaler.

func (*CreateChatCompletionResponseUsage) GetCompletionTokens

func (s *CreateChatCompletionResponseUsage) GetCompletionTokens() int

GetCompletionTokens returns the value of CompletionTokens.

func (*CreateChatCompletionResponseUsage) GetPromptTokens

func (s *CreateChatCompletionResponseUsage) GetPromptTokens() int

GetPromptTokens returns the value of PromptTokens.

func (*CreateChatCompletionResponseUsage) GetTotalTokens

func (s *CreateChatCompletionResponseUsage) GetTotalTokens() int

GetTotalTokens returns the value of TotalTokens.

func (*CreateChatCompletionResponseUsage) MarshalJSON

func (s *CreateChatCompletionResponseUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionResponseUsage) SetCompletionTokens

func (s *CreateChatCompletionResponseUsage) SetCompletionTokens(val int)

SetCompletionTokens sets the value of CompletionTokens.

func (*CreateChatCompletionResponseUsage) SetPromptTokens

func (s *CreateChatCompletionResponseUsage) SetPromptTokens(val int)

SetPromptTokens sets the value of PromptTokens.

func (*CreateChatCompletionResponseUsage) SetTotalTokens

func (s *CreateChatCompletionResponseUsage) SetTotalTokens(val int)

SetTotalTokens sets the value of TotalTokens.

func (*CreateChatCompletionResponseUsage) UnmarshalJSON

func (s *CreateChatCompletionResponseUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateClassificationRequest

type CreateClassificationRequest struct {
	// 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"`
	// Query to be classified.
	Query string `json:"query"`
	// A list of examples with labels, in the following format:
	// `[["The movie is so interesting.", "Positive"], ["It is quite boring.", "Negative"], ...]`
	// All the label strings will be normalized to be capitalized.
	// You should specify either `examples` or `file`, but not both.
	Examples OptNilStringArrayArray `json:"examples"`
	// The ID of the uploaded file that contains training examples. See [upload
	// file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose.
	// You should specify either `examples` or `file`, but not both.
	File OptNilString `json:"file"`
	// The set of categories being classified. If not specified, candidate labels will be automatically
	// collected from the examples you provide. All the label strings will be normalized to be
	// capitalized.
	Labels OptNilStringArray `json:"labels"`
	// ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of
	// `ada`, `babbage`, `curie`, or `davinci`.
	SearchModel OptNilString `json:"search_model"`
	// 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.
	Temperature OptNilFloat64 `json:"temperature"`
	// Include the log probabilities on the `logprobs` most likely 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. If you need more than this, please contact us through our
	// [Help center](https://help.openai.com) and describe your use case.
	// When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs.
	Logprobs OptNilInt `json:"logprobs"`
	// The maximum number of examples to be ranked by [Search](/docs/api-reference/searches/create) when
	// using `file`. Setting it to a higher value leads to improved accuracy but with increased latency
	// and cost.
	MaxExamples OptNilInt `json:"max_examples"`
	// 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)
	// (which works for both GPT-2 and GPT-3) 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 OptCreateClassificationRequestLogitBias `json:"logit_bias"`
	// If set to `true`, the returned JSON will include a "prompt" field containing the final prompt that
	// was used to request a completion. This is mainly useful for debugging purposes.
	ReturnPrompt OptNilBool `json:"return_prompt"`
	// A special boolean flag for showing metadata. If set to `true`, each document entry in the returned
	// JSON will contain a "metadata" field.
	// This flag only takes effect when `file` is set.
	ReturnMetadata OptNilBool `json:"return_metadata"`
	// If an object name is in the list, we provide the full information of the object; otherwise, we
	// only provide the object ID. Currently we support `completion` and `file` objects for expansion.
	Expand OptNilAnyArray `json:"expand"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateClassificationRequest

func (*CreateClassificationRequest) Decode

Decode decodes CreateClassificationRequest from json.

func (*CreateClassificationRequest) Encode

func (s *CreateClassificationRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateClassificationRequest) GetExamples

GetExamples returns the value of Examples.

func (*CreateClassificationRequest) GetExpand

GetExpand returns the value of Expand.

func (*CreateClassificationRequest) GetFile

GetFile returns the value of File.

func (*CreateClassificationRequest) GetLabels

GetLabels returns the value of Labels.

func (*CreateClassificationRequest) GetLogitBias

GetLogitBias returns the value of LogitBias.

func (*CreateClassificationRequest) GetLogprobs

func (s *CreateClassificationRequest) GetLogprobs() OptNilInt

GetLogprobs returns the value of Logprobs.

func (*CreateClassificationRequest) GetMaxExamples

func (s *CreateClassificationRequest) GetMaxExamples() OptNilInt

GetMaxExamples returns the value of MaxExamples.

func (*CreateClassificationRequest) GetModel

func (s *CreateClassificationRequest) GetModel() string

GetModel returns the value of Model.

func (*CreateClassificationRequest) GetQuery

func (s *CreateClassificationRequest) GetQuery() string

GetQuery returns the value of Query.

func (*CreateClassificationRequest) GetReturnMetadata

func (s *CreateClassificationRequest) GetReturnMetadata() OptNilBool

GetReturnMetadata returns the value of ReturnMetadata.

func (*CreateClassificationRequest) GetReturnPrompt

func (s *CreateClassificationRequest) GetReturnPrompt() OptNilBool

GetReturnPrompt returns the value of ReturnPrompt.

func (*CreateClassificationRequest) GetSearchModel

func (s *CreateClassificationRequest) GetSearchModel() OptNilString

GetSearchModel returns the value of SearchModel.

func (*CreateClassificationRequest) GetTemperature

func (s *CreateClassificationRequest) GetTemperature() OptNilFloat64

GetTemperature returns the value of Temperature.

func (*CreateClassificationRequest) GetUser

GetUser returns the value of User.

func (*CreateClassificationRequest) MarshalJSON

func (s *CreateClassificationRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateClassificationRequest) SetExamples

SetExamples sets the value of Examples.

func (*CreateClassificationRequest) SetExpand

func (s *CreateClassificationRequest) SetExpand(val OptNilAnyArray)

SetExpand sets the value of Expand.

func (*CreateClassificationRequest) SetFile

func (s *CreateClassificationRequest) SetFile(val OptNilString)

SetFile sets the value of File.

func (*CreateClassificationRequest) SetLabels

SetLabels sets the value of Labels.

func (*CreateClassificationRequest) SetLogitBias

SetLogitBias sets the value of LogitBias.

func (*CreateClassificationRequest) SetLogprobs

func (s *CreateClassificationRequest) SetLogprobs(val OptNilInt)

SetLogprobs sets the value of Logprobs.

func (*CreateClassificationRequest) SetMaxExamples

func (s *CreateClassificationRequest) SetMaxExamples(val OptNilInt)

SetMaxExamples sets the value of MaxExamples.

func (*CreateClassificationRequest) SetModel

func (s *CreateClassificationRequest) SetModel(val string)

SetModel sets the value of Model.

func (*CreateClassificationRequest) SetQuery

func (s *CreateClassificationRequest) SetQuery(val string)

SetQuery sets the value of Query.

func (*CreateClassificationRequest) SetReturnMetadata

func (s *CreateClassificationRequest) SetReturnMetadata(val OptNilBool)

SetReturnMetadata sets the value of ReturnMetadata.

func (*CreateClassificationRequest) SetReturnPrompt

func (s *CreateClassificationRequest) SetReturnPrompt(val OptNilBool)

SetReturnPrompt sets the value of ReturnPrompt.

func (*CreateClassificationRequest) SetSearchModel

func (s *CreateClassificationRequest) SetSearchModel(val OptNilString)

SetSearchModel sets the value of SearchModel.

func (*CreateClassificationRequest) SetTemperature

func (s *CreateClassificationRequest) SetTemperature(val OptNilFloat64)

SetTemperature sets the value of Temperature.

func (*CreateClassificationRequest) SetUser

func (s *CreateClassificationRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateClassificationRequest) UnmarshalJSON

func (s *CreateClassificationRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateClassificationRequest) Validate

func (s *CreateClassificationRequest) Validate() error

type CreateClassificationRequestLogitBias

type CreateClassificationRequestLogitBias struct{}

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) (which works for both GPT-2 and GPT-3) 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.

func (*CreateClassificationRequestLogitBias) Decode

Decode decodes CreateClassificationRequestLogitBias from json.

func (*CreateClassificationRequestLogitBias) Encode

Encode implements json.Marshaler.

func (*CreateClassificationRequestLogitBias) MarshalJSON

func (s *CreateClassificationRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateClassificationRequestLogitBias) UnmarshalJSON

func (s *CreateClassificationRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateClassificationResponse

type CreateClassificationResponse struct {
	Object           OptString                                          `json:"object"`
	Model            OptString                                          `json:"model"`
	SearchModel      OptString                                          `json:"search_model"`
	Completion       OptString                                          `json:"completion"`
	Label            OptString                                          `json:"label"`
	SelectedExamples []CreateClassificationResponseSelectedExamplesItem `json:"selected_examples"`
}

Ref: #/components/schemas/CreateClassificationResponse

func (*CreateClassificationResponse) Decode

Decode decodes CreateClassificationResponse from json.

func (*CreateClassificationResponse) Encode

func (s *CreateClassificationResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateClassificationResponse) GetCompletion

func (s *CreateClassificationResponse) GetCompletion() OptString

GetCompletion returns the value of Completion.

func (*CreateClassificationResponse) GetLabel

GetLabel returns the value of Label.

func (*CreateClassificationResponse) GetModel

GetModel returns the value of Model.

func (*CreateClassificationResponse) GetObject

func (s *CreateClassificationResponse) GetObject() OptString

GetObject returns the value of Object.

func (*CreateClassificationResponse) GetSearchModel

func (s *CreateClassificationResponse) GetSearchModel() OptString

GetSearchModel returns the value of SearchModel.

func (*CreateClassificationResponse) GetSelectedExamples

GetSelectedExamples returns the value of SelectedExamples.

func (*CreateClassificationResponse) MarshalJSON

func (s *CreateClassificationResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateClassificationResponse) SetCompletion

func (s *CreateClassificationResponse) SetCompletion(val OptString)

SetCompletion sets the value of Completion.

func (*CreateClassificationResponse) SetLabel

func (s *CreateClassificationResponse) SetLabel(val OptString)

SetLabel sets the value of Label.

func (*CreateClassificationResponse) SetModel

func (s *CreateClassificationResponse) SetModel(val OptString)

SetModel sets the value of Model.

func (*CreateClassificationResponse) SetObject

func (s *CreateClassificationResponse) SetObject(val OptString)

SetObject sets the value of Object.

func (*CreateClassificationResponse) SetSearchModel

func (s *CreateClassificationResponse) SetSearchModel(val OptString)

SetSearchModel sets the value of SearchModel.

func (*CreateClassificationResponse) SetSelectedExamples

SetSelectedExamples sets the value of SelectedExamples.

func (*CreateClassificationResponse) UnmarshalJSON

func (s *CreateClassificationResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateClassificationResponseSelectedExamplesItem

type CreateClassificationResponseSelectedExamplesItem struct {
	Document OptInt    `json:"document"`
	Text     OptString `json:"text"`
	Label    OptString `json:"label"`
}

func (*CreateClassificationResponseSelectedExamplesItem) Decode

Decode decodes CreateClassificationResponseSelectedExamplesItem from json.

func (*CreateClassificationResponseSelectedExamplesItem) Encode

Encode implements json.Marshaler.

func (*CreateClassificationResponseSelectedExamplesItem) GetDocument

GetDocument returns the value of Document.

func (*CreateClassificationResponseSelectedExamplesItem) GetLabel

GetLabel returns the value of Label.

func (*CreateClassificationResponseSelectedExamplesItem) GetText

GetText returns the value of Text.

func (*CreateClassificationResponseSelectedExamplesItem) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateClassificationResponseSelectedExamplesItem) SetDocument

SetDocument sets the value of Document.

func (*CreateClassificationResponseSelectedExamplesItem) SetLabel

SetLabel sets the value of Label.

func (*CreateClassificationResponseSelectedExamplesItem) SetText

SetText sets the value of Text.

func (*CreateClassificationResponseSelectedExamplesItem) UnmarshalJSON

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateCompletionRequest

type CreateCompletionRequest struct {
	// 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 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 OptNilCreateCompletionRequestPrompt `json:"prompt"`
	// The suffix that comes after a completion of inserted text.
	Suffix OptNilString `json:"suffix"`
	// The maximum number of [tokens](/tokenizer) to generate in the completion.
	// The token count of your prompt plus `max_tokens` cannot exceed the model's context length. Most
	// models have a context length of 2048 tokens (except for the newest models, which support 4096).
	MaxTokens OptNilInt `json:"max_tokens"`
	// 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 OptNilFloat64 `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 OptNilFloat64 `json:"top_p"`
	// 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 OptNilInt `json:"n"`
	// 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.
	Stream OptNilBool `json:"stream"`
	// Include the log probabilities on the `logprobs` most likely 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. If you need more than this, please contact us through our
	// [Help center](https://help.openai.com) and describe your use case.
	Logprobs OptNilInt `json:"logprobs"`
	// Echo back the prompt in addition to the completion.
	Echo OptNilBool `json:"echo"`
	// Up to 4 sequences where the API will stop generating further tokens. The returned text will not
	// contain the stop sequence.
	Stop OptNilCreateCompletionRequestStop `json:"stop"`
	// 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/api-reference/parameter-details).
	PresencePenalty OptNilFloat64 `json:"presence_penalty"`
	// 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/api-reference/parameter-details).
	FrequencyPenalty OptNilFloat64 `json:"frequency_penalty"`
	// 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 OptNilInt `json:"best_of"`
	// 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)
	// (which works for both GPT-2 and GPT-3) 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 OptCreateCompletionRequestLogitBias `json:"logit_bias"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateCompletionRequest

func (*CreateCompletionRequest) Decode

func (s *CreateCompletionRequest) Decode(d *jx.Decoder) error

Decode decodes CreateCompletionRequest from json.

func (*CreateCompletionRequest) Encode

func (s *CreateCompletionRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateCompletionRequest) GetBestOf

func (s *CreateCompletionRequest) GetBestOf() OptNilInt

GetBestOf returns the value of BestOf.

func (*CreateCompletionRequest) GetEcho

func (s *CreateCompletionRequest) GetEcho() OptNilBool

GetEcho returns the value of Echo.

func (*CreateCompletionRequest) GetFrequencyPenalty

func (s *CreateCompletionRequest) GetFrequencyPenalty() OptNilFloat64

GetFrequencyPenalty returns the value of FrequencyPenalty.

func (*CreateCompletionRequest) GetLogitBias

GetLogitBias returns the value of LogitBias.

func (*CreateCompletionRequest) GetLogprobs

func (s *CreateCompletionRequest) GetLogprobs() OptNilInt

GetLogprobs returns the value of Logprobs.

func (*CreateCompletionRequest) GetMaxTokens

func (s *CreateCompletionRequest) GetMaxTokens() OptNilInt

GetMaxTokens returns the value of MaxTokens.

func (*CreateCompletionRequest) GetModel

func (s *CreateCompletionRequest) GetModel() string

GetModel returns the value of Model.

func (*CreateCompletionRequest) GetN

GetN returns the value of N.

func (*CreateCompletionRequest) GetPresencePenalty

func (s *CreateCompletionRequest) GetPresencePenalty() OptNilFloat64

GetPresencePenalty returns the value of PresencePenalty.

func (*CreateCompletionRequest) GetPrompt

GetPrompt returns the value of Prompt.

func (*CreateCompletionRequest) GetStop

GetStop returns the value of Stop.

func (*CreateCompletionRequest) GetStream

func (s *CreateCompletionRequest) GetStream() OptNilBool

GetStream returns the value of Stream.

func (*CreateCompletionRequest) GetSuffix

func (s *CreateCompletionRequest) GetSuffix() OptNilString

GetSuffix returns the value of Suffix.

func (*CreateCompletionRequest) GetTemperature

func (s *CreateCompletionRequest) GetTemperature() OptNilFloat64

GetTemperature returns the value of Temperature.

func (*CreateCompletionRequest) GetTopP

GetTopP returns the value of TopP.

func (*CreateCompletionRequest) GetUser

func (s *CreateCompletionRequest) GetUser() OptString

GetUser returns the value of User.

func (*CreateCompletionRequest) MarshalJSON

func (s *CreateCompletionRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionRequest) SetBestOf

func (s *CreateCompletionRequest) SetBestOf(val OptNilInt)

SetBestOf sets the value of BestOf.

func (*CreateCompletionRequest) SetEcho

func (s *CreateCompletionRequest) SetEcho(val OptNilBool)

SetEcho sets the value of Echo.

func (*CreateCompletionRequest) SetFrequencyPenalty

func (s *CreateCompletionRequest) SetFrequencyPenalty(val OptNilFloat64)

SetFrequencyPenalty sets the value of FrequencyPenalty.

func (*CreateCompletionRequest) SetLogitBias

SetLogitBias sets the value of LogitBias.

func (*CreateCompletionRequest) SetLogprobs

func (s *CreateCompletionRequest) SetLogprobs(val OptNilInt)

SetLogprobs sets the value of Logprobs.

func (*CreateCompletionRequest) SetMaxTokens

func (s *CreateCompletionRequest) SetMaxTokens(val OptNilInt)

SetMaxTokens sets the value of MaxTokens.

func (*CreateCompletionRequest) SetModel

func (s *CreateCompletionRequest) SetModel(val string)

SetModel sets the value of Model.

func (*CreateCompletionRequest) SetN

func (s *CreateCompletionRequest) SetN(val OptNilInt)

SetN sets the value of N.

func (*CreateCompletionRequest) SetPresencePenalty

func (s *CreateCompletionRequest) SetPresencePenalty(val OptNilFloat64)

SetPresencePenalty sets the value of PresencePenalty.

func (*CreateCompletionRequest) SetPrompt

SetPrompt sets the value of Prompt.

func (*CreateCompletionRequest) SetStop

SetStop sets the value of Stop.

func (*CreateCompletionRequest) SetStream

func (s *CreateCompletionRequest) SetStream(val OptNilBool)

SetStream sets the value of Stream.

func (*CreateCompletionRequest) SetSuffix

func (s *CreateCompletionRequest) SetSuffix(val OptNilString)

SetSuffix sets the value of Suffix.

func (*CreateCompletionRequest) SetTemperature

func (s *CreateCompletionRequest) SetTemperature(val OptNilFloat64)

SetTemperature sets the value of Temperature.

func (*CreateCompletionRequest) SetTopP

func (s *CreateCompletionRequest) SetTopP(val OptNilFloat64)

SetTopP sets the value of TopP.

func (*CreateCompletionRequest) SetUser

func (s *CreateCompletionRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateCompletionRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateCompletionRequest) Validate

func (s *CreateCompletionRequest) Validate() error

type CreateCompletionRequestLogitBias

type CreateCompletionRequestLogitBias struct{}

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) (which works for both GPT-2 and GPT-3) 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.

func (*CreateCompletionRequestLogitBias) Decode

Decode decodes CreateCompletionRequestLogitBias from json.

func (*CreateCompletionRequestLogitBias) Encode

Encode implements json.Marshaler.

func (*CreateCompletionRequestLogitBias) MarshalJSON

func (s *CreateCompletionRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionRequestLogitBias) UnmarshalJSON

func (s *CreateCompletionRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateCompletionRequestPrompt

type CreateCompletionRequestPrompt struct {
	Type        CreateCompletionRequestPromptType // switch on this field
	String      string
	StringArray []string
}

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. CreateCompletionRequestPrompt represents sum type.

func NewStringArrayCreateCompletionRequestPrompt

func NewStringArrayCreateCompletionRequestPrompt(v []string) CreateCompletionRequestPrompt

NewStringArrayCreateCompletionRequestPrompt returns new CreateCompletionRequestPrompt from []string.

func NewStringCreateCompletionRequestPrompt

func NewStringCreateCompletionRequestPrompt(v string) CreateCompletionRequestPrompt

NewStringCreateCompletionRequestPrompt returns new CreateCompletionRequestPrompt from string.

func (*CreateCompletionRequestPrompt) Decode

Decode decodes CreateCompletionRequestPrompt from json.

func (CreateCompletionRequestPrompt) Encode

Encode encodes CreateCompletionRequestPrompt as json.

func (CreateCompletionRequestPrompt) GetString

func (s CreateCompletionRequestPrompt) GetString() (v string, ok bool)

GetString returns string and true boolean if CreateCompletionRequestPrompt is string.

func (CreateCompletionRequestPrompt) GetStringArray

func (s CreateCompletionRequestPrompt) GetStringArray() (v []string, ok bool)

GetStringArray returns []string and true boolean if CreateCompletionRequestPrompt is []string.

func (CreateCompletionRequestPrompt) IsString

func (s CreateCompletionRequestPrompt) IsString() bool

IsString reports whether CreateCompletionRequestPrompt is string.

func (CreateCompletionRequestPrompt) IsStringArray

func (s CreateCompletionRequestPrompt) IsStringArray() bool

IsStringArray reports whether CreateCompletionRequestPrompt is []string.

func (CreateCompletionRequestPrompt) MarshalJSON

func (s CreateCompletionRequestPrompt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionRequestPrompt) SetString

func (s *CreateCompletionRequestPrompt) SetString(v string)

SetString sets CreateCompletionRequestPrompt to string.

func (*CreateCompletionRequestPrompt) SetStringArray

func (s *CreateCompletionRequestPrompt) SetStringArray(v []string)

SetStringArray sets CreateCompletionRequestPrompt to []string.

func (*CreateCompletionRequestPrompt) UnmarshalJSON

func (s *CreateCompletionRequestPrompt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateCompletionRequestPrompt) Validate

func (s CreateCompletionRequestPrompt) Validate() error

type CreateCompletionRequestPromptType

type CreateCompletionRequestPromptType string

CreateCompletionRequestPromptType is oneOf type of CreateCompletionRequestPrompt.

const (
	StringCreateCompletionRequestPrompt      CreateCompletionRequestPromptType = "string"
	StringArrayCreateCompletionRequestPrompt CreateCompletionRequestPromptType = "[]string"
)

Possible values for CreateCompletionRequestPromptType.

type CreateCompletionRequestStop

type CreateCompletionRequestStop struct {
	Type        CreateCompletionRequestStopType // switch on this field
	Null        struct{}
	String      string
	StringArray []string
}

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

func NewNullCreateCompletionRequestStop

func NewNullCreateCompletionRequestStop(v struct{}) CreateCompletionRequestStop

NewNullCreateCompletionRequestStop returns new CreateCompletionRequestStop from struct{}.

func NewStringArrayCreateCompletionRequestStop

func NewStringArrayCreateCompletionRequestStop(v []string) CreateCompletionRequestStop

NewStringArrayCreateCompletionRequestStop returns new CreateCompletionRequestStop from []string.

func NewStringCreateCompletionRequestStop

func NewStringCreateCompletionRequestStop(v string) CreateCompletionRequestStop

NewStringCreateCompletionRequestStop returns new CreateCompletionRequestStop from string.

func (*CreateCompletionRequestStop) Decode

Decode decodes CreateCompletionRequestStop from json.

func (CreateCompletionRequestStop) Encode

func (s CreateCompletionRequestStop) Encode(e *jx.Encoder)

Encode encodes CreateCompletionRequestStop as json.

func (CreateCompletionRequestStop) GetNull

func (s CreateCompletionRequestStop) GetNull() (v struct{}, ok bool)

GetNull returns struct{} and true boolean if CreateCompletionRequestStop is struct{}.

func (CreateCompletionRequestStop) GetString

func (s CreateCompletionRequestStop) GetString() (v string, ok bool)

GetString returns string and true boolean if CreateCompletionRequestStop is string.

func (CreateCompletionRequestStop) GetStringArray

func (s CreateCompletionRequestStop) GetStringArray() (v []string, ok bool)

GetStringArray returns []string and true boolean if CreateCompletionRequestStop is []string.

func (CreateCompletionRequestStop) IsNull

func (s CreateCompletionRequestStop) IsNull() bool

IsNull reports whether CreateCompletionRequestStop is struct{}.

func (CreateCompletionRequestStop) IsString

func (s CreateCompletionRequestStop) IsString() bool

IsString reports whether CreateCompletionRequestStop is string.

func (CreateCompletionRequestStop) IsStringArray

func (s CreateCompletionRequestStop) IsStringArray() bool

IsStringArray reports whether CreateCompletionRequestStop is []string.

func (CreateCompletionRequestStop) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionRequestStop) SetNull

func (s *CreateCompletionRequestStop) SetNull(v struct{})

SetNull sets CreateCompletionRequestStop to struct{}.

func (*CreateCompletionRequestStop) SetString

func (s *CreateCompletionRequestStop) SetString(v string)

SetString sets CreateCompletionRequestStop to string.

func (*CreateCompletionRequestStop) SetStringArray

func (s *CreateCompletionRequestStop) SetStringArray(v []string)

SetStringArray sets CreateCompletionRequestStop to []string.

func (*CreateCompletionRequestStop) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateCompletionRequestStop) Validate

func (s CreateCompletionRequestStop) Validate() error

type CreateCompletionRequestStopType

type CreateCompletionRequestStopType string

CreateCompletionRequestStopType is oneOf type of CreateCompletionRequestStop.

const (
	NullCreateCompletionRequestStop        CreateCompletionRequestStopType = "struct{}"
	StringCreateCompletionRequestStop      CreateCompletionRequestStopType = "string"
	StringArrayCreateCompletionRequestStop CreateCompletionRequestStopType = "[]string"
)

Possible values for CreateCompletionRequestStopType.

type CreateCompletionResponse

type CreateCompletionResponse struct {
	ID      string                                `json:"id"`
	Object  string                                `json:"object"`
	Created int                                   `json:"created"`
	Model   string                                `json:"model"`
	Choices []CreateCompletionResponseChoicesItem `json:"choices"`
	Usage   OptCreateCompletionResponseUsage      `json:"usage"`
}

Ref: #/components/schemas/CreateCompletionResponse

func (*CreateCompletionResponse) Decode

func (s *CreateCompletionResponse) Decode(d *jx.Decoder) error

Decode decodes CreateCompletionResponse from json.

func (*CreateCompletionResponse) Encode

func (s *CreateCompletionResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateCompletionResponse) GetChoices

GetChoices returns the value of Choices.

func (*CreateCompletionResponse) GetCreated

func (s *CreateCompletionResponse) GetCreated() int

GetCreated returns the value of Created.

func (*CreateCompletionResponse) GetID

func (s *CreateCompletionResponse) GetID() string

GetID returns the value of ID.

func (*CreateCompletionResponse) GetModel

func (s *CreateCompletionResponse) GetModel() string

GetModel returns the value of Model.

func (*CreateCompletionResponse) GetObject

func (s *CreateCompletionResponse) GetObject() string

GetObject returns the value of Object.

func (*CreateCompletionResponse) GetUsage

GetUsage returns the value of Usage.

func (*CreateCompletionResponse) MarshalJSON

func (s *CreateCompletionResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionResponse) SetChoices

SetChoices sets the value of Choices.

func (*CreateCompletionResponse) SetCreated

func (s *CreateCompletionResponse) SetCreated(val int)

SetCreated sets the value of Created.

func (*CreateCompletionResponse) SetID

func (s *CreateCompletionResponse) SetID(val string)

SetID sets the value of ID.

func (*CreateCompletionResponse) SetModel

func (s *CreateCompletionResponse) SetModel(val string)

SetModel sets the value of Model.

func (*CreateCompletionResponse) SetObject

func (s *CreateCompletionResponse) SetObject(val string)

SetObject sets the value of Object.

func (*CreateCompletionResponse) SetUsage

SetUsage sets the value of Usage.

func (*CreateCompletionResponse) UnmarshalJSON

func (s *CreateCompletionResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateCompletionResponse) Validate

func (s *CreateCompletionResponse) Validate() error

type CreateCompletionResponseChoicesItem

type CreateCompletionResponseChoicesItem struct {
	Text         OptString                                         `json:"text"`
	Index        OptInt                                            `json:"index"`
	Logprobs     OptNilCreateCompletionResponseChoicesItemLogprobs `json:"logprobs"`
	FinishReason OptString                                         `json:"finish_reason"`
}

func (*CreateCompletionResponseChoicesItem) Decode

Decode decodes CreateCompletionResponseChoicesItem from json.

func (*CreateCompletionResponseChoicesItem) Encode

Encode implements json.Marshaler.

func (*CreateCompletionResponseChoicesItem) GetFinishReason

func (s *CreateCompletionResponseChoicesItem) GetFinishReason() OptString

GetFinishReason returns the value of FinishReason.

func (*CreateCompletionResponseChoicesItem) GetIndex

GetIndex returns the value of Index.

func (*CreateCompletionResponseChoicesItem) GetLogprobs

GetLogprobs returns the value of Logprobs.

func (*CreateCompletionResponseChoicesItem) GetText

GetText returns the value of Text.

func (*CreateCompletionResponseChoicesItem) MarshalJSON

func (s *CreateCompletionResponseChoicesItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionResponseChoicesItem) SetFinishReason

func (s *CreateCompletionResponseChoicesItem) SetFinishReason(val OptString)

SetFinishReason sets the value of FinishReason.

func (*CreateCompletionResponseChoicesItem) SetIndex

SetIndex sets the value of Index.

func (*CreateCompletionResponseChoicesItem) SetLogprobs

SetLogprobs sets the value of Logprobs.

func (*CreateCompletionResponseChoicesItem) SetText

SetText sets the value of Text.

func (*CreateCompletionResponseChoicesItem) UnmarshalJSON

func (s *CreateCompletionResponseChoicesItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateCompletionResponseChoicesItem) Validate

type CreateCompletionResponseChoicesItemLogprobs

type CreateCompletionResponseChoicesItemLogprobs struct {
	Tokens        []string                                                     `json:"tokens"`
	TokenLogprobs []float64                                                    `json:"token_logprobs"`
	TopLogprobs   []CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem `json:"top_logprobs"`
	TextOffset    []int                                                        `json:"text_offset"`
}

func (*CreateCompletionResponseChoicesItemLogprobs) Decode

Decode decodes CreateCompletionResponseChoicesItemLogprobs from json.

func (*CreateCompletionResponseChoicesItemLogprobs) Encode

Encode implements json.Marshaler.

func (*CreateCompletionResponseChoicesItemLogprobs) GetTextOffset

func (s *CreateCompletionResponseChoicesItemLogprobs) GetTextOffset() []int

GetTextOffset returns the value of TextOffset.

func (*CreateCompletionResponseChoicesItemLogprobs) GetTokenLogprobs

func (s *CreateCompletionResponseChoicesItemLogprobs) GetTokenLogprobs() []float64

GetTokenLogprobs returns the value of TokenLogprobs.

func (*CreateCompletionResponseChoicesItemLogprobs) GetTokens

GetTokens returns the value of Tokens.

func (*CreateCompletionResponseChoicesItemLogprobs) GetTopLogprobs

GetTopLogprobs returns the value of TopLogprobs.

func (*CreateCompletionResponseChoicesItemLogprobs) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionResponseChoicesItemLogprobs) SetTextOffset

func (s *CreateCompletionResponseChoicesItemLogprobs) SetTextOffset(val []int)

SetTextOffset sets the value of TextOffset.

func (*CreateCompletionResponseChoicesItemLogprobs) SetTokenLogprobs

func (s *CreateCompletionResponseChoicesItemLogprobs) SetTokenLogprobs(val []float64)

SetTokenLogprobs sets the value of TokenLogprobs.

func (*CreateCompletionResponseChoicesItemLogprobs) SetTokens

SetTokens sets the value of Tokens.

func (*CreateCompletionResponseChoicesItemLogprobs) SetTopLogprobs

SetTopLogprobs sets the value of TopLogprobs.

func (*CreateCompletionResponseChoicesItemLogprobs) UnmarshalJSON

func (s *CreateCompletionResponseChoicesItemLogprobs) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateCompletionResponseChoicesItemLogprobs) Validate

type CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem

type CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem struct{}

func (*CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem) Decode

Decode decodes CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem from json.

func (*CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem) Encode

Encode implements json.Marshaler.

func (*CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionResponseChoicesItemLogprobsTopLogprobsItem) UnmarshalJSON

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateCompletionResponseUsage

type CreateCompletionResponseUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

func (*CreateCompletionResponseUsage) Decode

Decode decodes CreateCompletionResponseUsage from json.

func (*CreateCompletionResponseUsage) Encode

Encode implements json.Marshaler.

func (*CreateCompletionResponseUsage) GetCompletionTokens

func (s *CreateCompletionResponseUsage) GetCompletionTokens() int

GetCompletionTokens returns the value of CompletionTokens.

func (*CreateCompletionResponseUsage) GetPromptTokens

func (s *CreateCompletionResponseUsage) GetPromptTokens() int

GetPromptTokens returns the value of PromptTokens.

func (*CreateCompletionResponseUsage) GetTotalTokens

func (s *CreateCompletionResponseUsage) GetTotalTokens() int

GetTotalTokens returns the value of TotalTokens.

func (*CreateCompletionResponseUsage) MarshalJSON

func (s *CreateCompletionResponseUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateCompletionResponseUsage) SetCompletionTokens

func (s *CreateCompletionResponseUsage) SetCompletionTokens(val int)

SetCompletionTokens sets the value of CompletionTokens.

func (*CreateCompletionResponseUsage) SetPromptTokens

func (s *CreateCompletionResponseUsage) SetPromptTokens(val int)

SetPromptTokens sets the value of PromptTokens.

func (*CreateCompletionResponseUsage) SetTotalTokens

func (s *CreateCompletionResponseUsage) SetTotalTokens(val int)

SetTotalTokens sets the value of TotalTokens.

func (*CreateCompletionResponseUsage) UnmarshalJSON

func (s *CreateCompletionResponseUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateEditRequest

type CreateEditRequest struct {
	// ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model
	// with this endpoint.
	Model string `json:"model"`
	// The input text to use as a starting point for the edit.
	Input OptNilString `json:"input"`
	// The instruction that tells the model how to edit the prompt.
	Instruction string `json:"instruction"`
	// How many edits to generate for the input and instruction.
	N OptNilInt `json:"n"`
	// 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 OptNilFloat64 `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 OptNilFloat64 `json:"top_p"`
}

Ref: #/components/schemas/CreateEditRequest

func (*CreateEditRequest) Decode

func (s *CreateEditRequest) Decode(d *jx.Decoder) error

Decode decodes CreateEditRequest from json.

func (*CreateEditRequest) Encode

func (s *CreateEditRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateEditRequest) GetInput

func (s *CreateEditRequest) GetInput() OptNilString

GetInput returns the value of Input.

func (*CreateEditRequest) GetInstruction

func (s *CreateEditRequest) GetInstruction() string

GetInstruction returns the value of Instruction.

func (*CreateEditRequest) GetModel

func (s *CreateEditRequest) GetModel() string

GetModel returns the value of Model.

func (*CreateEditRequest) GetN

func (s *CreateEditRequest) GetN() OptNilInt

GetN returns the value of N.

func (*CreateEditRequest) GetTemperature

func (s *CreateEditRequest) GetTemperature() OptNilFloat64

GetTemperature returns the value of Temperature.

func (*CreateEditRequest) GetTopP

func (s *CreateEditRequest) GetTopP() OptNilFloat64

GetTopP returns the value of TopP.

func (*CreateEditRequest) MarshalJSON

func (s *CreateEditRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEditRequest) SetInput

func (s *CreateEditRequest) SetInput(val OptNilString)

SetInput sets the value of Input.

func (*CreateEditRequest) SetInstruction

func (s *CreateEditRequest) SetInstruction(val string)

SetInstruction sets the value of Instruction.

func (*CreateEditRequest) SetModel

func (s *CreateEditRequest) SetModel(val string)

SetModel sets the value of Model.

func (*CreateEditRequest) SetN

func (s *CreateEditRequest) SetN(val OptNilInt)

SetN sets the value of N.

func (*CreateEditRequest) SetTemperature

func (s *CreateEditRequest) SetTemperature(val OptNilFloat64)

SetTemperature sets the value of Temperature.

func (*CreateEditRequest) SetTopP

func (s *CreateEditRequest) SetTopP(val OptNilFloat64)

SetTopP sets the value of TopP.

func (*CreateEditRequest) UnmarshalJSON

func (s *CreateEditRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEditRequest) Validate

func (s *CreateEditRequest) Validate() error

type CreateEditResponse

type CreateEditResponse struct {
	Object  string                          `json:"object"`
	Created int                             `json:"created"`
	Choices []CreateEditResponseChoicesItem `json:"choices"`
	Usage   CreateEditResponseUsage         `json:"usage"`
}

Ref: #/components/schemas/CreateEditResponse

func (*CreateEditResponse) Decode

func (s *CreateEditResponse) Decode(d *jx.Decoder) error

Decode decodes CreateEditResponse from json.

func (*CreateEditResponse) Encode

func (s *CreateEditResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateEditResponse) GetChoices

GetChoices returns the value of Choices.

func (*CreateEditResponse) GetCreated

func (s *CreateEditResponse) GetCreated() int

GetCreated returns the value of Created.

func (*CreateEditResponse) GetObject

func (s *CreateEditResponse) GetObject() string

GetObject returns the value of Object.

func (*CreateEditResponse) GetUsage

GetUsage returns the value of Usage.

func (*CreateEditResponse) MarshalJSON

func (s *CreateEditResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEditResponse) SetChoices

SetChoices sets the value of Choices.

func (*CreateEditResponse) SetCreated

func (s *CreateEditResponse) SetCreated(val int)

SetCreated sets the value of Created.

func (*CreateEditResponse) SetObject

func (s *CreateEditResponse) SetObject(val string)

SetObject sets the value of Object.

func (*CreateEditResponse) SetUsage

SetUsage sets the value of Usage.

func (*CreateEditResponse) UnmarshalJSON

func (s *CreateEditResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEditResponse) Validate

func (s *CreateEditResponse) Validate() error

type CreateEditResponseChoicesItem

type CreateEditResponseChoicesItem struct {
	Text         OptString                                   `json:"text"`
	Index        OptInt                                      `json:"index"`
	Logprobs     OptNilCreateEditResponseChoicesItemLogprobs `json:"logprobs"`
	FinishReason OptString                                   `json:"finish_reason"`
}

func (*CreateEditResponseChoicesItem) Decode

Decode decodes CreateEditResponseChoicesItem from json.

func (*CreateEditResponseChoicesItem) Encode

Encode implements json.Marshaler.

func (*CreateEditResponseChoicesItem) GetFinishReason

func (s *CreateEditResponseChoicesItem) GetFinishReason() OptString

GetFinishReason returns the value of FinishReason.

func (*CreateEditResponseChoicesItem) GetIndex

func (s *CreateEditResponseChoicesItem) GetIndex() OptInt

GetIndex returns the value of Index.

func (*CreateEditResponseChoicesItem) GetLogprobs

GetLogprobs returns the value of Logprobs.

func (*CreateEditResponseChoicesItem) GetText

GetText returns the value of Text.

func (*CreateEditResponseChoicesItem) MarshalJSON

func (s *CreateEditResponseChoicesItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEditResponseChoicesItem) SetFinishReason

func (s *CreateEditResponseChoicesItem) SetFinishReason(val OptString)

SetFinishReason sets the value of FinishReason.

func (*CreateEditResponseChoicesItem) SetIndex

func (s *CreateEditResponseChoicesItem) SetIndex(val OptInt)

SetIndex sets the value of Index.

func (*CreateEditResponseChoicesItem) SetLogprobs

SetLogprobs sets the value of Logprobs.

func (*CreateEditResponseChoicesItem) SetText

func (s *CreateEditResponseChoicesItem) SetText(val OptString)

SetText sets the value of Text.

func (*CreateEditResponseChoicesItem) UnmarshalJSON

func (s *CreateEditResponseChoicesItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEditResponseChoicesItem) Validate

func (s *CreateEditResponseChoicesItem) Validate() error

type CreateEditResponseChoicesItemLogprobs

type CreateEditResponseChoicesItemLogprobs struct {
	Tokens        []string                                               `json:"tokens"`
	TokenLogprobs []float64                                              `json:"token_logprobs"`
	TopLogprobs   []CreateEditResponseChoicesItemLogprobsTopLogprobsItem `json:"top_logprobs"`
	TextOffset    []int                                                  `json:"text_offset"`
}

func (*CreateEditResponseChoicesItemLogprobs) Decode

Decode decodes CreateEditResponseChoicesItemLogprobs from json.

func (*CreateEditResponseChoicesItemLogprobs) Encode

Encode implements json.Marshaler.

func (*CreateEditResponseChoicesItemLogprobs) GetTextOffset

func (s *CreateEditResponseChoicesItemLogprobs) GetTextOffset() []int

GetTextOffset returns the value of TextOffset.

func (*CreateEditResponseChoicesItemLogprobs) GetTokenLogprobs

func (s *CreateEditResponseChoicesItemLogprobs) GetTokenLogprobs() []float64

GetTokenLogprobs returns the value of TokenLogprobs.

func (*CreateEditResponseChoicesItemLogprobs) GetTokens

GetTokens returns the value of Tokens.

func (*CreateEditResponseChoicesItemLogprobs) GetTopLogprobs

GetTopLogprobs returns the value of TopLogprobs.

func (*CreateEditResponseChoicesItemLogprobs) MarshalJSON

func (s *CreateEditResponseChoicesItemLogprobs) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEditResponseChoicesItemLogprobs) SetTextOffset

func (s *CreateEditResponseChoicesItemLogprobs) SetTextOffset(val []int)

SetTextOffset sets the value of TextOffset.

func (*CreateEditResponseChoicesItemLogprobs) SetTokenLogprobs

func (s *CreateEditResponseChoicesItemLogprobs) SetTokenLogprobs(val []float64)

SetTokenLogprobs sets the value of TokenLogprobs.

func (*CreateEditResponseChoicesItemLogprobs) SetTokens

func (s *CreateEditResponseChoicesItemLogprobs) SetTokens(val []string)

SetTokens sets the value of Tokens.

func (*CreateEditResponseChoicesItemLogprobs) SetTopLogprobs

SetTopLogprobs sets the value of TopLogprobs.

func (*CreateEditResponseChoicesItemLogprobs) UnmarshalJSON

func (s *CreateEditResponseChoicesItemLogprobs) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEditResponseChoicesItemLogprobs) Validate

type CreateEditResponseChoicesItemLogprobsTopLogprobsItem

type CreateEditResponseChoicesItemLogprobsTopLogprobsItem struct{}

func (*CreateEditResponseChoicesItemLogprobsTopLogprobsItem) Decode

Decode decodes CreateEditResponseChoicesItemLogprobsTopLogprobsItem from json.

func (*CreateEditResponseChoicesItemLogprobsTopLogprobsItem) Encode

Encode implements json.Marshaler.

func (*CreateEditResponseChoicesItemLogprobsTopLogprobsItem) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateEditResponseChoicesItemLogprobsTopLogprobsItem) UnmarshalJSON

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateEditResponseUsage

type CreateEditResponseUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

func (*CreateEditResponseUsage) Decode

func (s *CreateEditResponseUsage) Decode(d *jx.Decoder) error

Decode decodes CreateEditResponseUsage from json.

func (*CreateEditResponseUsage) Encode

func (s *CreateEditResponseUsage) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateEditResponseUsage) GetCompletionTokens

func (s *CreateEditResponseUsage) GetCompletionTokens() int

GetCompletionTokens returns the value of CompletionTokens.

func (*CreateEditResponseUsage) GetPromptTokens

func (s *CreateEditResponseUsage) GetPromptTokens() int

GetPromptTokens returns the value of PromptTokens.

func (*CreateEditResponseUsage) GetTotalTokens

func (s *CreateEditResponseUsage) GetTotalTokens() int

GetTotalTokens returns the value of TotalTokens.

func (*CreateEditResponseUsage) MarshalJSON

func (s *CreateEditResponseUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEditResponseUsage) SetCompletionTokens

func (s *CreateEditResponseUsage) SetCompletionTokens(val int)

SetCompletionTokens sets the value of CompletionTokens.

func (*CreateEditResponseUsage) SetPromptTokens

func (s *CreateEditResponseUsage) SetPromptTokens(val int)

SetPromptTokens sets the value of PromptTokens.

func (*CreateEditResponseUsage) SetTotalTokens

func (s *CreateEditResponseUsage) SetTotalTokens(val int)

SetTotalTokens sets the value of TotalTokens.

func (*CreateEditResponseUsage) UnmarshalJSON

func (s *CreateEditResponseUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateEmbeddingRequest

type CreateEmbeddingRequest struct {
	// 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"`
	// Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for
	// multiple inputs in a single request, pass an array of strings or array of token arrays. Each input
	// must not exceed 8192 tokens in length.
	Input CreateEmbeddingRequestInput `json:"input"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateEmbeddingRequest

func (*CreateEmbeddingRequest) Decode

func (s *CreateEmbeddingRequest) Decode(d *jx.Decoder) error

Decode decodes CreateEmbeddingRequest from json.

func (*CreateEmbeddingRequest) Encode

func (s *CreateEmbeddingRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateEmbeddingRequest) GetInput

GetInput returns the value of Input.

func (*CreateEmbeddingRequest) GetModel

func (s *CreateEmbeddingRequest) GetModel() string

GetModel returns the value of Model.

func (*CreateEmbeddingRequest) GetUser

func (s *CreateEmbeddingRequest) GetUser() OptString

GetUser returns the value of User.

func (*CreateEmbeddingRequest) MarshalJSON

func (s *CreateEmbeddingRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEmbeddingRequest) SetInput

SetInput sets the value of Input.

func (*CreateEmbeddingRequest) SetModel

func (s *CreateEmbeddingRequest) SetModel(val string)

SetModel sets the value of Model.

func (*CreateEmbeddingRequest) SetUser

func (s *CreateEmbeddingRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateEmbeddingRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEmbeddingRequest) Validate

func (s *CreateEmbeddingRequest) Validate() error

type CreateEmbeddingRequestInput

type CreateEmbeddingRequestInput struct {
	Type        CreateEmbeddingRequestInputType // switch on this field
	String      string
	StringArray []string
}

Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length. CreateEmbeddingRequestInput represents sum type.

func NewStringArrayCreateEmbeddingRequestInput

func NewStringArrayCreateEmbeddingRequestInput(v []string) CreateEmbeddingRequestInput

NewStringArrayCreateEmbeddingRequestInput returns new CreateEmbeddingRequestInput from []string.

func NewStringCreateEmbeddingRequestInput

func NewStringCreateEmbeddingRequestInput(v string) CreateEmbeddingRequestInput

NewStringCreateEmbeddingRequestInput returns new CreateEmbeddingRequestInput from string.

func (*CreateEmbeddingRequestInput) Decode

Decode decodes CreateEmbeddingRequestInput from json.

func (CreateEmbeddingRequestInput) Encode

func (s CreateEmbeddingRequestInput) Encode(e *jx.Encoder)

Encode encodes CreateEmbeddingRequestInput as json.

func (CreateEmbeddingRequestInput) GetString

func (s CreateEmbeddingRequestInput) GetString() (v string, ok bool)

GetString returns string and true boolean if CreateEmbeddingRequestInput is string.

func (CreateEmbeddingRequestInput) GetStringArray

func (s CreateEmbeddingRequestInput) GetStringArray() (v []string, ok bool)

GetStringArray returns []string and true boolean if CreateEmbeddingRequestInput is []string.

func (CreateEmbeddingRequestInput) IsString

func (s CreateEmbeddingRequestInput) IsString() bool

IsString reports whether CreateEmbeddingRequestInput is string.

func (CreateEmbeddingRequestInput) IsStringArray

func (s CreateEmbeddingRequestInput) IsStringArray() bool

IsStringArray reports whether CreateEmbeddingRequestInput is []string.

func (CreateEmbeddingRequestInput) MarshalJSON

func (s CreateEmbeddingRequestInput) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEmbeddingRequestInput) SetString

func (s *CreateEmbeddingRequestInput) SetString(v string)

SetString sets CreateEmbeddingRequestInput to string.

func (*CreateEmbeddingRequestInput) SetStringArray

func (s *CreateEmbeddingRequestInput) SetStringArray(v []string)

SetStringArray sets CreateEmbeddingRequestInput to []string.

func (*CreateEmbeddingRequestInput) UnmarshalJSON

func (s *CreateEmbeddingRequestInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateEmbeddingRequestInput) Validate

func (s CreateEmbeddingRequestInput) Validate() error

type CreateEmbeddingRequestInputType

type CreateEmbeddingRequestInputType string

CreateEmbeddingRequestInputType is oneOf type of CreateEmbeddingRequestInput.

const (
	StringCreateEmbeddingRequestInput      CreateEmbeddingRequestInputType = "string"
	StringArrayCreateEmbeddingRequestInput CreateEmbeddingRequestInputType = "[]string"
)

Possible values for CreateEmbeddingRequestInputType.

type CreateEmbeddingResponse

type CreateEmbeddingResponse struct {
	Object string                            `json:"object"`
	Model  string                            `json:"model"`
	Data   []CreateEmbeddingResponseDataItem `json:"data"`
	Usage  CreateEmbeddingResponseUsage      `json:"usage"`
}

Ref: #/components/schemas/CreateEmbeddingResponse

func (*CreateEmbeddingResponse) Decode

func (s *CreateEmbeddingResponse) Decode(d *jx.Decoder) error

Decode decodes CreateEmbeddingResponse from json.

func (*CreateEmbeddingResponse) Encode

func (s *CreateEmbeddingResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateEmbeddingResponse) GetData

GetData returns the value of Data.

func (*CreateEmbeddingResponse) GetModel

func (s *CreateEmbeddingResponse) GetModel() string

GetModel returns the value of Model.

func (*CreateEmbeddingResponse) GetObject

func (s *CreateEmbeddingResponse) GetObject() string

GetObject returns the value of Object.

func (*CreateEmbeddingResponse) GetUsage

GetUsage returns the value of Usage.

func (*CreateEmbeddingResponse) MarshalJSON

func (s *CreateEmbeddingResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEmbeddingResponse) SetData

SetData sets the value of Data.

func (*CreateEmbeddingResponse) SetModel

func (s *CreateEmbeddingResponse) SetModel(val string)

SetModel sets the value of Model.

func (*CreateEmbeddingResponse) SetObject

func (s *CreateEmbeddingResponse) SetObject(val string)

SetObject sets the value of Object.

func (*CreateEmbeddingResponse) SetUsage

SetUsage sets the value of Usage.

func (*CreateEmbeddingResponse) UnmarshalJSON

func (s *CreateEmbeddingResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEmbeddingResponse) Validate

func (s *CreateEmbeddingResponse) Validate() error

type CreateEmbeddingResponseDataItem

type CreateEmbeddingResponseDataItem struct {
	Index     int       `json:"index"`
	Object    string    `json:"object"`
	Embedding []float64 `json:"embedding"`
}

func (*CreateEmbeddingResponseDataItem) Decode

Decode decodes CreateEmbeddingResponseDataItem from json.

func (*CreateEmbeddingResponseDataItem) Encode

Encode implements json.Marshaler.

func (*CreateEmbeddingResponseDataItem) GetEmbedding

func (s *CreateEmbeddingResponseDataItem) GetEmbedding() []float64

GetEmbedding returns the value of Embedding.

func (*CreateEmbeddingResponseDataItem) GetIndex

func (s *CreateEmbeddingResponseDataItem) GetIndex() int

GetIndex returns the value of Index.

func (*CreateEmbeddingResponseDataItem) GetObject

func (s *CreateEmbeddingResponseDataItem) GetObject() string

GetObject returns the value of Object.

func (*CreateEmbeddingResponseDataItem) MarshalJSON

func (s *CreateEmbeddingResponseDataItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEmbeddingResponseDataItem) SetEmbedding

func (s *CreateEmbeddingResponseDataItem) SetEmbedding(val []float64)

SetEmbedding sets the value of Embedding.

func (*CreateEmbeddingResponseDataItem) SetIndex

func (s *CreateEmbeddingResponseDataItem) SetIndex(val int)

SetIndex sets the value of Index.

func (*CreateEmbeddingResponseDataItem) SetObject

func (s *CreateEmbeddingResponseDataItem) SetObject(val string)

SetObject sets the value of Object.

func (*CreateEmbeddingResponseDataItem) UnmarshalJSON

func (s *CreateEmbeddingResponseDataItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateEmbeddingResponseDataItem) Validate

func (s *CreateEmbeddingResponseDataItem) Validate() error

type CreateEmbeddingResponseUsage

type CreateEmbeddingResponseUsage struct {
	PromptTokens int `json:"prompt_tokens"`
	TotalTokens  int `json:"total_tokens"`
}

func (*CreateEmbeddingResponseUsage) Decode

Decode decodes CreateEmbeddingResponseUsage from json.

func (*CreateEmbeddingResponseUsage) Encode

func (s *CreateEmbeddingResponseUsage) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateEmbeddingResponseUsage) GetPromptTokens

func (s *CreateEmbeddingResponseUsage) GetPromptTokens() int

GetPromptTokens returns the value of PromptTokens.

func (*CreateEmbeddingResponseUsage) GetTotalTokens

func (s *CreateEmbeddingResponseUsage) GetTotalTokens() int

GetTotalTokens returns the value of TotalTokens.

func (*CreateEmbeddingResponseUsage) MarshalJSON

func (s *CreateEmbeddingResponseUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateEmbeddingResponseUsage) SetPromptTokens

func (s *CreateEmbeddingResponseUsage) SetPromptTokens(val int)

SetPromptTokens sets the value of PromptTokens.

func (*CreateEmbeddingResponseUsage) SetTotalTokens

func (s *CreateEmbeddingResponseUsage) SetTotalTokens(val int)

SetTotalTokens sets the value of TotalTokens.

func (*CreateEmbeddingResponseUsage) UnmarshalJSON

func (s *CreateEmbeddingResponseUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateFileRequestMultipart

type CreateFileRequestMultipart struct {
	// Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded.
	// If the `purpose` is set to "fine-tune", each line is a JSON record with "prompt" and "completion"
	// fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data).
	File ht.MultipartFile `json:"file"`
	// The intended purpose of the uploaded documents.
	// Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the
	// format of the uploaded file.
	Purpose string `json:"purpose"`
}

Ref: #/components/schemas/CreateFileRequest

func (*CreateFileRequestMultipart) GetFile

GetFile returns the value of File.

func (*CreateFileRequestMultipart) GetPurpose

func (s *CreateFileRequestMultipart) GetPurpose() string

GetPurpose returns the value of Purpose.

func (*CreateFileRequestMultipart) SetFile

SetFile sets the value of File.

func (*CreateFileRequestMultipart) SetPurpose

func (s *CreateFileRequestMultipart) SetPurpose(val string)

SetPurpose sets the value of Purpose.

type CreateFineTuneRequest

type CreateFineTuneRequest struct {
	// 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, where each training
	// example is a JSON object with the keys "prompt" and "completion".
	// Additionally, you must upload your file with the purpose `fine-tune`.
	// See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) 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](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model).
	// Your train and validation data should be mutually exclusive.
	// Your dataset must be formatted as a JSONL file, where each validation
	// example is a JSON object with the keys "prompt" and "completion".
	// Additionally, you must upload your file with the purpose `fine-tune`.
	// See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details.
	ValidationFile OptNilString `json:"validation_file"`
	// The name of the base model to fine-tune. You can select one of "ada",
	// "babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21.
	// To learn more about these models, see the
	// [Models](https://platform.openai.com/docs/models) documentation.
	Model OptNilString `json:"model"`
	// The number of epochs to train the model for. An epoch refers to one
	// full cycle through the training dataset.
	NEpochs OptNilInt `json:"n_epochs"`
	// The batch size to use for training. The batch size is the number of
	// training examples used to train a single forward and backward pass.
	// By default, the batch size will be dynamically configured to be
	// ~0.2% of the number of examples in the training set, capped at 256 -
	// in general, we've found that larger batch sizes tend to work better
	// for larger datasets.
	BatchSize OptNilInt `json:"batch_size"`
	// The learning rate multiplier to use for training.
	// The fine-tuning learning rate is the original learning rate used for
	// pretraining multiplied by this value.
	// By default, the learning rate multiplier is the 0.05, 0.1, or 0.2
	// depending on final `batch_size` (larger learning rates tend to
	// perform better with larger batch sizes). We recommend experimenting
	// with values in the range 0.02 to 0.2 to see what produces the best
	// results.
	LearningRateMultiplier OptNilFloat64 `json:"learning_rate_multiplier"`
	// The weight to use for loss on the prompt tokens. This controls how
	// much the model tries to learn to generate the prompt (as compared
	// to the completion which always has a weight of 1.0), and can add
	// a stabilizing effect to training when completions are short.
	// If prompts are extremely long (relative to completions), it may make
	// sense to reduce this weight so as to avoid over-prioritizing
	// learning the prompt.
	PromptLossWeight OptNilFloat64 `json:"prompt_loss_weight"`
	// If set, we calculate classification-specific metrics such as accuracy
	// and F-1 score using the validation set at the end of every epoch.
	// These metrics can be viewed in the [results
	// file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model).
	// In order to compute classification metrics, you must provide a
	// `validation_file`. Additionally, you must
	// specify `classification_n_classes` for multiclass classification or
	// `classification_positive_class` for binary classification.
	ComputeClassificationMetrics OptNilBool `json:"compute_classification_metrics"`
	// The number of classes in a classification task.
	// This parameter is required for multiclass classification.
	ClassificationNClasses OptNilInt `json:"classification_n_classes"`
	// The positive class in binary classification.
	// This parameter is needed to generate precision, recall, and F1
	// metrics when doing binary classification.
	ClassificationPositiveClass OptNilString `json:"classification_positive_class"`
	// If this is provided, we calculate F-beta scores at the specified
	// beta values. The F-beta score is a generalization of F-1 score.
	// This is only used for binary classification.
	// With a beta of 1 (i.e. the F-1 score), precision and recall are
	// given the same weight. A larger beta score puts more weight on
	// recall and less on precision. A smaller beta score puts more weight
	// on precision and less on recall.
	ClassificationBetas OptNilFloat64Array `json:"classification_betas"`
	// A string of up to 40 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
	// `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`.
	Suffix OptNilString `json:"suffix"`
}

Ref: #/components/schemas/CreateFineTuneRequest

func (*CreateFineTuneRequest) Decode

func (s *CreateFineTuneRequest) Decode(d *jx.Decoder) error

Decode decodes CreateFineTuneRequest from json.

func (*CreateFineTuneRequest) Encode

func (s *CreateFineTuneRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateFineTuneRequest) GetBatchSize

func (s *CreateFineTuneRequest) GetBatchSize() OptNilInt

GetBatchSize returns the value of BatchSize.

func (*CreateFineTuneRequest) GetClassificationBetas

func (s *CreateFineTuneRequest) GetClassificationBetas() OptNilFloat64Array

GetClassificationBetas returns the value of ClassificationBetas.

func (*CreateFineTuneRequest) GetClassificationNClasses

func (s *CreateFineTuneRequest) GetClassificationNClasses() OptNilInt

GetClassificationNClasses returns the value of ClassificationNClasses.

func (*CreateFineTuneRequest) GetClassificationPositiveClass

func (s *CreateFineTuneRequest) GetClassificationPositiveClass() OptNilString

GetClassificationPositiveClass returns the value of ClassificationPositiveClass.

func (*CreateFineTuneRequest) GetComputeClassificationMetrics

func (s *CreateFineTuneRequest) GetComputeClassificationMetrics() OptNilBool

GetComputeClassificationMetrics returns the value of ComputeClassificationMetrics.

func (*CreateFineTuneRequest) GetLearningRateMultiplier

func (s *CreateFineTuneRequest) GetLearningRateMultiplier() OptNilFloat64

GetLearningRateMultiplier returns the value of LearningRateMultiplier.

func (*CreateFineTuneRequest) GetModel

func (s *CreateFineTuneRequest) GetModel() OptNilString

GetModel returns the value of Model.

func (*CreateFineTuneRequest) GetNEpochs

func (s *CreateFineTuneRequest) GetNEpochs() OptNilInt

GetNEpochs returns the value of NEpochs.

func (*CreateFineTuneRequest) GetPromptLossWeight

func (s *CreateFineTuneRequest) GetPromptLossWeight() OptNilFloat64

GetPromptLossWeight returns the value of PromptLossWeight.

func (*CreateFineTuneRequest) GetSuffix

func (s *CreateFineTuneRequest) GetSuffix() OptNilString

GetSuffix returns the value of Suffix.

func (*CreateFineTuneRequest) GetTrainingFile

func (s *CreateFineTuneRequest) GetTrainingFile() string

GetTrainingFile returns the value of TrainingFile.

func (*CreateFineTuneRequest) GetValidationFile

func (s *CreateFineTuneRequest) GetValidationFile() OptNilString

GetValidationFile returns the value of ValidationFile.

func (*CreateFineTuneRequest) MarshalJSON

func (s *CreateFineTuneRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateFineTuneRequest) SetBatchSize

func (s *CreateFineTuneRequest) SetBatchSize(val OptNilInt)

SetBatchSize sets the value of BatchSize.

func (*CreateFineTuneRequest) SetClassificationBetas

func (s *CreateFineTuneRequest) SetClassificationBetas(val OptNilFloat64Array)

SetClassificationBetas sets the value of ClassificationBetas.

func (*CreateFineTuneRequest) SetClassificationNClasses

func (s *CreateFineTuneRequest) SetClassificationNClasses(val OptNilInt)

SetClassificationNClasses sets the value of ClassificationNClasses.

func (*CreateFineTuneRequest) SetClassificationPositiveClass

func (s *CreateFineTuneRequest) SetClassificationPositiveClass(val OptNilString)

SetClassificationPositiveClass sets the value of ClassificationPositiveClass.

func (*CreateFineTuneRequest) SetComputeClassificationMetrics

func (s *CreateFineTuneRequest) SetComputeClassificationMetrics(val OptNilBool)

SetComputeClassificationMetrics sets the value of ComputeClassificationMetrics.

func (*CreateFineTuneRequest) SetLearningRateMultiplier

func (s *CreateFineTuneRequest) SetLearningRateMultiplier(val OptNilFloat64)

SetLearningRateMultiplier sets the value of LearningRateMultiplier.

func (*CreateFineTuneRequest) SetModel

func (s *CreateFineTuneRequest) SetModel(val OptNilString)

SetModel sets the value of Model.

func (*CreateFineTuneRequest) SetNEpochs

func (s *CreateFineTuneRequest) SetNEpochs(val OptNilInt)

SetNEpochs sets the value of NEpochs.

func (*CreateFineTuneRequest) SetPromptLossWeight

func (s *CreateFineTuneRequest) SetPromptLossWeight(val OptNilFloat64)

SetPromptLossWeight sets the value of PromptLossWeight.

func (*CreateFineTuneRequest) SetSuffix

func (s *CreateFineTuneRequest) SetSuffix(val OptNilString)

SetSuffix sets the value of Suffix.

func (*CreateFineTuneRequest) SetTrainingFile

func (s *CreateFineTuneRequest) SetTrainingFile(val string)

SetTrainingFile sets the value of TrainingFile.

func (*CreateFineTuneRequest) SetValidationFile

func (s *CreateFineTuneRequest) SetValidationFile(val OptNilString)

SetValidationFile sets the value of ValidationFile.

func (*CreateFineTuneRequest) UnmarshalJSON

func (s *CreateFineTuneRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateFineTuneRequest) Validate

func (s *CreateFineTuneRequest) Validate() error

type CreateImageEditRequestMultipart

type CreateImageEditRequestMultipart 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 ht.MultipartFile `json:"image"`
	// 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 OptMultipartFile `json:"mask"`
	// A text description of the desired image(s). The maximum length is 1000 characters.
	Prompt string `json:"prompt"`
	// The number of images to generate. Must be between 1 and 10.
	N OptNilInt `json:"n"`
	// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
	Size OptNilCreateImageEditRequestMultipartSize `json:"size"`
	// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
	ResponseFormat OptNilCreateImageEditRequestMultipartResponseFormat `json:"response_format"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateImageEditRequest

func (*CreateImageEditRequestMultipart) GetImage

GetImage returns the value of Image.

func (*CreateImageEditRequestMultipart) GetMask

GetMask returns the value of Mask.

func (*CreateImageEditRequestMultipart) GetN

GetN returns the value of N.

func (*CreateImageEditRequestMultipart) GetPrompt

func (s *CreateImageEditRequestMultipart) GetPrompt() string

GetPrompt returns the value of Prompt.

func (*CreateImageEditRequestMultipart) GetResponseFormat

GetResponseFormat returns the value of ResponseFormat.

func (*CreateImageEditRequestMultipart) GetSize

GetSize returns the value of Size.

func (*CreateImageEditRequestMultipart) GetUser

GetUser returns the value of User.

func (*CreateImageEditRequestMultipart) SetImage

SetImage sets the value of Image.

func (*CreateImageEditRequestMultipart) SetMask

SetMask sets the value of Mask.

func (*CreateImageEditRequestMultipart) SetN

SetN sets the value of N.

func (*CreateImageEditRequestMultipart) SetPrompt

func (s *CreateImageEditRequestMultipart) SetPrompt(val string)

SetPrompt sets the value of Prompt.

func (*CreateImageEditRequestMultipart) SetResponseFormat

SetResponseFormat sets the value of ResponseFormat.

func (*CreateImageEditRequestMultipart) SetSize

SetSize sets the value of Size.

func (*CreateImageEditRequestMultipart) SetUser

SetUser sets the value of User.

func (*CreateImageEditRequestMultipart) Validate

func (s *CreateImageEditRequestMultipart) Validate() error

type CreateImageEditRequestMultipartResponseFormat

type CreateImageEditRequestMultipartResponseFormat string

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

const (
	CreateImageEditRequestMultipartResponseFormatURL     CreateImageEditRequestMultipartResponseFormat = "url"
	CreateImageEditRequestMultipartResponseFormatB64JSON CreateImageEditRequestMultipartResponseFormat = "b64_json"
)

func (CreateImageEditRequestMultipartResponseFormat) AllValues

AllValues returns all CreateImageEditRequestMultipartResponseFormat values.

func (CreateImageEditRequestMultipartResponseFormat) MarshalText

MarshalText implements encoding.TextMarshaler.

func (*CreateImageEditRequestMultipartResponseFormat) UnmarshalText

func (s *CreateImageEditRequestMultipartResponseFormat) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateImageEditRequestMultipartResponseFormat) Validate

type CreateImageEditRequestMultipartSize

type CreateImageEditRequestMultipartSize string

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

const (
	CreateImageEditRequestMultipartSize256x256   CreateImageEditRequestMultipartSize = "256x256"
	CreateImageEditRequestMultipartSize512x512   CreateImageEditRequestMultipartSize = "512x512"
	CreateImageEditRequestMultipartSize1024x1024 CreateImageEditRequestMultipartSize = "1024x1024"
)

func (CreateImageEditRequestMultipartSize) AllValues

AllValues returns all CreateImageEditRequestMultipartSize values.

func (CreateImageEditRequestMultipartSize) MarshalText

func (s CreateImageEditRequestMultipartSize) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*CreateImageEditRequestMultipartSize) UnmarshalText

func (s *CreateImageEditRequestMultipartSize) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateImageEditRequestMultipartSize) Validate

type CreateImageRequest

type CreateImageRequest struct {
	// A text description of the desired image(s). The maximum length is 1000 characters.
	Prompt string `json:"prompt"`
	// The number of images to generate. Must be between 1 and 10.
	N OptNilInt `json:"n"`
	// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
	Size OptNilCreateImageRequestSize `json:"size"`
	// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
	ResponseFormat OptNilCreateImageRequestResponseFormat `json:"response_format"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateImageRequest

func (*CreateImageRequest) Decode

func (s *CreateImageRequest) Decode(d *jx.Decoder) error

Decode decodes CreateImageRequest from json.

func (*CreateImageRequest) Encode

func (s *CreateImageRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateImageRequest) GetN

func (s *CreateImageRequest) GetN() OptNilInt

GetN returns the value of N.

func (*CreateImageRequest) GetPrompt

func (s *CreateImageRequest) GetPrompt() string

GetPrompt returns the value of Prompt.

func (*CreateImageRequest) GetResponseFormat

GetResponseFormat returns the value of ResponseFormat.

func (*CreateImageRequest) GetSize

GetSize returns the value of Size.

func (*CreateImageRequest) GetUser

func (s *CreateImageRequest) GetUser() OptString

GetUser returns the value of User.

func (*CreateImageRequest) MarshalJSON

func (s *CreateImageRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateImageRequest) SetN

func (s *CreateImageRequest) SetN(val OptNilInt)

SetN sets the value of N.

func (*CreateImageRequest) SetPrompt

func (s *CreateImageRequest) SetPrompt(val string)

SetPrompt sets the value of Prompt.

func (*CreateImageRequest) SetResponseFormat

SetResponseFormat sets the value of ResponseFormat.

func (*CreateImageRequest) SetSize

SetSize sets the value of Size.

func (*CreateImageRequest) SetUser

func (s *CreateImageRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateImageRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateImageRequest) Validate

func (s *CreateImageRequest) Validate() error

type CreateImageRequestResponseFormat

type CreateImageRequestResponseFormat string

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) AllValues

AllValues returns all CreateImageRequestResponseFormat values.

func (*CreateImageRequestResponseFormat) Decode

Decode decodes CreateImageRequestResponseFormat from json.

func (CreateImageRequestResponseFormat) Encode

Encode encodes CreateImageRequestResponseFormat as json.

func (CreateImageRequestResponseFormat) MarshalJSON

func (s CreateImageRequestResponseFormat) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (CreateImageRequestResponseFormat) MarshalText

func (s CreateImageRequestResponseFormat) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*CreateImageRequestResponseFormat) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateImageRequestResponseFormat) UnmarshalText

func (s *CreateImageRequestResponseFormat) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateImageRequestResponseFormat) Validate

type CreateImageRequestSize

type CreateImageRequestSize string

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

const (
	CreateImageRequestSize256x256   CreateImageRequestSize = "256x256"
	CreateImageRequestSize512x512   CreateImageRequestSize = "512x512"
	CreateImageRequestSize1024x1024 CreateImageRequestSize = "1024x1024"
)

func (CreateImageRequestSize) AllValues

AllValues returns all CreateImageRequestSize values.

func (*CreateImageRequestSize) Decode

func (s *CreateImageRequestSize) Decode(d *jx.Decoder) error

Decode decodes CreateImageRequestSize from json.

func (CreateImageRequestSize) Encode

func (s CreateImageRequestSize) Encode(e *jx.Encoder)

Encode encodes CreateImageRequestSize as json.

func (CreateImageRequestSize) MarshalJSON

func (s CreateImageRequestSize) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (CreateImageRequestSize) MarshalText

func (s CreateImageRequestSize) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*CreateImageRequestSize) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateImageRequestSize) UnmarshalText

func (s *CreateImageRequestSize) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateImageRequestSize) Validate

func (s CreateImageRequestSize) Validate() error

type CreateImageVariationRequestMultipart

type CreateImageVariationRequestMultipart struct {
	// The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and
	// square.
	Image ht.MultipartFile `json:"image"`
	// The number of images to generate. Must be between 1 and 10.
	N OptNilInt `json:"n"`
	// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
	Size OptNilCreateImageVariationRequestMultipartSize `json:"size"`
	// The format in which the generated images are returned. Must be one of `url` or `b64_json`.
	ResponseFormat OptNilCreateImageVariationRequestMultipartResponseFormat `json:"response_format"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateImageVariationRequest

func (*CreateImageVariationRequestMultipart) GetImage

GetImage returns the value of Image.

func (*CreateImageVariationRequestMultipart) GetN

GetN returns the value of N.

func (*CreateImageVariationRequestMultipart) GetResponseFormat

GetResponseFormat returns the value of ResponseFormat.

func (*CreateImageVariationRequestMultipart) GetSize

GetSize returns the value of Size.

func (*CreateImageVariationRequestMultipart) GetUser

GetUser returns the value of User.

func (*CreateImageVariationRequestMultipart) SetImage

SetImage sets the value of Image.

func (*CreateImageVariationRequestMultipart) SetN

SetN sets the value of N.

func (*CreateImageVariationRequestMultipart) SetResponseFormat

SetResponseFormat sets the value of ResponseFormat.

func (*CreateImageVariationRequestMultipart) SetSize

SetSize sets the value of Size.

func (*CreateImageVariationRequestMultipart) SetUser

SetUser sets the value of User.

func (*CreateImageVariationRequestMultipart) Validate

type CreateImageVariationRequestMultipartResponseFormat

type CreateImageVariationRequestMultipartResponseFormat string

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

const (
	CreateImageVariationRequestMultipartResponseFormatURL     CreateImageVariationRequestMultipartResponseFormat = "url"
	CreateImageVariationRequestMultipartResponseFormatB64JSON CreateImageVariationRequestMultipartResponseFormat = "b64_json"
)

func (CreateImageVariationRequestMultipartResponseFormat) AllValues

AllValues returns all CreateImageVariationRequestMultipartResponseFormat values.

func (CreateImageVariationRequestMultipartResponseFormat) MarshalText

MarshalText implements encoding.TextMarshaler.

func (*CreateImageVariationRequestMultipartResponseFormat) UnmarshalText

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateImageVariationRequestMultipartResponseFormat) Validate

type CreateImageVariationRequestMultipartSize

type CreateImageVariationRequestMultipartSize string

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

const (
	CreateImageVariationRequestMultipartSize256x256   CreateImageVariationRequestMultipartSize = "256x256"
	CreateImageVariationRequestMultipartSize512x512   CreateImageVariationRequestMultipartSize = "512x512"
	CreateImageVariationRequestMultipartSize1024x1024 CreateImageVariationRequestMultipartSize = "1024x1024"
)

func (CreateImageVariationRequestMultipartSize) AllValues

AllValues returns all CreateImageVariationRequestMultipartSize values.

func (CreateImageVariationRequestMultipartSize) MarshalText

MarshalText implements encoding.TextMarshaler.

func (*CreateImageVariationRequestMultipartSize) UnmarshalText

func (s *CreateImageVariationRequestMultipartSize) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateImageVariationRequestMultipartSize) Validate

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 OptString `json:"model"`
}

Ref: #/components/schemas/CreateModerationRequest

func (*CreateModerationRequest) Decode

func (s *CreateModerationRequest) Decode(d *jx.Decoder) error

Decode decodes CreateModerationRequest from json.

func (*CreateModerationRequest) Encode

func (s *CreateModerationRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateModerationRequest) GetInput

GetInput returns the value of Input.

func (*CreateModerationRequest) GetModel

func (s *CreateModerationRequest) GetModel() OptString

GetModel returns the value of Model.

func (*CreateModerationRequest) MarshalJSON

func (s *CreateModerationRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateModerationRequest) SetInput

SetInput sets the value of Input.

func (*CreateModerationRequest) SetModel

func (s *CreateModerationRequest) SetModel(val OptString)

SetModel sets the value of Model.

func (*CreateModerationRequest) UnmarshalJSON

func (s *CreateModerationRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateModerationRequest) Validate

func (s *CreateModerationRequest) Validate() error

type CreateModerationRequestInput

type CreateModerationRequestInput struct {
	Type        CreateModerationRequestInputType // switch on this field
	String      string
	StringArray []string
}

The input text to classify. CreateModerationRequestInput represents sum type.

func NewStringArrayCreateModerationRequestInput

func NewStringArrayCreateModerationRequestInput(v []string) CreateModerationRequestInput

NewStringArrayCreateModerationRequestInput returns new CreateModerationRequestInput from []string.

func NewStringCreateModerationRequestInput

func NewStringCreateModerationRequestInput(v string) CreateModerationRequestInput

NewStringCreateModerationRequestInput returns new CreateModerationRequestInput from string.

func (*CreateModerationRequestInput) Decode

Decode decodes CreateModerationRequestInput from json.

func (CreateModerationRequestInput) Encode

Encode encodes CreateModerationRequestInput as json.

func (CreateModerationRequestInput) GetString

func (s CreateModerationRequestInput) GetString() (v string, ok bool)

GetString returns string and true boolean if CreateModerationRequestInput is string.

func (CreateModerationRequestInput) GetStringArray

func (s CreateModerationRequestInput) GetStringArray() (v []string, ok bool)

GetStringArray returns []string and true boolean if CreateModerationRequestInput is []string.

func (CreateModerationRequestInput) IsString

func (s CreateModerationRequestInput) IsString() bool

IsString reports whether CreateModerationRequestInput is string.

func (CreateModerationRequestInput) IsStringArray

func (s CreateModerationRequestInput) IsStringArray() bool

IsStringArray reports whether CreateModerationRequestInput is []string.

func (CreateModerationRequestInput) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateModerationRequestInput) SetString

func (s *CreateModerationRequestInput) SetString(v string)

SetString sets CreateModerationRequestInput to string.

func (*CreateModerationRequestInput) SetStringArray

func (s *CreateModerationRequestInput) SetStringArray(v []string)

SetStringArray sets CreateModerationRequestInput to []string.

func (*CreateModerationRequestInput) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateModerationRequestInput) Validate

func (s CreateModerationRequestInput) Validate() error

type CreateModerationRequestInputType

type CreateModerationRequestInputType string

CreateModerationRequestInputType is oneOf type of CreateModerationRequestInput.

const (
	StringCreateModerationRequestInput      CreateModerationRequestInputType = "string"
	StringArrayCreateModerationRequestInput CreateModerationRequestInputType = "[]string"
)

Possible values for CreateModerationRequestInputType.

type CreateModerationResponse

type CreateModerationResponse struct {
	ID      string                                `json:"id"`
	Model   string                                `json:"model"`
	Results []CreateModerationResponseResultsItem `json:"results"`
}

Ref: #/components/schemas/CreateModerationResponse

func (*CreateModerationResponse) Decode

func (s *CreateModerationResponse) Decode(d *jx.Decoder) error

Decode decodes CreateModerationResponse from json.

func (*CreateModerationResponse) Encode

func (s *CreateModerationResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateModerationResponse) GetID

func (s *CreateModerationResponse) GetID() string

GetID returns the value of ID.

func (*CreateModerationResponse) GetModel

func (s *CreateModerationResponse) GetModel() string

GetModel returns the value of Model.

func (*CreateModerationResponse) GetResults

GetResults returns the value of Results.

func (*CreateModerationResponse) MarshalJSON

func (s *CreateModerationResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateModerationResponse) SetID

func (s *CreateModerationResponse) SetID(val string)

SetID sets the value of ID.

func (*CreateModerationResponse) SetModel

func (s *CreateModerationResponse) SetModel(val string)

SetModel sets the value of Model.

func (*CreateModerationResponse) SetResults

SetResults sets the value of Results.

func (*CreateModerationResponse) UnmarshalJSON

func (s *CreateModerationResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateModerationResponse) Validate

func (s *CreateModerationResponse) Validate() error

type CreateModerationResponseResultsItem

type CreateModerationResponseResultsItem struct {
	Flagged        bool                                              `json:"flagged"`
	Categories     CreateModerationResponseResultsItemCategories     `json:"categories"`
	CategoryScores CreateModerationResponseResultsItemCategoryScores `json:"category_scores"`
}

func (*CreateModerationResponseResultsItem) Decode

Decode decodes CreateModerationResponseResultsItem from json.

func (*CreateModerationResponseResultsItem) Encode

Encode implements json.Marshaler.

func (*CreateModerationResponseResultsItem) GetCategories

GetCategories returns the value of Categories.

func (*CreateModerationResponseResultsItem) GetCategoryScores

GetCategoryScores returns the value of CategoryScores.

func (*CreateModerationResponseResultsItem) GetFlagged

func (s *CreateModerationResponseResultsItem) GetFlagged() bool

GetFlagged returns the value of Flagged.

func (*CreateModerationResponseResultsItem) MarshalJSON

func (s *CreateModerationResponseResultsItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateModerationResponseResultsItem) SetCategories

SetCategories sets the value of Categories.

func (*CreateModerationResponseResultsItem) SetCategoryScores

SetCategoryScores sets the value of CategoryScores.

func (*CreateModerationResponseResultsItem) SetFlagged

func (s *CreateModerationResponseResultsItem) SetFlagged(val bool)

SetFlagged sets the value of Flagged.

func (*CreateModerationResponseResultsItem) UnmarshalJSON

func (s *CreateModerationResponseResultsItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateModerationResponseResultsItem) Validate

type CreateModerationResponseResultsItemCategories

type CreateModerationResponseResultsItemCategories struct {
	Hate                 bool `json:"hate"`
	HateSlashThreatening bool `json:"hate/threatening"`
	SelfMinusHarm        bool `json:"self-harm"`
	Sexual               bool `json:"sexual"`
	SexualSlashMinors    bool `json:"sexual/minors"`
	Violence             bool `json:"violence"`
	ViolenceSlashGraphic bool `json:"violence/graphic"`
}

func (*CreateModerationResponseResultsItemCategories) Decode

Decode decodes CreateModerationResponseResultsItemCategories from json.

func (*CreateModerationResponseResultsItemCategories) Encode

Encode implements json.Marshaler.

func (*CreateModerationResponseResultsItemCategories) GetHate

GetHate returns the value of Hate.

func (*CreateModerationResponseResultsItemCategories) GetHateSlashThreatening

func (s *CreateModerationResponseResultsItemCategories) GetHateSlashThreatening() bool

GetHateSlashThreatening returns the value of HateSlashThreatening.

func (*CreateModerationResponseResultsItemCategories) GetSelfMinusHarm

GetSelfMinusHarm returns the value of SelfMinusHarm.

func (*CreateModerationResponseResultsItemCategories) GetSexual

GetSexual returns the value of Sexual.

func (*CreateModerationResponseResultsItemCategories) GetSexualSlashMinors

func (s *CreateModerationResponseResultsItemCategories) GetSexualSlashMinors() bool

GetSexualSlashMinors returns the value of SexualSlashMinors.

func (*CreateModerationResponseResultsItemCategories) GetViolence

GetViolence returns the value of Violence.

func (*CreateModerationResponseResultsItemCategories) GetViolenceSlashGraphic

func (s *CreateModerationResponseResultsItemCategories) GetViolenceSlashGraphic() bool

GetViolenceSlashGraphic returns the value of ViolenceSlashGraphic.

func (*CreateModerationResponseResultsItemCategories) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateModerationResponseResultsItemCategories) SetHate

SetHate sets the value of Hate.

func (*CreateModerationResponseResultsItemCategories) SetHateSlashThreatening

func (s *CreateModerationResponseResultsItemCategories) SetHateSlashThreatening(val bool)

SetHateSlashThreatening sets the value of HateSlashThreatening.

func (*CreateModerationResponseResultsItemCategories) SetSelfMinusHarm

func (s *CreateModerationResponseResultsItemCategories) SetSelfMinusHarm(val bool)

SetSelfMinusHarm sets the value of SelfMinusHarm.

func (*CreateModerationResponseResultsItemCategories) SetSexual

SetSexual sets the value of Sexual.

func (*CreateModerationResponseResultsItemCategories) SetSexualSlashMinors

func (s *CreateModerationResponseResultsItemCategories) SetSexualSlashMinors(val bool)

SetSexualSlashMinors sets the value of SexualSlashMinors.

func (*CreateModerationResponseResultsItemCategories) SetViolence

SetViolence sets the value of Violence.

func (*CreateModerationResponseResultsItemCategories) SetViolenceSlashGraphic

func (s *CreateModerationResponseResultsItemCategories) SetViolenceSlashGraphic(val bool)

SetViolenceSlashGraphic sets the value of ViolenceSlashGraphic.

func (*CreateModerationResponseResultsItemCategories) UnmarshalJSON

func (s *CreateModerationResponseResultsItemCategories) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateModerationResponseResultsItemCategoryScores

type CreateModerationResponseResultsItemCategoryScores struct {
	Hate                 float64 `json:"hate"`
	HateSlashThreatening float64 `json:"hate/threatening"`
	SelfMinusHarm        float64 `json:"self-harm"`
	Sexual               float64 `json:"sexual"`
	SexualSlashMinors    float64 `json:"sexual/minors"`
	Violence             float64 `json:"violence"`
	ViolenceSlashGraphic float64 `json:"violence/graphic"`
}

func (*CreateModerationResponseResultsItemCategoryScores) Decode

Decode decodes CreateModerationResponseResultsItemCategoryScores from json.

func (*CreateModerationResponseResultsItemCategoryScores) Encode

Encode implements json.Marshaler.

func (*CreateModerationResponseResultsItemCategoryScores) GetHate

GetHate returns the value of Hate.

func (*CreateModerationResponseResultsItemCategoryScores) GetHateSlashThreatening

func (s *CreateModerationResponseResultsItemCategoryScores) GetHateSlashThreatening() float64

GetHateSlashThreatening returns the value of HateSlashThreatening.

func (*CreateModerationResponseResultsItemCategoryScores) GetSelfMinusHarm

GetSelfMinusHarm returns the value of SelfMinusHarm.

func (*CreateModerationResponseResultsItemCategoryScores) GetSexual

GetSexual returns the value of Sexual.

func (*CreateModerationResponseResultsItemCategoryScores) GetSexualSlashMinors

GetSexualSlashMinors returns the value of SexualSlashMinors.

func (*CreateModerationResponseResultsItemCategoryScores) GetViolence

GetViolence returns the value of Violence.

func (*CreateModerationResponseResultsItemCategoryScores) GetViolenceSlashGraphic

func (s *CreateModerationResponseResultsItemCategoryScores) GetViolenceSlashGraphic() float64

GetViolenceSlashGraphic returns the value of ViolenceSlashGraphic.

func (*CreateModerationResponseResultsItemCategoryScores) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*CreateModerationResponseResultsItemCategoryScores) SetHate

SetHate sets the value of Hate.

func (*CreateModerationResponseResultsItemCategoryScores) SetHateSlashThreatening

func (s *CreateModerationResponseResultsItemCategoryScores) SetHateSlashThreatening(val float64)

SetHateSlashThreatening sets the value of HateSlashThreatening.

func (*CreateModerationResponseResultsItemCategoryScores) SetSelfMinusHarm

SetSelfMinusHarm sets the value of SelfMinusHarm.

func (*CreateModerationResponseResultsItemCategoryScores) SetSexual

SetSexual sets the value of Sexual.

func (*CreateModerationResponseResultsItemCategoryScores) SetSexualSlashMinors

func (s *CreateModerationResponseResultsItemCategoryScores) SetSexualSlashMinors(val float64)

SetSexualSlashMinors sets the value of SexualSlashMinors.

func (*CreateModerationResponseResultsItemCategoryScores) SetViolence

SetViolence sets the value of Violence.

func (*CreateModerationResponseResultsItemCategoryScores) SetViolenceSlashGraphic

func (s *CreateModerationResponseResultsItemCategoryScores) SetViolenceSlashGraphic(val float64)

SetViolenceSlashGraphic sets the value of ViolenceSlashGraphic.

func (*CreateModerationResponseResultsItemCategoryScores) UnmarshalJSON

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateModerationResponseResultsItemCategoryScores) Validate

type CreateSearchParams

type CreateSearchParams struct {
	// The ID of the engine to use for this request.  You can select one of `ada`, `babbage`, `curie`, or
	// `davinci`.
	EngineID string
}

CreateSearchParams is parameters of createSearch operation.

type CreateSearchRequest

type CreateSearchRequest struct {
	// Query to search against the documents.
	Query string `json:"query"`
	// Up to 200 documents to search over, provided as a list of strings.
	// The maximum document length (in tokens) is 2034 minus the number of tokens in the query.
	// You should specify either `documents` or a `file`, but not both.
	Documents OptNilStringArray `json:"documents"`
	// The ID of an uploaded file that contains documents to search over.
	// You should specify either `documents` or a `file`, but not both.
	File OptNilString `json:"file"`
	// The maximum number of documents to be re-ranked and returned by search.
	// This flag only takes effect when `file` is set.
	MaxRerank OptNilInt `json:"max_rerank"`
	// A special boolean flag for showing metadata. If set to `true`, each document entry in the returned
	// JSON will contain a "metadata" field.
	// This flag only takes effect when `file` is set.
	ReturnMetadata OptNilBool `json:"return_metadata"`
	// 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 OptString `json:"user"`
}

Ref: #/components/schemas/CreateSearchRequest

func (*CreateSearchRequest) Decode

func (s *CreateSearchRequest) Decode(d *jx.Decoder) error

Decode decodes CreateSearchRequest from json.

func (*CreateSearchRequest) Encode

func (s *CreateSearchRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateSearchRequest) GetDocuments

func (s *CreateSearchRequest) GetDocuments() OptNilStringArray

GetDocuments returns the value of Documents.

func (*CreateSearchRequest) GetFile

func (s *CreateSearchRequest) GetFile() OptNilString

GetFile returns the value of File.

func (*CreateSearchRequest) GetMaxRerank

func (s *CreateSearchRequest) GetMaxRerank() OptNilInt

GetMaxRerank returns the value of MaxRerank.

func (*CreateSearchRequest) GetQuery

func (s *CreateSearchRequest) GetQuery() string

GetQuery returns the value of Query.

func (*CreateSearchRequest) GetReturnMetadata

func (s *CreateSearchRequest) GetReturnMetadata() OptNilBool

GetReturnMetadata returns the value of ReturnMetadata.

func (*CreateSearchRequest) GetUser

func (s *CreateSearchRequest) GetUser() OptString

GetUser returns the value of User.

func (*CreateSearchRequest) MarshalJSON

func (s *CreateSearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateSearchRequest) SetDocuments

func (s *CreateSearchRequest) SetDocuments(val OptNilStringArray)

SetDocuments sets the value of Documents.

func (*CreateSearchRequest) SetFile

func (s *CreateSearchRequest) SetFile(val OptNilString)

SetFile sets the value of File.

func (*CreateSearchRequest) SetMaxRerank

func (s *CreateSearchRequest) SetMaxRerank(val OptNilInt)

SetMaxRerank sets the value of MaxRerank.

func (*CreateSearchRequest) SetQuery

func (s *CreateSearchRequest) SetQuery(val string)

SetQuery sets the value of Query.

func (*CreateSearchRequest) SetReturnMetadata

func (s *CreateSearchRequest) SetReturnMetadata(val OptNilBool)

SetReturnMetadata sets the value of ReturnMetadata.

func (*CreateSearchRequest) SetUser

func (s *CreateSearchRequest) SetUser(val OptString)

SetUser sets the value of User.

func (*CreateSearchRequest) UnmarshalJSON

func (s *CreateSearchRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateSearchRequest) Validate

func (s *CreateSearchRequest) Validate() error

type CreateSearchResponse

type CreateSearchResponse struct {
	Object OptString                      `json:"object"`
	Model  OptString                      `json:"model"`
	Data   []CreateSearchResponseDataItem `json:"data"`
}

Ref: #/components/schemas/CreateSearchResponse

func (*CreateSearchResponse) Decode

func (s *CreateSearchResponse) Decode(d *jx.Decoder) error

Decode decodes CreateSearchResponse from json.

func (*CreateSearchResponse) Encode

func (s *CreateSearchResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateSearchResponse) GetData

GetData returns the value of Data.

func (*CreateSearchResponse) GetModel

func (s *CreateSearchResponse) GetModel() OptString

GetModel returns the value of Model.

func (*CreateSearchResponse) GetObject

func (s *CreateSearchResponse) GetObject() OptString

GetObject returns the value of Object.

func (*CreateSearchResponse) MarshalJSON

func (s *CreateSearchResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateSearchResponse) SetData

SetData sets the value of Data.

func (*CreateSearchResponse) SetModel

func (s *CreateSearchResponse) SetModel(val OptString)

SetModel sets the value of Model.

func (*CreateSearchResponse) SetObject

func (s *CreateSearchResponse) SetObject(val OptString)

SetObject sets the value of Object.

func (*CreateSearchResponse) UnmarshalJSON

func (s *CreateSearchResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateSearchResponse) Validate

func (s *CreateSearchResponse) Validate() error

type CreateSearchResponseDataItem

type CreateSearchResponseDataItem struct {
	Object   OptString  `json:"object"`
	Document OptInt     `json:"document"`
	Score    OptFloat64 `json:"score"`
}

func (*CreateSearchResponseDataItem) Decode

Decode decodes CreateSearchResponseDataItem from json.

func (*CreateSearchResponseDataItem) Encode

func (s *CreateSearchResponseDataItem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateSearchResponseDataItem) GetDocument

func (s *CreateSearchResponseDataItem) GetDocument() OptInt

GetDocument returns the value of Document.

func (*CreateSearchResponseDataItem) GetObject

func (s *CreateSearchResponseDataItem) GetObject() OptString

GetObject returns the value of Object.

func (*CreateSearchResponseDataItem) GetScore

GetScore returns the value of Score.

func (*CreateSearchResponseDataItem) MarshalJSON

func (s *CreateSearchResponseDataItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateSearchResponseDataItem) SetDocument

func (s *CreateSearchResponseDataItem) SetDocument(val OptInt)

SetDocument sets the value of Document.

func (*CreateSearchResponseDataItem) SetObject

func (s *CreateSearchResponseDataItem) SetObject(val OptString)

SetObject sets the value of Object.

func (*CreateSearchResponseDataItem) SetScore

func (s *CreateSearchResponseDataItem) SetScore(val OptFloat64)

SetScore sets the value of Score.

func (*CreateSearchResponseDataItem) UnmarshalJSON

func (s *CreateSearchResponseDataItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateSearchResponseDataItem) Validate

func (s *CreateSearchResponseDataItem) Validate() error

type CreateTranscriptionRequestMultipart

type CreateTranscriptionRequestMultipart struct {
	// The audio file to transcribe, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
	File ht.MultipartFile `json:"file"`
	// ID of the model to use. Only `whisper-1` is currently available.
	Model string `json:"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 OptString `json:"prompt"`
	// The format of the transcript output, in one of these options: json, text, srt, verbose_json, or
	// vtt.
	ResponseFormat OptString `json:"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 OptFloat64 `json:"temperature"`
	// 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 OptString `json:"language"`
}

Ref: #/components/schemas/CreateTranscriptionRequest

func (*CreateTranscriptionRequestMultipart) GetFile

GetFile returns the value of File.

func (*CreateTranscriptionRequestMultipart) GetLanguage

GetLanguage returns the value of Language.

func (*CreateTranscriptionRequestMultipart) GetModel

GetModel returns the value of Model.

func (*CreateTranscriptionRequestMultipart) GetPrompt

GetPrompt returns the value of Prompt.

func (*CreateTranscriptionRequestMultipart) GetResponseFormat

func (s *CreateTranscriptionRequestMultipart) GetResponseFormat() OptString

GetResponseFormat returns the value of ResponseFormat.

func (*CreateTranscriptionRequestMultipart) GetTemperature

func (s *CreateTranscriptionRequestMultipart) GetTemperature() OptFloat64

GetTemperature returns the value of Temperature.

func (*CreateTranscriptionRequestMultipart) SetFile

SetFile sets the value of File.

func (*CreateTranscriptionRequestMultipart) SetLanguage

func (s *CreateTranscriptionRequestMultipart) SetLanguage(val OptString)

SetLanguage sets the value of Language.

func (*CreateTranscriptionRequestMultipart) SetModel

SetModel sets the value of Model.

func (*CreateTranscriptionRequestMultipart) SetPrompt

SetPrompt sets the value of Prompt.

func (*CreateTranscriptionRequestMultipart) SetResponseFormat

func (s *CreateTranscriptionRequestMultipart) SetResponseFormat(val OptString)

SetResponseFormat sets the value of ResponseFormat.

func (*CreateTranscriptionRequestMultipart) SetTemperature

func (s *CreateTranscriptionRequestMultipart) SetTemperature(val OptFloat64)

SetTemperature sets the value of Temperature.

func (*CreateTranscriptionRequestMultipart) Validate

type CreateTranscriptionResponse

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

Ref: #/components/schemas/CreateTranscriptionResponse

func (*CreateTranscriptionResponse) Decode

Decode decodes CreateTranscriptionResponse from json.

func (*CreateTranscriptionResponse) Encode

func (s *CreateTranscriptionResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateTranscriptionResponse) GetText

func (s *CreateTranscriptionResponse) GetText() string

GetText returns the value of Text.

func (*CreateTranscriptionResponse) MarshalJSON

func (s *CreateTranscriptionResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateTranscriptionResponse) SetText

func (s *CreateTranscriptionResponse) SetText(val string)

SetText sets the value of Text.

func (*CreateTranscriptionResponse) UnmarshalJSON

func (s *CreateTranscriptionResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateTranslationRequestMultipart

type CreateTranslationRequestMultipart struct {
	// The audio file to translate, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.
	File ht.MultipartFile `json:"file"`
	// ID of the model to use. Only `whisper-1` is currently available.
	Model string `json:"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 OptString `json:"prompt"`
	// The format of the transcript output, in one of these options: json, text, srt, verbose_json, or
	// vtt.
	ResponseFormat OptString `json:"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 OptFloat64 `json:"temperature"`
}

Ref: #/components/schemas/CreateTranslationRequest

func (*CreateTranslationRequestMultipart) GetFile

GetFile returns the value of File.

func (*CreateTranslationRequestMultipart) GetModel

GetModel returns the value of Model.

func (*CreateTranslationRequestMultipart) GetPrompt

GetPrompt returns the value of Prompt.

func (*CreateTranslationRequestMultipart) GetResponseFormat

func (s *CreateTranslationRequestMultipart) GetResponseFormat() OptString

GetResponseFormat returns the value of ResponseFormat.

func (*CreateTranslationRequestMultipart) GetTemperature

func (s *CreateTranslationRequestMultipart) GetTemperature() OptFloat64

GetTemperature returns the value of Temperature.

func (*CreateTranslationRequestMultipart) SetFile

SetFile sets the value of File.

func (*CreateTranslationRequestMultipart) SetModel

func (s *CreateTranslationRequestMultipart) SetModel(val string)

SetModel sets the value of Model.

func (*CreateTranslationRequestMultipart) SetPrompt

func (s *CreateTranslationRequestMultipart) SetPrompt(val OptString)

SetPrompt sets the value of Prompt.

func (*CreateTranslationRequestMultipart) SetResponseFormat

func (s *CreateTranslationRequestMultipart) SetResponseFormat(val OptString)

SetResponseFormat sets the value of ResponseFormat.

func (*CreateTranslationRequestMultipart) SetTemperature

func (s *CreateTranslationRequestMultipart) SetTemperature(val OptFloat64)

SetTemperature sets the value of Temperature.

func (*CreateTranslationRequestMultipart) Validate

type CreateTranslationResponse

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

Ref: #/components/schemas/CreateTranslationResponse

func (*CreateTranslationResponse) Decode

func (s *CreateTranslationResponse) Decode(d *jx.Decoder) error

Decode decodes CreateTranslationResponse from json.

func (*CreateTranslationResponse) Encode

func (s *CreateTranslationResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateTranslationResponse) GetText

func (s *CreateTranslationResponse) GetText() string

GetText returns the value of Text.

func (*CreateTranslationResponse) MarshalJSON

func (s *CreateTranslationResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateTranslationResponse) SetText

func (s *CreateTranslationResponse) SetText(val string)

SetText sets the value of Text.

func (*CreateTranslationResponse) UnmarshalJSON

func (s *CreateTranslationResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type DeleteFileParams

type DeleteFileParams struct {
	// The ID of the file to use for this request.
	FileID string
}

DeleteFileParams is parameters of deleteFile operation.

type DeleteFileResponse

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

Ref: #/components/schemas/DeleteFileResponse

func (*DeleteFileResponse) Decode

func (s *DeleteFileResponse) Decode(d *jx.Decoder) error

Decode decodes DeleteFileResponse from json.

func (*DeleteFileResponse) Encode

func (s *DeleteFileResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*DeleteFileResponse) GetDeleted

func (s *DeleteFileResponse) GetDeleted() bool

GetDeleted returns the value of Deleted.

func (*DeleteFileResponse) GetID

func (s *DeleteFileResponse) GetID() string

GetID returns the value of ID.

func (*DeleteFileResponse) GetObject

func (s *DeleteFileResponse) GetObject() string

GetObject returns the value of Object.

func (*DeleteFileResponse) MarshalJSON

func (s *DeleteFileResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*DeleteFileResponse) SetDeleted

func (s *DeleteFileResponse) SetDeleted(val bool)

SetDeleted sets the value of Deleted.

func (*DeleteFileResponse) SetID

func (s *DeleteFileResponse) SetID(val string)

SetID sets the value of ID.

func (*DeleteFileResponse) SetObject

func (s *DeleteFileResponse) SetObject(val string)

SetObject sets the value of Object.

func (*DeleteFileResponse) UnmarshalJSON

func (s *DeleteFileResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type DeleteModelParams

type DeleteModelParams struct {
	// The model to delete.
	Model string
}

DeleteModelParams is parameters of deleteModel operation.

type DeleteModelResponse

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

Ref: #/components/schemas/DeleteModelResponse

func (*DeleteModelResponse) Decode

func (s *DeleteModelResponse) Decode(d *jx.Decoder) error

Decode decodes DeleteModelResponse from json.

func (*DeleteModelResponse) Encode

func (s *DeleteModelResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*DeleteModelResponse) GetDeleted

func (s *DeleteModelResponse) GetDeleted() bool

GetDeleted returns the value of Deleted.

func (*DeleteModelResponse) GetID

func (s *DeleteModelResponse) GetID() string

GetID returns the value of ID.

func (*DeleteModelResponse) GetObject

func (s *DeleteModelResponse) GetObject() string

GetObject returns the value of Object.

func (*DeleteModelResponse) MarshalJSON

func (s *DeleteModelResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*DeleteModelResponse) SetDeleted

func (s *DeleteModelResponse) SetDeleted(val bool)

SetDeleted sets the value of Deleted.

func (*DeleteModelResponse) SetID

func (s *DeleteModelResponse) SetID(val string)

SetID sets the value of ID.

func (*DeleteModelResponse) SetObject

func (s *DeleteModelResponse) SetObject(val string)

SetObject sets the value of Object.

func (*DeleteModelResponse) UnmarshalJSON

func (s *DeleteModelResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type DownloadFileParams

type DownloadFileParams struct {
	// The ID of the file to use for this request.
	FileID string
}

DownloadFileParams is parameters of downloadFile operation.

type Engine

type Engine jx.Raw

func (*Engine) Decode

func (s *Engine) Decode(d *jx.Decoder) error

Decode decodes Engine from json.

func (Engine) Encode

func (s Engine) Encode(e *jx.Encoder)

Encode encodes Engine as json.

func (Engine) MarshalJSON

func (s Engine) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Engine) UnmarshalJSON

func (s *Engine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type FineTune

type FineTune jx.Raw

func (*FineTune) Decode

func (s *FineTune) Decode(d *jx.Decoder) error

Decode decodes FineTune from json.

func (FineTune) Encode

func (s FineTune) Encode(e *jx.Encoder)

Encode encodes FineTune as json.

func (FineTune) MarshalJSON

func (s FineTune) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FineTune) UnmarshalJSON

func (s *FineTune) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type FineTuneEvent

type FineTuneEvent jx.Raw

func (*FineTuneEvent) Decode

func (s *FineTuneEvent) Decode(d *jx.Decoder) error

Decode decodes FineTuneEvent from json.

func (FineTuneEvent) Encode

func (s FineTuneEvent) Encode(e *jx.Encoder)

Encode encodes FineTuneEvent as json.

func (FineTuneEvent) MarshalJSON

func (s FineTuneEvent) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FineTuneEvent) UnmarshalJSON

func (s *FineTuneEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Handler

type Handler interface {
	// CancelFineTune implements cancelFineTune operation.
	//
	// Immediately cancel a fine-tune job.
	//
	// POST /fine-tunes/{fine_tune_id}/cancel
	CancelFineTune(ctx context.Context, params CancelFineTuneParams) (FineTune, error)
	// CreateAnswer implements createAnswer operation.
	//
	// Answers the specified question using the provided documents and examples.
	// The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to
	// find relevant context. The relevant context is combined with the provided examples and question to
	// create the prompt for [completion](/docs/api-reference/completions).
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /answers
	CreateAnswer(ctx context.Context, req *CreateAnswerRequest) (*CreateAnswerResponse, error)
	// CreateChatCompletion implements createChatCompletion operation.
	//
	// Creates a completion for the chat message.
	//
	// POST /chat/completions
	CreateChatCompletion(ctx context.Context, req *CreateChatCompletionRequest) (*CreateChatCompletionResponse, error)
	// CreateClassification implements createClassification operation.
	//
	// Classifies the specified `query` using provided examples.
	// The endpoint first [searches](/docs/api-reference/searches) over the labeled examples
	// to select the ones most relevant for the particular query. Then, the relevant examples
	// are combined with the query to construct a prompt to produce the final label via the
	// [completions](/docs/api-reference/completions) endpoint.
	// Labeled examples can be provided via an uploaded `file`, or explicitly listed in the
	// request using the `examples` parameter for quick tests and small scale use cases.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /classifications
	CreateClassification(ctx context.Context, req *CreateClassificationRequest) (*CreateClassificationResponse, error)
	// CreateCompletion implements createCompletion operation.
	//
	// Creates a completion for the provided prompt and parameters.
	//
	// POST /completions
	CreateCompletion(ctx context.Context, req *CreateCompletionRequest) (*CreateCompletionResponse, error)
	// CreateEdit implements createEdit operation.
	//
	// Creates a new edit for the provided input, instruction, and parameters.
	//
	// POST /edits
	CreateEdit(ctx context.Context, req *CreateEditRequest) (*CreateEditResponse, error)
	// CreateEmbedding implements createEmbedding operation.
	//
	// Creates an embedding vector representing the input text.
	//
	// POST /embeddings
	CreateEmbedding(ctx context.Context, req *CreateEmbeddingRequest) (*CreateEmbeddingResponse, error)
	// CreateFile implements createFile operation.
	//
	// Upload a file that contains document(s) to be used across various endpoints/features. Currently,
	// the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you
	// need to increase the storage limit.
	//
	// POST /files
	CreateFile(ctx context.Context, req *CreateFileRequestMultipart) (OpenAIFile, error)
	// CreateFineTune implements createFineTune operation.
	//
	// Creates a job that fine-tunes a specified model from a given dataset.
	// Response includes details of the enqueued job including job status and the name of the fine-tuned
	// models once complete.
	// [Learn more about Fine-tuning](/docs/guides/fine-tuning).
	//
	// POST /fine-tunes
	CreateFineTune(ctx context.Context, req *CreateFineTuneRequest) (FineTune, error)
	// CreateImage implements createImage operation.
	//
	// Creates an image given a prompt.
	//
	// POST /images/generations
	CreateImage(ctx context.Context, req *CreateImageRequest) (ImagesResponse, error)
	// CreateImageEdit implements createImageEdit operation.
	//
	// Creates an edited or extended image given an original image and a prompt.
	//
	// POST /images/edits
	CreateImageEdit(ctx context.Context, req *CreateImageEditRequestMultipart) (ImagesResponse, error)
	// CreateImageVariation implements createImageVariation operation.
	//
	// Creates a variation of a given image.
	//
	// POST /images/variations
	CreateImageVariation(ctx context.Context, req *CreateImageVariationRequestMultipart) (ImagesResponse, error)
	// CreateModeration implements createModeration operation.
	//
	// Classifies if text violates OpenAI's Content Policy.
	//
	// POST /moderations
	CreateModeration(ctx context.Context, req *CreateModerationRequest) (*CreateModerationResponse, error)
	// CreateSearch implements createSearch operation.
	//
	// The search endpoint computes similarity scores between provided query and documents. Documents can
	// be passed directly to the API if there are no more than 200 of them.
	// To go beyond the 200 document limit, documents can be processed offline and then used for
	// efficient retrieval at query time. When `file` is set, the search endpoint searches over all the
	// documents in the given file and returns up to the `max_rerank` number of documents. These
	// documents will be returned along with their search scores.
	// The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go
	// higher), where a score above 200 usually means the document is semantically similar to the query.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /engines/{engine_id}/search
	CreateSearch(ctx context.Context, req *CreateSearchRequest, params CreateSearchParams) (*CreateSearchResponse, error)
	// CreateTranscription implements createTranscription operation.
	//
	// Transcribes audio into the input language.
	//
	// POST /audio/transcriptions
	CreateTranscription(ctx context.Context, req *CreateTranscriptionRequestMultipart) (*CreateTranscriptionResponse, error)
	// CreateTranslation implements createTranslation operation.
	//
	// Translates audio into into English.
	//
	// POST /audio/translations
	CreateTranslation(ctx context.Context, req *CreateTranslationRequestMultipart) (*CreateTranslationResponse, error)
	// DeleteFile implements deleteFile operation.
	//
	// Delete a file.
	//
	// DELETE /files/{file_id}
	DeleteFile(ctx context.Context, params DeleteFileParams) (*DeleteFileResponse, error)
	// DeleteModel implements deleteModel operation.
	//
	// Delete a fine-tuned model. You must have the Owner role in your organization.
	//
	// DELETE /models/{model}
	DeleteModel(ctx context.Context, params DeleteModelParams) (*DeleteModelResponse, error)
	// DownloadFile implements downloadFile operation.
	//
	// Returns the contents of the specified file.
	//
	// GET /files/{file_id}/content
	DownloadFile(ctx context.Context, params DownloadFileParams) (string, error)
	// ListEngines implements listEngines operation.
	//
	// Lists the currently available (non-finetuned) models, and provides basic information about each
	// one such as the owner and availability.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// GET /engines
	ListEngines(ctx context.Context) (*ListEnginesResponse, error)
	// ListFiles implements listFiles operation.
	//
	// Returns a list of files that belong to the user's organization.
	//
	// GET /files
	ListFiles(ctx context.Context) (*ListFilesResponse, error)
	// ListFineTuneEvents implements listFineTuneEvents operation.
	//
	// Get fine-grained status updates for a fine-tune job.
	//
	// GET /fine-tunes/{fine_tune_id}/events
	ListFineTuneEvents(ctx context.Context, params ListFineTuneEventsParams) (*ListFineTuneEventsResponse, error)
	// ListFineTunes implements listFineTunes operation.
	//
	// List your organization's fine-tuning jobs.
	//
	// GET /fine-tunes
	ListFineTunes(ctx context.Context) (*ListFineTunesResponse, error)
	// ListModels implements listModels operation.
	//
	// Lists the currently available models, and provides basic information about each one such as the
	// owner and availability.
	//
	// GET /models
	ListModels(ctx context.Context) (*ListModelsResponse, error)
	// RetrieveEngine implements retrieveEngine operation.
	//
	// Retrieves a model instance, providing basic information about it such as the owner and
	// availability.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// GET /engines/{engine_id}
	RetrieveEngine(ctx context.Context, params RetrieveEngineParams) (Engine, error)
	// RetrieveFile implements retrieveFile operation.
	//
	// Returns information about a specific file.
	//
	// GET /files/{file_id}
	RetrieveFile(ctx context.Context, params RetrieveFileParams) (OpenAIFile, error)
	// RetrieveFineTune implements retrieveFineTune operation.
	//
	// Gets info about the fine-tune job.
	// [Learn more about Fine-tuning](/docs/guides/fine-tuning).
	//
	// GET /fine-tunes/{fine_tune_id}
	RetrieveFineTune(ctx context.Context, params RetrieveFineTuneParams) (FineTune, error)
	// RetrieveModel implements retrieveModel operation.
	//
	// Retrieves a model instance, providing basic information about the model such as the owner and
	// permissioning.
	//
	// GET /models/{model}
	RetrieveModel(ctx context.Context, params RetrieveModelParams) (Model, error)
}

Handler handles operations described by OpenAPI v3 specification.

type ImagesResponse

type ImagesResponse jx.Raw

func (*ImagesResponse) Decode

func (s *ImagesResponse) Decode(d *jx.Decoder) error

Decode decodes ImagesResponse from json.

func (ImagesResponse) Encode

func (s ImagesResponse) Encode(e *jx.Encoder)

Encode encodes ImagesResponse as json.

func (ImagesResponse) MarshalJSON

func (s ImagesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ImagesResponse) UnmarshalJSON

func (s *ImagesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Invoker

type Invoker interface {
	// CancelFineTune invokes cancelFineTune operation.
	//
	// Immediately cancel a fine-tune job.
	//
	// POST /fine-tunes/{fine_tune_id}/cancel
	CancelFineTune(ctx context.Context, params CancelFineTuneParams) (FineTune, error)
	// CreateAnswer invokes createAnswer operation.
	//
	// Answers the specified question using the provided documents and examples.
	// The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to
	// find relevant context. The relevant context is combined with the provided examples and question to
	// create the prompt for [completion](/docs/api-reference/completions).
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /answers
	CreateAnswer(ctx context.Context, request *CreateAnswerRequest) (*CreateAnswerResponse, error)
	// CreateChatCompletion invokes createChatCompletion operation.
	//
	// Creates a completion for the chat message.
	//
	// POST /chat/completions
	CreateChatCompletion(ctx context.Context, request *CreateChatCompletionRequest) (*CreateChatCompletionResponse, error)
	// CreateClassification invokes createClassification operation.
	//
	// Classifies the specified `query` using provided examples.
	// The endpoint first [searches](/docs/api-reference/searches) over the labeled examples
	// to select the ones most relevant for the particular query. Then, the relevant examples
	// are combined with the query to construct a prompt to produce the final label via the
	// [completions](/docs/api-reference/completions) endpoint.
	// Labeled examples can be provided via an uploaded `file`, or explicitly listed in the
	// request using the `examples` parameter for quick tests and small scale use cases.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /classifications
	CreateClassification(ctx context.Context, request *CreateClassificationRequest) (*CreateClassificationResponse, error)
	// CreateCompletion invokes createCompletion operation.
	//
	// Creates a completion for the provided prompt and parameters.
	//
	// POST /completions
	CreateCompletion(ctx context.Context, request *CreateCompletionRequest) (*CreateCompletionResponse, error)
	// CreateEdit invokes createEdit operation.
	//
	// Creates a new edit for the provided input, instruction, and parameters.
	//
	// POST /edits
	CreateEdit(ctx context.Context, request *CreateEditRequest) (*CreateEditResponse, error)
	// CreateEmbedding invokes createEmbedding operation.
	//
	// Creates an embedding vector representing the input text.
	//
	// POST /embeddings
	CreateEmbedding(ctx context.Context, request *CreateEmbeddingRequest) (*CreateEmbeddingResponse, error)
	// CreateFile invokes createFile operation.
	//
	// Upload a file that contains document(s) to be used across various endpoints/features. Currently,
	// the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you
	// need to increase the storage limit.
	//
	// POST /files
	CreateFile(ctx context.Context, request *CreateFileRequestMultipart) (OpenAIFile, error)
	// CreateFineTune invokes createFineTune operation.
	//
	// Creates a job that fine-tunes a specified model from a given dataset.
	// Response includes details of the enqueued job including job status and the name of the fine-tuned
	// models once complete.
	// [Learn more about Fine-tuning](/docs/guides/fine-tuning).
	//
	// POST /fine-tunes
	CreateFineTune(ctx context.Context, request *CreateFineTuneRequest) (FineTune, error)
	// CreateImage invokes createImage operation.
	//
	// Creates an image given a prompt.
	//
	// POST /images/generations
	CreateImage(ctx context.Context, request *CreateImageRequest) (ImagesResponse, error)
	// CreateImageEdit invokes createImageEdit operation.
	//
	// Creates an edited or extended image given an original image and a prompt.
	//
	// POST /images/edits
	CreateImageEdit(ctx context.Context, request *CreateImageEditRequestMultipart) (ImagesResponse, error)
	// CreateImageVariation invokes createImageVariation operation.
	//
	// Creates a variation of a given image.
	//
	// POST /images/variations
	CreateImageVariation(ctx context.Context, request *CreateImageVariationRequestMultipart) (ImagesResponse, error)
	// CreateModeration invokes createModeration operation.
	//
	// Classifies if text violates OpenAI's Content Policy.
	//
	// POST /moderations
	CreateModeration(ctx context.Context, request *CreateModerationRequest) (*CreateModerationResponse, error)
	// CreateSearch invokes createSearch operation.
	//
	// The search endpoint computes similarity scores between provided query and documents. Documents can
	// be passed directly to the API if there are no more than 200 of them.
	// To go beyond the 200 document limit, documents can be processed offline and then used for
	// efficient retrieval at query time. When `file` is set, the search endpoint searches over all the
	// documents in the given file and returns up to the `max_rerank` number of documents. These
	// documents will be returned along with their search scores.
	// The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go
	// higher), where a score above 200 usually means the document is semantically similar to the query.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /engines/{engine_id}/search
	CreateSearch(ctx context.Context, request *CreateSearchRequest, params CreateSearchParams) (*CreateSearchResponse, error)
	// CreateTranscription invokes createTranscription operation.
	//
	// Transcribes audio into the input language.
	//
	// POST /audio/transcriptions
	CreateTranscription(ctx context.Context, request *CreateTranscriptionRequestMultipart) (*CreateTranscriptionResponse, error)
	// CreateTranslation invokes createTranslation operation.
	//
	// Translates audio into into English.
	//
	// POST /audio/translations
	CreateTranslation(ctx context.Context, request *CreateTranslationRequestMultipart) (*CreateTranslationResponse, error)
	// DeleteFile invokes deleteFile operation.
	//
	// Delete a file.
	//
	// DELETE /files/{file_id}
	DeleteFile(ctx context.Context, params DeleteFileParams) (*DeleteFileResponse, error)
	// DeleteModel invokes deleteModel operation.
	//
	// Delete a fine-tuned model. You must have the Owner role in your organization.
	//
	// DELETE /models/{model}
	DeleteModel(ctx context.Context, params DeleteModelParams) (*DeleteModelResponse, error)
	// DownloadFile invokes downloadFile operation.
	//
	// Returns the contents of the specified file.
	//
	// GET /files/{file_id}/content
	DownloadFile(ctx context.Context, params DownloadFileParams) (string, error)
	// ListEngines invokes listEngines operation.
	//
	// Lists the currently available (non-finetuned) models, and provides basic information about each
	// one such as the owner and availability.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// GET /engines
	ListEngines(ctx context.Context) (*ListEnginesResponse, error)
	// ListFiles invokes listFiles operation.
	//
	// Returns a list of files that belong to the user's organization.
	//
	// GET /files
	ListFiles(ctx context.Context) (*ListFilesResponse, error)
	// ListFineTuneEvents invokes listFineTuneEvents operation.
	//
	// Get fine-grained status updates for a fine-tune job.
	//
	// GET /fine-tunes/{fine_tune_id}/events
	ListFineTuneEvents(ctx context.Context, params ListFineTuneEventsParams) (*ListFineTuneEventsResponse, error)
	// ListFineTunes invokes listFineTunes operation.
	//
	// List your organization's fine-tuning jobs.
	//
	// GET /fine-tunes
	ListFineTunes(ctx context.Context) (*ListFineTunesResponse, error)
	// ListModels invokes listModels operation.
	//
	// Lists the currently available models, and provides basic information about each one such as the
	// owner and availability.
	//
	// GET /models
	ListModels(ctx context.Context) (*ListModelsResponse, error)
	// RetrieveEngine invokes retrieveEngine operation.
	//
	// Retrieves a model instance, providing basic information about it such as the owner and
	// availability.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// GET /engines/{engine_id}
	RetrieveEngine(ctx context.Context, params RetrieveEngineParams) (Engine, error)
	// RetrieveFile invokes retrieveFile operation.
	//
	// Returns information about a specific file.
	//
	// GET /files/{file_id}
	RetrieveFile(ctx context.Context, params RetrieveFileParams) (OpenAIFile, error)
	// RetrieveFineTune invokes retrieveFineTune operation.
	//
	// Gets info about the fine-tune job.
	// [Learn more about Fine-tuning](/docs/guides/fine-tuning).
	//
	// GET /fine-tunes/{fine_tune_id}
	RetrieveFineTune(ctx context.Context, params RetrieveFineTuneParams) (FineTune, error)
	// RetrieveModel invokes retrieveModel operation.
	//
	// Retrieves a model instance, providing basic information about the model such as the owner and
	// permissioning.
	//
	// GET /models/{model}
	RetrieveModel(ctx context.Context, params RetrieveModelParams) (Model, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type ListEnginesResponse

type ListEnginesResponse struct {
	Object string   `json:"object"`
	Data   []Engine `json:"data"`
}

Ref: #/components/schemas/ListEnginesResponse

func (*ListEnginesResponse) Decode

func (s *ListEnginesResponse) Decode(d *jx.Decoder) error

Decode decodes ListEnginesResponse from json.

func (*ListEnginesResponse) Encode

func (s *ListEnginesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ListEnginesResponse) GetData

func (s *ListEnginesResponse) GetData() []Engine

GetData returns the value of Data.

func (*ListEnginesResponse) GetObject

func (s *ListEnginesResponse) GetObject() string

GetObject returns the value of Object.

func (*ListEnginesResponse) MarshalJSON

func (s *ListEnginesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListEnginesResponse) SetData

func (s *ListEnginesResponse) SetData(val []Engine)

SetData sets the value of Data.

func (*ListEnginesResponse) SetObject

func (s *ListEnginesResponse) SetObject(val string)

SetObject sets the value of Object.

func (*ListEnginesResponse) UnmarshalJSON

func (s *ListEnginesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListEnginesResponse) Validate

func (s *ListEnginesResponse) Validate() error

type ListFilesResponse

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

Ref: #/components/schemas/ListFilesResponse

func (*ListFilesResponse) Decode

func (s *ListFilesResponse) Decode(d *jx.Decoder) error

Decode decodes ListFilesResponse from json.

func (*ListFilesResponse) Encode

func (s *ListFilesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ListFilesResponse) GetData

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

GetData returns the value of Data.

func (*ListFilesResponse) GetObject

func (s *ListFilesResponse) GetObject() string

GetObject returns the value of Object.

func (*ListFilesResponse) MarshalJSON

func (s *ListFilesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListFilesResponse) SetData

func (s *ListFilesResponse) SetData(val []OpenAIFile)

SetData sets the value of Data.

func (*ListFilesResponse) SetObject

func (s *ListFilesResponse) SetObject(val string)

SetObject sets the value of Object.

func (*ListFilesResponse) UnmarshalJSON

func (s *ListFilesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListFilesResponse) Validate

func (s *ListFilesResponse) Validate() error

type ListFineTuneEventsParams

type ListFineTuneEventsParams struct {
	// The ID of the fine-tune job to get events for.
	FineTuneID string
	// Whether to stream events for the fine-tune job. If set to true,
	// events 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. The stream will terminate with a
	// `data: [DONE]` message when the job is finished (succeeded, cancelled,
	// or failed).
	// If set to false, only events generated so far will be returned.
	Stream OptBool
}

ListFineTuneEventsParams is parameters of listFineTuneEvents operation.

type ListFineTuneEventsResponse

type ListFineTuneEventsResponse struct {
	Object string          `json:"object"`
	Data   []FineTuneEvent `json:"data"`
}

Ref: #/components/schemas/ListFineTuneEventsResponse

func (*ListFineTuneEventsResponse) Decode

Decode decodes ListFineTuneEventsResponse from json.

func (*ListFineTuneEventsResponse) Encode

func (s *ListFineTuneEventsResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ListFineTuneEventsResponse) GetData

GetData returns the value of Data.

func (*ListFineTuneEventsResponse) GetObject

func (s *ListFineTuneEventsResponse) GetObject() string

GetObject returns the value of Object.

func (*ListFineTuneEventsResponse) MarshalJSON

func (s *ListFineTuneEventsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListFineTuneEventsResponse) SetData

func (s *ListFineTuneEventsResponse) SetData(val []FineTuneEvent)

SetData sets the value of Data.

func (*ListFineTuneEventsResponse) SetObject

func (s *ListFineTuneEventsResponse) SetObject(val string)

SetObject sets the value of Object.

func (*ListFineTuneEventsResponse) UnmarshalJSON

func (s *ListFineTuneEventsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListFineTuneEventsResponse) Validate

func (s *ListFineTuneEventsResponse) Validate() error

type ListFineTunesResponse

type ListFineTunesResponse struct {
	Object string     `json:"object"`
	Data   []FineTune `json:"data"`
}

Ref: #/components/schemas/ListFineTunesResponse

func (*ListFineTunesResponse) Decode

func (s *ListFineTunesResponse) Decode(d *jx.Decoder) error

Decode decodes ListFineTunesResponse from json.

func (*ListFineTunesResponse) Encode

func (s *ListFineTunesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ListFineTunesResponse) GetData

func (s *ListFineTunesResponse) GetData() []FineTune

GetData returns the value of Data.

func (*ListFineTunesResponse) GetObject

func (s *ListFineTunesResponse) GetObject() string

GetObject returns the value of Object.

func (*ListFineTunesResponse) MarshalJSON

func (s *ListFineTunesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListFineTunesResponse) SetData

func (s *ListFineTunesResponse) SetData(val []FineTune)

SetData sets the value of Data.

func (*ListFineTunesResponse) SetObject

func (s *ListFineTunesResponse) SetObject(val string)

SetObject sets the value of Object.

func (*ListFineTunesResponse) UnmarshalJSON

func (s *ListFineTunesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListFineTunesResponse) Validate

func (s *ListFineTunesResponse) Validate() error

type ListModelsResponse

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

Ref: #/components/schemas/ListModelsResponse

func (*ListModelsResponse) Decode

func (s *ListModelsResponse) Decode(d *jx.Decoder) error

Decode decodes ListModelsResponse from json.

func (*ListModelsResponse) Encode

func (s *ListModelsResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ListModelsResponse) GetData

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

GetData returns the value of Data.

func (*ListModelsResponse) GetObject

func (s *ListModelsResponse) GetObject() string

GetObject returns the value of Object.

func (*ListModelsResponse) MarshalJSON

func (s *ListModelsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListModelsResponse) SetData

func (s *ListModelsResponse) SetData(val []Model)

SetData sets the value of Data.

func (*ListModelsResponse) SetObject

func (s *ListModelsResponse) SetObject(val string)

SetObject sets the value of Object.

func (*ListModelsResponse) UnmarshalJSON

func (s *ListModelsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListModelsResponse) Validate

func (s *ListModelsResponse) Validate() error

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type Model

type Model jx.Raw

func (*Model) Decode

func (s *Model) Decode(d *jx.Decoder) error

Decode decodes Model from json.

func (Model) Encode

func (s Model) Encode(e *jx.Encoder)

Encode encodes Model as json.

func (Model) MarshalJSON

func (s Model) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Model) UnmarshalJSON

func (s *Model) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OpenAIFile

type OpenAIFile jx.Raw

func (*OpenAIFile) Decode

func (s *OpenAIFile) Decode(d *jx.Decoder) error

Decode decodes OpenAIFile from json.

func (OpenAIFile) Encode

func (s OpenAIFile) Encode(e *jx.Encoder)

Encode encodes OpenAIFile as json.

func (OpenAIFile) MarshalJSON

func (s OpenAIFile) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*OpenAIFile) UnmarshalJSON

func (s *OpenAIFile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

type OptChatCompletionResponseMessage

type OptChatCompletionResponseMessage struct {
	Value ChatCompletionResponseMessage
	Set   bool
}

OptChatCompletionResponseMessage is optional ChatCompletionResponseMessage.

func NewOptChatCompletionResponseMessage

func NewOptChatCompletionResponseMessage(v ChatCompletionResponseMessage) OptChatCompletionResponseMessage

NewOptChatCompletionResponseMessage returns new OptChatCompletionResponseMessage with value set to v.

func (*OptChatCompletionResponseMessage) Decode

Decode decodes ChatCompletionResponseMessage from json.

func (OptChatCompletionResponseMessage) Encode

Encode encodes ChatCompletionResponseMessage as json.

func (OptChatCompletionResponseMessage) Get

Get returns value and boolean that denotes whether value was set.

func (OptChatCompletionResponseMessage) IsSet

IsSet returns true if OptChatCompletionResponseMessage was set.

func (OptChatCompletionResponseMessage) MarshalJSON

func (s OptChatCompletionResponseMessage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptChatCompletionResponseMessage) Or

Or returns value if set, or given parameter if does not.

func (*OptChatCompletionResponseMessage) Reset

Reset unsets value.

func (*OptChatCompletionResponseMessage) SetTo

SetTo sets value to v.

func (*OptChatCompletionResponseMessage) UnmarshalJSON

func (s *OptChatCompletionResponseMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateAnswerRequestLogitBias

type OptCreateAnswerRequestLogitBias struct {
	Value *CreateAnswerRequestLogitBias
	Set   bool
}

OptCreateAnswerRequestLogitBias is optional *CreateAnswerRequestLogitBias.

func NewOptCreateAnswerRequestLogitBias

func NewOptCreateAnswerRequestLogitBias(v *CreateAnswerRequestLogitBias) OptCreateAnswerRequestLogitBias

NewOptCreateAnswerRequestLogitBias returns new OptCreateAnswerRequestLogitBias with value set to v.

func (*OptCreateAnswerRequestLogitBias) Decode

Decode decodes *CreateAnswerRequestLogitBias from json.

func (OptCreateAnswerRequestLogitBias) Encode

Encode encodes *CreateAnswerRequestLogitBias as json.

func (OptCreateAnswerRequestLogitBias) Get

Get returns value and boolean that denotes whether value was set.

func (OptCreateAnswerRequestLogitBias) IsSet

IsSet returns true if OptCreateAnswerRequestLogitBias was set.

func (OptCreateAnswerRequestLogitBias) MarshalJSON

func (s OptCreateAnswerRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCreateAnswerRequestLogitBias) Or

Or returns value if set, or given parameter if does not.

func (*OptCreateAnswerRequestLogitBias) Reset

Reset unsets value.

func (*OptCreateAnswerRequestLogitBias) SetTo

SetTo sets value to v.

func (*OptCreateAnswerRequestLogitBias) UnmarshalJSON

func (s *OptCreateAnswerRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateChatCompletionRequestLogitBias

type OptCreateChatCompletionRequestLogitBias struct {
	Value *CreateChatCompletionRequestLogitBias
	Set   bool
}

OptCreateChatCompletionRequestLogitBias is optional *CreateChatCompletionRequestLogitBias.

func NewOptCreateChatCompletionRequestLogitBias

func NewOptCreateChatCompletionRequestLogitBias(v *CreateChatCompletionRequestLogitBias) OptCreateChatCompletionRequestLogitBias

NewOptCreateChatCompletionRequestLogitBias returns new OptCreateChatCompletionRequestLogitBias with value set to v.

func (*OptCreateChatCompletionRequestLogitBias) Decode

Decode decodes *CreateChatCompletionRequestLogitBias from json.

func (OptCreateChatCompletionRequestLogitBias) Encode

Encode encodes *CreateChatCompletionRequestLogitBias as json.

func (OptCreateChatCompletionRequestLogitBias) Get

Get returns value and boolean that denotes whether value was set.

func (OptCreateChatCompletionRequestLogitBias) IsSet

IsSet returns true if OptCreateChatCompletionRequestLogitBias was set.

func (OptCreateChatCompletionRequestLogitBias) MarshalJSON

func (s OptCreateChatCompletionRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCreateChatCompletionRequestLogitBias) Or

Or returns value if set, or given parameter if does not.

func (*OptCreateChatCompletionRequestLogitBias) Reset

Reset unsets value.

func (*OptCreateChatCompletionRequestLogitBias) SetTo

SetTo sets value to v.

func (*OptCreateChatCompletionRequestLogitBias) UnmarshalJSON

func (s *OptCreateChatCompletionRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateChatCompletionResponseUsage

type OptCreateChatCompletionResponseUsage struct {
	Value CreateChatCompletionResponseUsage
	Set   bool
}

OptCreateChatCompletionResponseUsage is optional CreateChatCompletionResponseUsage.

func NewOptCreateChatCompletionResponseUsage

func NewOptCreateChatCompletionResponseUsage(v CreateChatCompletionResponseUsage) OptCreateChatCompletionResponseUsage

NewOptCreateChatCompletionResponseUsage returns new OptCreateChatCompletionResponseUsage with value set to v.

func (*OptCreateChatCompletionResponseUsage) Decode

Decode decodes CreateChatCompletionResponseUsage from json.

func (OptCreateChatCompletionResponseUsage) Encode

Encode encodes CreateChatCompletionResponseUsage as json.

func (OptCreateChatCompletionResponseUsage) Get

Get returns value and boolean that denotes whether value was set.

func (OptCreateChatCompletionResponseUsage) IsSet

IsSet returns true if OptCreateChatCompletionResponseUsage was set.

func (OptCreateChatCompletionResponseUsage) MarshalJSON

func (s OptCreateChatCompletionResponseUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCreateChatCompletionResponseUsage) Or

Or returns value if set, or given parameter if does not.

func (*OptCreateChatCompletionResponseUsage) Reset

Reset unsets value.

func (*OptCreateChatCompletionResponseUsage) SetTo

SetTo sets value to v.

func (*OptCreateChatCompletionResponseUsage) UnmarshalJSON

func (s *OptCreateChatCompletionResponseUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateClassificationRequestLogitBias

type OptCreateClassificationRequestLogitBias struct {
	Value *CreateClassificationRequestLogitBias
	Set   bool
}

OptCreateClassificationRequestLogitBias is optional *CreateClassificationRequestLogitBias.

func NewOptCreateClassificationRequestLogitBias

func NewOptCreateClassificationRequestLogitBias(v *CreateClassificationRequestLogitBias) OptCreateClassificationRequestLogitBias

NewOptCreateClassificationRequestLogitBias returns new OptCreateClassificationRequestLogitBias with value set to v.

func (*OptCreateClassificationRequestLogitBias) Decode

Decode decodes *CreateClassificationRequestLogitBias from json.

func (OptCreateClassificationRequestLogitBias) Encode

Encode encodes *CreateClassificationRequestLogitBias as json.

func (OptCreateClassificationRequestLogitBias) Get

Get returns value and boolean that denotes whether value was set.

func (OptCreateClassificationRequestLogitBias) IsSet

IsSet returns true if OptCreateClassificationRequestLogitBias was set.

func (OptCreateClassificationRequestLogitBias) MarshalJSON

func (s OptCreateClassificationRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCreateClassificationRequestLogitBias) Or

Or returns value if set, or given parameter if does not.

func (*OptCreateClassificationRequestLogitBias) Reset

Reset unsets value.

func (*OptCreateClassificationRequestLogitBias) SetTo

SetTo sets value to v.

func (*OptCreateClassificationRequestLogitBias) UnmarshalJSON

func (s *OptCreateClassificationRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateCompletionRequestLogitBias

type OptCreateCompletionRequestLogitBias struct {
	Value *CreateCompletionRequestLogitBias
	Set   bool
}

OptCreateCompletionRequestLogitBias is optional *CreateCompletionRequestLogitBias.

func NewOptCreateCompletionRequestLogitBias

func NewOptCreateCompletionRequestLogitBias(v *CreateCompletionRequestLogitBias) OptCreateCompletionRequestLogitBias

NewOptCreateCompletionRequestLogitBias returns new OptCreateCompletionRequestLogitBias with value set to v.

func (*OptCreateCompletionRequestLogitBias) Decode

Decode decodes *CreateCompletionRequestLogitBias from json.

func (OptCreateCompletionRequestLogitBias) Encode

Encode encodes *CreateCompletionRequestLogitBias as json.

func (OptCreateCompletionRequestLogitBias) Get

Get returns value and boolean that denotes whether value was set.

func (OptCreateCompletionRequestLogitBias) IsSet

IsSet returns true if OptCreateCompletionRequestLogitBias was set.

func (OptCreateCompletionRequestLogitBias) MarshalJSON

func (s OptCreateCompletionRequestLogitBias) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCreateCompletionRequestLogitBias) Or

Or returns value if set, or given parameter if does not.

func (*OptCreateCompletionRequestLogitBias) Reset

Reset unsets value.

func (*OptCreateCompletionRequestLogitBias) SetTo

SetTo sets value to v.

func (*OptCreateCompletionRequestLogitBias) UnmarshalJSON

func (s *OptCreateCompletionRequestLogitBias) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateCompletionResponseUsage

type OptCreateCompletionResponseUsage struct {
	Value CreateCompletionResponseUsage
	Set   bool
}

OptCreateCompletionResponseUsage is optional CreateCompletionResponseUsage.

func NewOptCreateCompletionResponseUsage

func NewOptCreateCompletionResponseUsage(v CreateCompletionResponseUsage) OptCreateCompletionResponseUsage

NewOptCreateCompletionResponseUsage returns new OptCreateCompletionResponseUsage with value set to v.

func (*OptCreateCompletionResponseUsage) Decode

Decode decodes CreateCompletionResponseUsage from json.

func (OptCreateCompletionResponseUsage) Encode

Encode encodes CreateCompletionResponseUsage as json.

func (OptCreateCompletionResponseUsage) Get

Get returns value and boolean that denotes whether value was set.

func (OptCreateCompletionResponseUsage) IsSet

IsSet returns true if OptCreateCompletionResponseUsage was set.

func (OptCreateCompletionResponseUsage) MarshalJSON

func (s OptCreateCompletionResponseUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCreateCompletionResponseUsage) Or

Or returns value if set, or given parameter if does not.

func (*OptCreateCompletionResponseUsage) Reset

Reset unsets value.

func (*OptCreateCompletionResponseUsage) SetTo

SetTo sets value to v.

func (*OptCreateCompletionResponseUsage) UnmarshalJSON

func (s *OptCreateCompletionResponseUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

func (o *OptFloat64) Decode(d *jx.Decoder) error

Decode decodes float64 from json.

func (OptFloat64) Encode

func (o OptFloat64) Encode(e *jx.Encoder)

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) MarshalJSON

func (s OptFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptFloat64) UnmarshalJSON

func (s *OptFloat64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptMultipartFile

type OptMultipartFile struct {
	Value ht.MultipartFile
	Set   bool
}

OptMultipartFile is optional ht.MultipartFile.

func NewOptMultipartFile

func NewOptMultipartFile(v ht.MultipartFile) OptMultipartFile

NewOptMultipartFile returns new OptMultipartFile with value set to v.

func (OptMultipartFile) Get

func (o OptMultipartFile) Get() (v ht.MultipartFile, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptMultipartFile) IsSet

func (o OptMultipartFile) IsSet() bool

IsSet returns true if OptMultipartFile was set.

func (OptMultipartFile) Or

Or returns value if set, or given parameter if does not.

func (*OptMultipartFile) Reset

func (o *OptMultipartFile) Reset()

Reset unsets value.

func (*OptMultipartFile) SetTo

func (o *OptMultipartFile) SetTo(v ht.MultipartFile)

SetTo sets value to v.

type OptNilAnyArray

type OptNilAnyArray struct {
	Value []jx.Raw
	Set   bool
	Null  bool
}

OptNilAnyArray is optional nullable []jx.Raw.

func NewOptNilAnyArray

func NewOptNilAnyArray(v []jx.Raw) OptNilAnyArray

NewOptNilAnyArray returns new OptNilAnyArray with value set to v.

func (*OptNilAnyArray) Decode

func (o *OptNilAnyArray) Decode(d *jx.Decoder) error

Decode decodes []jx.Raw from json.

func (OptNilAnyArray) Encode

func (o OptNilAnyArray) Encode(e *jx.Encoder)

Encode encodes []jx.Raw as json.

func (OptNilAnyArray) Get

func (o OptNilAnyArray) Get() (v []jx.Raw, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilAnyArray) IsNull

func (o OptNilAnyArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilAnyArray) IsSet

func (o OptNilAnyArray) IsSet() bool

IsSet returns true if OptNilAnyArray was set.

func (OptNilAnyArray) MarshalJSON

func (s OptNilAnyArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilAnyArray) Or

func (o OptNilAnyArray) Or(d []jx.Raw) []jx.Raw

Or returns value if set, or given parameter if does not.

func (*OptNilAnyArray) Reset

func (o *OptNilAnyArray) Reset()

Reset unsets value.

func (*OptNilAnyArray) SetTo

func (o *OptNilAnyArray) SetTo(v []jx.Raw)

SetTo sets value to v.

func (*OptNilAnyArray) SetToNull

func (o *OptNilAnyArray) SetToNull()

SetNull sets value to null.

func (*OptNilAnyArray) UnmarshalJSON

func (s *OptNilAnyArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilBool

type OptNilBool struct {
	Value bool
	Set   bool
	Null  bool
}

OptNilBool is optional nullable bool.

func NewOptNilBool

func NewOptNilBool(v bool) OptNilBool

NewOptNilBool returns new OptNilBool with value set to v.

func (*OptNilBool) Decode

func (o *OptNilBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptNilBool) Encode

func (o OptNilBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptNilBool) Get

func (o OptNilBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilBool) IsNull

func (o OptNilBool) IsNull() bool

IsSet returns true if value is Null.

func (OptNilBool) IsSet

func (o OptNilBool) IsSet() bool

IsSet returns true if OptNilBool was set.

func (OptNilBool) MarshalJSON

func (s OptNilBool) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilBool) Or

func (o OptNilBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptNilBool) Reset

func (o *OptNilBool) Reset()

Reset unsets value.

func (*OptNilBool) SetTo

func (o *OptNilBool) SetTo(v bool)

SetTo sets value to v.

func (*OptNilBool) SetToNull

func (o *OptNilBool) SetToNull()

SetNull sets value to null.

func (*OptNilBool) UnmarshalJSON

func (s *OptNilBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateAnswerRequestStop

type OptNilCreateAnswerRequestStop struct {
	Value CreateAnswerRequestStop
	Set   bool
	Null  bool
}

OptNilCreateAnswerRequestStop is optional nullable CreateAnswerRequestStop.

func NewOptNilCreateAnswerRequestStop

func NewOptNilCreateAnswerRequestStop(v CreateAnswerRequestStop) OptNilCreateAnswerRequestStop

NewOptNilCreateAnswerRequestStop returns new OptNilCreateAnswerRequestStop with value set to v.

func (*OptNilCreateAnswerRequestStop) Decode

Decode decodes CreateAnswerRequestStop from json.

func (OptNilCreateAnswerRequestStop) Encode

Encode encodes CreateAnswerRequestStop as json.

func (OptNilCreateAnswerRequestStop) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateAnswerRequestStop) IsNull

IsSet returns true if value is Null.

func (OptNilCreateAnswerRequestStop) IsSet

IsSet returns true if OptNilCreateAnswerRequestStop was set.

func (OptNilCreateAnswerRequestStop) MarshalJSON

func (s OptNilCreateAnswerRequestStop) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateAnswerRequestStop) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateAnswerRequestStop) Reset

func (o *OptNilCreateAnswerRequestStop) Reset()

Reset unsets value.

func (*OptNilCreateAnswerRequestStop) SetTo

SetTo sets value to v.

func (*OptNilCreateAnswerRequestStop) SetToNull

func (o *OptNilCreateAnswerRequestStop) SetToNull()

SetNull sets value to null.

func (*OptNilCreateAnswerRequestStop) UnmarshalJSON

func (s *OptNilCreateAnswerRequestStop) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateChatCompletionRequestStop

type OptNilCreateChatCompletionRequestStop struct {
	Value CreateChatCompletionRequestStop
	Set   bool
	Null  bool
}

OptNilCreateChatCompletionRequestStop is optional nullable CreateChatCompletionRequestStop.

func NewOptNilCreateChatCompletionRequestStop

func NewOptNilCreateChatCompletionRequestStop(v CreateChatCompletionRequestStop) OptNilCreateChatCompletionRequestStop

NewOptNilCreateChatCompletionRequestStop returns new OptNilCreateChatCompletionRequestStop with value set to v.

func (*OptNilCreateChatCompletionRequestStop) Decode

Decode decodes CreateChatCompletionRequestStop from json.

func (OptNilCreateChatCompletionRequestStop) Encode

Encode encodes CreateChatCompletionRequestStop as json.

func (OptNilCreateChatCompletionRequestStop) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateChatCompletionRequestStop) IsNull

IsSet returns true if value is Null.

func (OptNilCreateChatCompletionRequestStop) IsSet

IsSet returns true if OptNilCreateChatCompletionRequestStop was set.

func (OptNilCreateChatCompletionRequestStop) MarshalJSON

func (s OptNilCreateChatCompletionRequestStop) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateChatCompletionRequestStop) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateChatCompletionRequestStop) Reset

Reset unsets value.

func (*OptNilCreateChatCompletionRequestStop) SetTo

SetTo sets value to v.

func (*OptNilCreateChatCompletionRequestStop) SetToNull

SetNull sets value to null.

func (*OptNilCreateChatCompletionRequestStop) UnmarshalJSON

func (s *OptNilCreateChatCompletionRequestStop) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateCompletionRequestPrompt

type OptNilCreateCompletionRequestPrompt struct {
	Value CreateCompletionRequestPrompt
	Set   bool
	Null  bool
}

OptNilCreateCompletionRequestPrompt is optional nullable CreateCompletionRequestPrompt.

func NewOptNilCreateCompletionRequestPrompt

func NewOptNilCreateCompletionRequestPrompt(v CreateCompletionRequestPrompt) OptNilCreateCompletionRequestPrompt

NewOptNilCreateCompletionRequestPrompt returns new OptNilCreateCompletionRequestPrompt with value set to v.

func (*OptNilCreateCompletionRequestPrompt) Decode

Decode decodes CreateCompletionRequestPrompt from json.

func (OptNilCreateCompletionRequestPrompt) Encode

Encode encodes CreateCompletionRequestPrompt as json.

func (OptNilCreateCompletionRequestPrompt) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateCompletionRequestPrompt) IsNull

IsSet returns true if value is Null.

func (OptNilCreateCompletionRequestPrompt) IsSet

IsSet returns true if OptNilCreateCompletionRequestPrompt was set.

func (OptNilCreateCompletionRequestPrompt) MarshalJSON

func (s OptNilCreateCompletionRequestPrompt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateCompletionRequestPrompt) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateCompletionRequestPrompt) Reset

Reset unsets value.

func (*OptNilCreateCompletionRequestPrompt) SetTo

SetTo sets value to v.

func (*OptNilCreateCompletionRequestPrompt) SetToNull

func (o *OptNilCreateCompletionRequestPrompt) SetToNull()

SetNull sets value to null.

func (*OptNilCreateCompletionRequestPrompt) UnmarshalJSON

func (s *OptNilCreateCompletionRequestPrompt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateCompletionRequestStop

type OptNilCreateCompletionRequestStop struct {
	Value CreateCompletionRequestStop
	Set   bool
	Null  bool
}

OptNilCreateCompletionRequestStop is optional nullable CreateCompletionRequestStop.

func NewOptNilCreateCompletionRequestStop

func NewOptNilCreateCompletionRequestStop(v CreateCompletionRequestStop) OptNilCreateCompletionRequestStop

NewOptNilCreateCompletionRequestStop returns new OptNilCreateCompletionRequestStop with value set to v.

func (*OptNilCreateCompletionRequestStop) Decode

Decode decodes CreateCompletionRequestStop from json.

func (OptNilCreateCompletionRequestStop) Encode

Encode encodes CreateCompletionRequestStop as json.

func (OptNilCreateCompletionRequestStop) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateCompletionRequestStop) IsNull

IsSet returns true if value is Null.

func (OptNilCreateCompletionRequestStop) IsSet

IsSet returns true if OptNilCreateCompletionRequestStop was set.

func (OptNilCreateCompletionRequestStop) MarshalJSON

func (s OptNilCreateCompletionRequestStop) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateCompletionRequestStop) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateCompletionRequestStop) Reset

Reset unsets value.

func (*OptNilCreateCompletionRequestStop) SetTo

SetTo sets value to v.

func (*OptNilCreateCompletionRequestStop) SetToNull

func (o *OptNilCreateCompletionRequestStop) SetToNull()

SetNull sets value to null.

func (*OptNilCreateCompletionRequestStop) UnmarshalJSON

func (s *OptNilCreateCompletionRequestStop) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateCompletionResponseChoicesItemLogprobs

type OptNilCreateCompletionResponseChoicesItemLogprobs struct {
	Value CreateCompletionResponseChoicesItemLogprobs
	Set   bool
	Null  bool
}

OptNilCreateCompletionResponseChoicesItemLogprobs is optional nullable CreateCompletionResponseChoicesItemLogprobs.

func NewOptNilCreateCompletionResponseChoicesItemLogprobs

func NewOptNilCreateCompletionResponseChoicesItemLogprobs(v CreateCompletionResponseChoicesItemLogprobs) OptNilCreateCompletionResponseChoicesItemLogprobs

NewOptNilCreateCompletionResponseChoicesItemLogprobs returns new OptNilCreateCompletionResponseChoicesItemLogprobs with value set to v.

func (*OptNilCreateCompletionResponseChoicesItemLogprobs) Decode

Decode decodes CreateCompletionResponseChoicesItemLogprobs from json.

func (OptNilCreateCompletionResponseChoicesItemLogprobs) Encode

Encode encodes CreateCompletionResponseChoicesItemLogprobs as json.

func (OptNilCreateCompletionResponseChoicesItemLogprobs) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateCompletionResponseChoicesItemLogprobs) IsNull

IsSet returns true if value is Null.

func (OptNilCreateCompletionResponseChoicesItemLogprobs) IsSet

IsSet returns true if OptNilCreateCompletionResponseChoicesItemLogprobs was set.

func (OptNilCreateCompletionResponseChoicesItemLogprobs) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateCompletionResponseChoicesItemLogprobs) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateCompletionResponseChoicesItemLogprobs) Reset

Reset unsets value.

func (*OptNilCreateCompletionResponseChoicesItemLogprobs) SetTo

SetTo sets value to v.

func (*OptNilCreateCompletionResponseChoicesItemLogprobs) SetToNull

SetNull sets value to null.

func (*OptNilCreateCompletionResponseChoicesItemLogprobs) UnmarshalJSON

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateEditResponseChoicesItemLogprobs

type OptNilCreateEditResponseChoicesItemLogprobs struct {
	Value CreateEditResponseChoicesItemLogprobs
	Set   bool
	Null  bool
}

OptNilCreateEditResponseChoicesItemLogprobs is optional nullable CreateEditResponseChoicesItemLogprobs.

func NewOptNilCreateEditResponseChoicesItemLogprobs

func NewOptNilCreateEditResponseChoicesItemLogprobs(v CreateEditResponseChoicesItemLogprobs) OptNilCreateEditResponseChoicesItemLogprobs

NewOptNilCreateEditResponseChoicesItemLogprobs returns new OptNilCreateEditResponseChoicesItemLogprobs with value set to v.

func (*OptNilCreateEditResponseChoicesItemLogprobs) Decode

Decode decodes CreateEditResponseChoicesItemLogprobs from json.

func (OptNilCreateEditResponseChoicesItemLogprobs) Encode

Encode encodes CreateEditResponseChoicesItemLogprobs as json.

func (OptNilCreateEditResponseChoicesItemLogprobs) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateEditResponseChoicesItemLogprobs) IsNull

IsSet returns true if value is Null.

func (OptNilCreateEditResponseChoicesItemLogprobs) IsSet

IsSet returns true if OptNilCreateEditResponseChoicesItemLogprobs was set.

func (OptNilCreateEditResponseChoicesItemLogprobs) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateEditResponseChoicesItemLogprobs) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateEditResponseChoicesItemLogprobs) Reset

Reset unsets value.

func (*OptNilCreateEditResponseChoicesItemLogprobs) SetTo

SetTo sets value to v.

func (*OptNilCreateEditResponseChoicesItemLogprobs) SetToNull

SetNull sets value to null.

func (*OptNilCreateEditResponseChoicesItemLogprobs) UnmarshalJSON

func (s *OptNilCreateEditResponseChoicesItemLogprobs) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateImageEditRequestMultipartResponseFormat

type OptNilCreateImageEditRequestMultipartResponseFormat struct {
	Value CreateImageEditRequestMultipartResponseFormat
	Set   bool
	Null  bool
}

OptNilCreateImageEditRequestMultipartResponseFormat is optional nullable CreateImageEditRequestMultipartResponseFormat.

func NewOptNilCreateImageEditRequestMultipartResponseFormat

func NewOptNilCreateImageEditRequestMultipartResponseFormat(v CreateImageEditRequestMultipartResponseFormat) OptNilCreateImageEditRequestMultipartResponseFormat

NewOptNilCreateImageEditRequestMultipartResponseFormat returns new OptNilCreateImageEditRequestMultipartResponseFormat with value set to v.

func (OptNilCreateImageEditRequestMultipartResponseFormat) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateImageEditRequestMultipartResponseFormat) IsNull

IsSet returns true if value is Null.

func (OptNilCreateImageEditRequestMultipartResponseFormat) IsSet

IsSet returns true if OptNilCreateImageEditRequestMultipartResponseFormat was set.

func (OptNilCreateImageEditRequestMultipartResponseFormat) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateImageEditRequestMultipartResponseFormat) Reset

Reset unsets value.

func (*OptNilCreateImageEditRequestMultipartResponseFormat) SetTo

SetTo sets value to v.

func (*OptNilCreateImageEditRequestMultipartResponseFormat) SetToNull

SetNull sets value to null.

type OptNilCreateImageEditRequestMultipartSize

type OptNilCreateImageEditRequestMultipartSize struct {
	Value CreateImageEditRequestMultipartSize
	Set   bool
	Null  bool
}

OptNilCreateImageEditRequestMultipartSize is optional nullable CreateImageEditRequestMultipartSize.

func NewOptNilCreateImageEditRequestMultipartSize

func NewOptNilCreateImageEditRequestMultipartSize(v CreateImageEditRequestMultipartSize) OptNilCreateImageEditRequestMultipartSize

NewOptNilCreateImageEditRequestMultipartSize returns new OptNilCreateImageEditRequestMultipartSize with value set to v.

func (OptNilCreateImageEditRequestMultipartSize) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateImageEditRequestMultipartSize) IsNull

IsSet returns true if value is Null.

func (OptNilCreateImageEditRequestMultipartSize) IsSet

IsSet returns true if OptNilCreateImageEditRequestMultipartSize was set.

func (OptNilCreateImageEditRequestMultipartSize) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateImageEditRequestMultipartSize) Reset

Reset unsets value.

func (*OptNilCreateImageEditRequestMultipartSize) SetTo

SetTo sets value to v.

func (*OptNilCreateImageEditRequestMultipartSize) SetToNull

SetNull sets value to null.

type OptNilCreateImageRequestResponseFormat

type OptNilCreateImageRequestResponseFormat struct {
	Value CreateImageRequestResponseFormat
	Set   bool
	Null  bool
}

OptNilCreateImageRequestResponseFormat is optional nullable CreateImageRequestResponseFormat.

func NewOptNilCreateImageRequestResponseFormat

func NewOptNilCreateImageRequestResponseFormat(v CreateImageRequestResponseFormat) OptNilCreateImageRequestResponseFormat

NewOptNilCreateImageRequestResponseFormat returns new OptNilCreateImageRequestResponseFormat with value set to v.

func (*OptNilCreateImageRequestResponseFormat) Decode

Decode decodes CreateImageRequestResponseFormat from json.

func (OptNilCreateImageRequestResponseFormat) Encode

Encode encodes CreateImageRequestResponseFormat as json.

func (OptNilCreateImageRequestResponseFormat) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateImageRequestResponseFormat) IsNull

IsSet returns true if value is Null.

func (OptNilCreateImageRequestResponseFormat) IsSet

IsSet returns true if OptNilCreateImageRequestResponseFormat was set.

func (OptNilCreateImageRequestResponseFormat) MarshalJSON

func (s OptNilCreateImageRequestResponseFormat) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateImageRequestResponseFormat) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateImageRequestResponseFormat) Reset

Reset unsets value.

func (*OptNilCreateImageRequestResponseFormat) SetTo

SetTo sets value to v.

func (*OptNilCreateImageRequestResponseFormat) SetToNull

SetNull sets value to null.

func (*OptNilCreateImageRequestResponseFormat) UnmarshalJSON

func (s *OptNilCreateImageRequestResponseFormat) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateImageRequestSize

type OptNilCreateImageRequestSize struct {
	Value CreateImageRequestSize
	Set   bool
	Null  bool
}

OptNilCreateImageRequestSize is optional nullable CreateImageRequestSize.

func NewOptNilCreateImageRequestSize

func NewOptNilCreateImageRequestSize(v CreateImageRequestSize) OptNilCreateImageRequestSize

NewOptNilCreateImageRequestSize returns new OptNilCreateImageRequestSize with value set to v.

func (*OptNilCreateImageRequestSize) Decode

Decode decodes CreateImageRequestSize from json.

func (OptNilCreateImageRequestSize) Encode

Encode encodes CreateImageRequestSize as json.

func (OptNilCreateImageRequestSize) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateImageRequestSize) IsNull

IsSet returns true if value is Null.

func (OptNilCreateImageRequestSize) IsSet

IsSet returns true if OptNilCreateImageRequestSize was set.

func (OptNilCreateImageRequestSize) MarshalJSON

func (s OptNilCreateImageRequestSize) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateImageRequestSize) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateImageRequestSize) Reset

func (o *OptNilCreateImageRequestSize) Reset()

Reset unsets value.

func (*OptNilCreateImageRequestSize) SetTo

SetTo sets value to v.

func (*OptNilCreateImageRequestSize) SetToNull

func (o *OptNilCreateImageRequestSize) SetToNull()

SetNull sets value to null.

func (*OptNilCreateImageRequestSize) UnmarshalJSON

func (s *OptNilCreateImageRequestSize) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateImageVariationRequestMultipartResponseFormat

type OptNilCreateImageVariationRequestMultipartResponseFormat struct {
	Value CreateImageVariationRequestMultipartResponseFormat
	Set   bool
	Null  bool
}

OptNilCreateImageVariationRequestMultipartResponseFormat is optional nullable CreateImageVariationRequestMultipartResponseFormat.

func NewOptNilCreateImageVariationRequestMultipartResponseFormat

func NewOptNilCreateImageVariationRequestMultipartResponseFormat(v CreateImageVariationRequestMultipartResponseFormat) OptNilCreateImageVariationRequestMultipartResponseFormat

NewOptNilCreateImageVariationRequestMultipartResponseFormat returns new OptNilCreateImageVariationRequestMultipartResponseFormat with value set to v.

func (OptNilCreateImageVariationRequestMultipartResponseFormat) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateImageVariationRequestMultipartResponseFormat) IsNull

IsSet returns true if value is Null.

func (OptNilCreateImageVariationRequestMultipartResponseFormat) IsSet

IsSet returns true if OptNilCreateImageVariationRequestMultipartResponseFormat was set.

func (OptNilCreateImageVariationRequestMultipartResponseFormat) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateImageVariationRequestMultipartResponseFormat) Reset

Reset unsets value.

func (*OptNilCreateImageVariationRequestMultipartResponseFormat) SetTo

SetTo sets value to v.

func (*OptNilCreateImageVariationRequestMultipartResponseFormat) SetToNull

SetNull sets value to null.

type OptNilCreateImageVariationRequestMultipartSize

type OptNilCreateImageVariationRequestMultipartSize struct {
	Value CreateImageVariationRequestMultipartSize
	Set   bool
	Null  bool
}

OptNilCreateImageVariationRequestMultipartSize is optional nullable CreateImageVariationRequestMultipartSize.

func NewOptNilCreateImageVariationRequestMultipartSize

func NewOptNilCreateImageVariationRequestMultipartSize(v CreateImageVariationRequestMultipartSize) OptNilCreateImageVariationRequestMultipartSize

NewOptNilCreateImageVariationRequestMultipartSize returns new OptNilCreateImageVariationRequestMultipartSize with value set to v.

func (OptNilCreateImageVariationRequestMultipartSize) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilCreateImageVariationRequestMultipartSize) IsNull

IsSet returns true if value is Null.

func (OptNilCreateImageVariationRequestMultipartSize) IsSet

IsSet returns true if OptNilCreateImageVariationRequestMultipartSize was set.

func (OptNilCreateImageVariationRequestMultipartSize) Or

Or returns value if set, or given parameter if does not.

func (*OptNilCreateImageVariationRequestMultipartSize) Reset

Reset unsets value.

func (*OptNilCreateImageVariationRequestMultipartSize) SetTo

SetTo sets value to v.

func (*OptNilCreateImageVariationRequestMultipartSize) SetToNull

SetNull sets value to null.

type OptNilFloat64

type OptNilFloat64 struct {
	Value float64
	Set   bool
	Null  bool
}

OptNilFloat64 is optional nullable float64.

func NewOptNilFloat64

func NewOptNilFloat64(v float64) OptNilFloat64

NewOptNilFloat64 returns new OptNilFloat64 with value set to v.

func (*OptNilFloat64) Decode

func (o *OptNilFloat64) Decode(d *jx.Decoder) error

Decode decodes float64 from json.

func (OptNilFloat64) Encode

func (o OptNilFloat64) Encode(e *jx.Encoder)

Encode encodes float64 as json.

func (OptNilFloat64) Get

func (o OptNilFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilFloat64) IsNull

func (o OptNilFloat64) IsNull() bool

IsSet returns true if value is Null.

func (OptNilFloat64) IsSet

func (o OptNilFloat64) IsSet() bool

IsSet returns true if OptNilFloat64 was set.

func (OptNilFloat64) MarshalJSON

func (s OptNilFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilFloat64) Or

func (o OptNilFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptNilFloat64) Reset

func (o *OptNilFloat64) Reset()

Reset unsets value.

func (*OptNilFloat64) SetTo

func (o *OptNilFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptNilFloat64) SetToNull

func (o *OptNilFloat64) SetToNull()

SetNull sets value to null.

func (*OptNilFloat64) UnmarshalJSON

func (s *OptNilFloat64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilFloat64Array

type OptNilFloat64Array struct {
	Value []float64
	Set   bool
	Null  bool
}

OptNilFloat64Array is optional nullable []float64.

func NewOptNilFloat64Array

func NewOptNilFloat64Array(v []float64) OptNilFloat64Array

NewOptNilFloat64Array returns new OptNilFloat64Array with value set to v.

func (*OptNilFloat64Array) Decode

func (o *OptNilFloat64Array) Decode(d *jx.Decoder) error

Decode decodes []float64 from json.

func (OptNilFloat64Array) Encode

func (o OptNilFloat64Array) Encode(e *jx.Encoder)

Encode encodes []float64 as json.

func (OptNilFloat64Array) Get

func (o OptNilFloat64Array) Get() (v []float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilFloat64Array) IsNull

func (o OptNilFloat64Array) IsNull() bool

IsSet returns true if value is Null.

func (OptNilFloat64Array) IsSet

func (o OptNilFloat64Array) IsSet() bool

IsSet returns true if OptNilFloat64Array was set.

func (OptNilFloat64Array) MarshalJSON

func (s OptNilFloat64Array) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilFloat64Array) Or

func (o OptNilFloat64Array) Or(d []float64) []float64

Or returns value if set, or given parameter if does not.

func (*OptNilFloat64Array) Reset

func (o *OptNilFloat64Array) Reset()

Reset unsets value.

func (*OptNilFloat64Array) SetTo

func (o *OptNilFloat64Array) SetTo(v []float64)

SetTo sets value to v.

func (*OptNilFloat64Array) SetToNull

func (o *OptNilFloat64Array) SetToNull()

SetNull sets value to null.

func (*OptNilFloat64Array) UnmarshalJSON

func (s *OptNilFloat64Array) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilInt

type OptNilInt struct {
	Value int
	Set   bool
	Null  bool
}

OptNilInt is optional nullable int.

func NewOptNilInt

func NewOptNilInt(v int) OptNilInt

NewOptNilInt returns new OptNilInt with value set to v.

func (*OptNilInt) Decode

func (o *OptNilInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptNilInt) Encode

func (o OptNilInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptNilInt) Get

func (o OptNilInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilInt) IsNull

func (o OptNilInt) IsNull() bool

IsSet returns true if value is Null.

func (OptNilInt) IsSet

func (o OptNilInt) IsSet() bool

IsSet returns true if OptNilInt was set.

func (OptNilInt) MarshalJSON

func (s OptNilInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilInt) Or

func (o OptNilInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptNilInt) Reset

func (o *OptNilInt) Reset()

Reset unsets value.

func (*OptNilInt) SetTo

func (o *OptNilInt) SetTo(v int)

SetTo sets value to v.

func (*OptNilInt) SetToNull

func (o *OptNilInt) SetToNull()

SetNull sets value to null.

func (*OptNilInt) UnmarshalJSON

func (s *OptNilInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilString

type OptNilString struct {
	Value string
	Set   bool
	Null  bool
}

OptNilString is optional nullable string.

func NewOptNilString

func NewOptNilString(v string) OptNilString

NewOptNilString returns new OptNilString with value set to v.

func (*OptNilString) Decode

func (o *OptNilString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptNilString) Encode

func (o OptNilString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptNilString) Get

func (o OptNilString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilString) IsNull

func (o OptNilString) IsNull() bool

IsSet returns true if value is Null.

func (OptNilString) IsSet

func (o OptNilString) IsSet() bool

IsSet returns true if OptNilString was set.

func (OptNilString) MarshalJSON

func (s OptNilString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilString) Or

func (o OptNilString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptNilString) Reset

func (o *OptNilString) Reset()

Reset unsets value.

func (*OptNilString) SetTo

func (o *OptNilString) SetTo(v string)

SetTo sets value to v.

func (*OptNilString) SetToNull

func (o *OptNilString) SetToNull()

SetNull sets value to null.

func (*OptNilString) UnmarshalJSON

func (s *OptNilString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilStringArray

type OptNilStringArray struct {
	Value []string
	Set   bool
	Null  bool
}

OptNilStringArray is optional nullable []string.

func NewOptNilStringArray

func NewOptNilStringArray(v []string) OptNilStringArray

NewOptNilStringArray returns new OptNilStringArray with value set to v.

func (*OptNilStringArray) Decode

func (o *OptNilStringArray) Decode(d *jx.Decoder) error

Decode decodes []string from json.

func (OptNilStringArray) Encode

func (o OptNilStringArray) Encode(e *jx.Encoder)

Encode encodes []string as json.

func (OptNilStringArray) Get

func (o OptNilStringArray) Get() (v []string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilStringArray) IsNull

func (o OptNilStringArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilStringArray) IsSet

func (o OptNilStringArray) IsSet() bool

IsSet returns true if OptNilStringArray was set.

func (OptNilStringArray) MarshalJSON

func (s OptNilStringArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilStringArray) Or

func (o OptNilStringArray) Or(d []string) []string

Or returns value if set, or given parameter if does not.

func (*OptNilStringArray) Reset

func (o *OptNilStringArray) Reset()

Reset unsets value.

func (*OptNilStringArray) SetTo

func (o *OptNilStringArray) SetTo(v []string)

SetTo sets value to v.

func (*OptNilStringArray) SetToNull

func (o *OptNilStringArray) SetToNull()

SetNull sets value to null.

func (*OptNilStringArray) UnmarshalJSON

func (s *OptNilStringArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilStringArrayArray

type OptNilStringArrayArray struct {
	Value [][]string
	Set   bool
	Null  bool
}

OptNilStringArrayArray is optional nullable [][]string.

func NewOptNilStringArrayArray

func NewOptNilStringArrayArray(v [][]string) OptNilStringArrayArray

NewOptNilStringArrayArray returns new OptNilStringArrayArray with value set to v.

func (*OptNilStringArrayArray) Decode

func (o *OptNilStringArrayArray) Decode(d *jx.Decoder) error

Decode decodes [][]string from json.

func (OptNilStringArrayArray) Encode

func (o OptNilStringArrayArray) Encode(e *jx.Encoder)

Encode encodes [][]string as json.

func (OptNilStringArrayArray) Get

func (o OptNilStringArrayArray) Get() (v [][]string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilStringArrayArray) IsNull

func (o OptNilStringArrayArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilStringArrayArray) IsSet

func (o OptNilStringArrayArray) IsSet() bool

IsSet returns true if OptNilStringArrayArray was set.

func (OptNilStringArrayArray) MarshalJSON

func (s OptNilStringArrayArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilStringArrayArray) Or

func (o OptNilStringArrayArray) Or(d [][]string) [][]string

Or returns value if set, or given parameter if does not.

func (*OptNilStringArrayArray) Reset

func (o *OptNilStringArrayArray) Reset()

Reset unsets value.

func (*OptNilStringArrayArray) SetTo

func (o *OptNilStringArrayArray) SetTo(v [][]string)

SetTo sets value to v.

func (*OptNilStringArrayArray) SetToNull

func (o *OptNilStringArrayArray) SetToNull()

SetNull sets value to null.

func (*OptNilStringArrayArray) UnmarshalJSON

func (s *OptNilStringArrayArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type RetrieveEngineParams

type RetrieveEngineParams struct {
	// The ID of the engine to use for this request.
	EngineID string
}

RetrieveEngineParams is parameters of retrieveEngine operation.

type RetrieveFileParams

type RetrieveFileParams struct {
	// The ID of the file to use for this request.
	FileID string
}

RetrieveFileParams is parameters of retrieveFile operation.

type RetrieveFineTuneParams

type RetrieveFineTuneParams struct {
	// The ID of the fine-tune job.
	FineTuneID string
}

RetrieveFineTuneParams is parameters of retrieveFineTune operation.

type RetrieveModelParams

type RetrieveModelParams struct {
	// The ID of the model to use for this request.
	Model string
}

RetrieveModelParams is parameters of retrieveModel operation.

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) CancelFineTune

func (UnimplementedHandler) CancelFineTune(ctx context.Context, params CancelFineTuneParams) (r FineTune, _ error)

CancelFineTune implements cancelFineTune operation.

Immediately cancel a fine-tune job.

POST /fine-tunes/{fine_tune_id}/cancel

func (UnimplementedHandler) CreateAnswer deprecated

CreateAnswer implements createAnswer operation.

Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).

Deprecated: schema marks this operation as deprecated.

POST /answers

func (UnimplementedHandler) CreateChatCompletion

CreateChatCompletion implements createChatCompletion operation.

Creates a completion for the chat message.

POST /chat/completions

func (UnimplementedHandler) CreateClassification deprecated

CreateClassification implements createClassification operation.

Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.

Deprecated: schema marks this operation as deprecated.

POST /classifications

func (UnimplementedHandler) CreateCompletion

CreateCompletion implements createCompletion operation.

Creates a completion for the provided prompt and parameters.

POST /completions

func (UnimplementedHandler) CreateEdit

CreateEdit implements createEdit operation.

Creates a new edit for the provided input, instruction, and parameters.

POST /edits

func (UnimplementedHandler) CreateEmbedding

CreateEmbedding implements createEmbedding operation.

Creates an embedding vector representing the input text.

POST /embeddings

func (UnimplementedHandler) CreateFile

CreateFile implements createFile operation.

Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.

POST /files

func (UnimplementedHandler) CreateFineTune

func (UnimplementedHandler) CreateFineTune(ctx context.Context, req *CreateFineTuneRequest) (r FineTune, _ error)

CreateFineTune implements createFineTune operation.

Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about Fine-tuning](/docs/guides/fine-tuning).

POST /fine-tunes

func (UnimplementedHandler) CreateImage

CreateImage implements createImage operation.

Creates an image given a prompt.

POST /images/generations

func (UnimplementedHandler) CreateImageEdit

CreateImageEdit implements createImageEdit operation.

Creates an edited or extended image given an original image and a prompt.

POST /images/edits

func (UnimplementedHandler) CreateImageVariation

CreateImageVariation implements createImageVariation operation.

Creates a variation of a given image.

POST /images/variations

func (UnimplementedHandler) CreateModeration

CreateModeration implements createModeration operation.

Classifies if text violates OpenAI's Content Policy.

POST /moderations

func (UnimplementedHandler) CreateSearch deprecated

CreateSearch implements createSearch operation.

The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.

Deprecated: schema marks this operation as deprecated.

POST /engines/{engine_id}/search

func (UnimplementedHandler) CreateTranscription

CreateTranscription implements createTranscription operation.

Transcribes audio into the input language.

POST /audio/transcriptions

func (UnimplementedHandler) CreateTranslation

CreateTranslation implements createTranslation operation.

Translates audio into into English.

POST /audio/translations

func (UnimplementedHandler) DeleteFile

DeleteFile implements deleteFile operation.

Delete a file.

DELETE /files/{file_id}

func (UnimplementedHandler) DeleteModel

DeleteModel implements deleteModel operation.

Delete a fine-tuned model. You must have the Owner role in your organization.

DELETE /models/{model}

func (UnimplementedHandler) DownloadFile

func (UnimplementedHandler) DownloadFile(ctx context.Context, params DownloadFileParams) (r string, _ error)

DownloadFile implements downloadFile operation.

Returns the contents of the specified file.

GET /files/{file_id}/content

func (UnimplementedHandler) ListEngines deprecated

ListEngines implements listEngines operation.

Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.

Deprecated: schema marks this operation as deprecated.

GET /engines

func (UnimplementedHandler) ListFiles

ListFiles implements listFiles operation.

Returns a list of files that belong to the user's organization.

GET /files

func (UnimplementedHandler) ListFineTuneEvents

ListFineTuneEvents implements listFineTuneEvents operation.

Get fine-grained status updates for a fine-tune job.

GET /fine-tunes/{fine_tune_id}/events

func (UnimplementedHandler) ListFineTunes

func (UnimplementedHandler) ListFineTunes(ctx context.Context) (r *ListFineTunesResponse, _ error)

ListFineTunes implements listFineTunes operation.

List your organization's fine-tuning jobs.

GET /fine-tunes

func (UnimplementedHandler) ListModels

ListModels implements listModels operation.

Lists the currently available models, and provides basic information about each one such as the owner and availability.

GET /models

func (UnimplementedHandler) RetrieveEngine deprecated

func (UnimplementedHandler) RetrieveEngine(ctx context.Context, params RetrieveEngineParams) (r Engine, _ error)

RetrieveEngine implements retrieveEngine operation.

Retrieves a model instance, providing basic information about it such as the owner and availability.

Deprecated: schema marks this operation as deprecated.

GET /engines/{engine_id}

func (UnimplementedHandler) RetrieveFile

func (UnimplementedHandler) RetrieveFile(ctx context.Context, params RetrieveFileParams) (r OpenAIFile, _ error)

RetrieveFile implements retrieveFile operation.

Returns information about a specific file.

GET /files/{file_id}

func (UnimplementedHandler) RetrieveFineTune

func (UnimplementedHandler) RetrieveFineTune(ctx context.Context, params RetrieveFineTuneParams) (r FineTune, _ error)

RetrieveFineTune implements retrieveFineTune operation.

Gets info about the fine-tune job. [Learn more about Fine-tuning](/docs/guides/fine-tuning).

GET /fine-tunes/{fine_tune_id}

func (UnimplementedHandler) RetrieveModel

func (UnimplementedHandler) RetrieveModel(ctx context.Context, params RetrieveModelParams) (r Model, _ error)

RetrieveModel implements retrieveModel operation.

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

GET /models/{model}

Jump to

Keyboard shortcuts

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