ogen

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRolesForBearerAuth

func GetRolesForBearerAuth(operation string) []string

GetRolesForBearerAuth returns the required roles for the given operation.

This is useful for authorization scenarios where you need to know which roles are required for an operation.

Example:

requiredRoles := GetRolesForBearerAuth(AddPetOperation)

Returns nil if the operation has no role requirements or if the operation is unknown.

func WithServerURL

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

WithServerURL sets context key to override server URL.

Types

type BearerAuth

type BearerAuth struct {
	Token string
	Roles []string
}

func (*BearerAuth) GetRoles

func (s *BearerAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*BearerAuth) GetToken

func (s *BearerAuth) GetToken() string

GetToken returns the value of Token.

func (*BearerAuth) SetRoles

func (s *BearerAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

func (*BearerAuth) SetToken

func (s *BearerAuth) SetToken(val string)

SetToken sets the value of Token.

type ChatCompletionChoice

type ChatCompletionChoice struct {
	// Index of this choice.
	Index   int                   `json:"index"`
	Message ChatCompletionMessage `json:"message"`
	// The reason the model stopped generating.
	FinishReason NilChatCompletionChoiceFinishReason `json:"finish_reason"`
	Logprobs     OptNilChatCompletionLogprobs        `json:"logprobs"`
}

Ref: #/components/schemas/ChatCompletionChoice

func (*ChatCompletionChoice) Decode

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

Decode decodes ChatCompletionChoice from json.

func (*ChatCompletionChoice) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionChoice) GetFinishReason

GetFinishReason returns the value of FinishReason.

func (*ChatCompletionChoice) GetIndex

func (s *ChatCompletionChoice) GetIndex() int

GetIndex returns the value of Index.

func (*ChatCompletionChoice) GetLogprobs

GetLogprobs returns the value of Logprobs.

func (*ChatCompletionChoice) GetMessage

GetMessage returns the value of Message.

func (*ChatCompletionChoice) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionChoice) SetFinishReason

SetFinishReason sets the value of FinishReason.

func (*ChatCompletionChoice) SetIndex

func (s *ChatCompletionChoice) SetIndex(val int)

SetIndex sets the value of Index.

func (*ChatCompletionChoice) SetLogprobs

SetLogprobs sets the value of Logprobs.

func (*ChatCompletionChoice) SetMessage

func (s *ChatCompletionChoice) SetMessage(val ChatCompletionMessage)

SetMessage sets the value of Message.

func (*ChatCompletionChoice) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionChoice) Validate

func (s *ChatCompletionChoice) Validate() error

type ChatCompletionChoiceFinishReason

type ChatCompletionChoiceFinishReason string

The reason the model stopped generating.

const (
	ChatCompletionChoiceFinishReasonStop          ChatCompletionChoiceFinishReason = "stop"
	ChatCompletionChoiceFinishReasonLength        ChatCompletionChoiceFinishReason = "length"
	ChatCompletionChoiceFinishReasonToolCalls     ChatCompletionChoiceFinishReason = "tool_calls"
	ChatCompletionChoiceFinishReasonContentFilter ChatCompletionChoiceFinishReason = "content_filter"
	ChatCompletionChoiceFinishReasonFunctionCall  ChatCompletionChoiceFinishReason = "function_call"
)

func (ChatCompletionChoiceFinishReason) AllValues

AllValues returns all ChatCompletionChoiceFinishReason values.

func (*ChatCompletionChoiceFinishReason) Decode

Decode decodes ChatCompletionChoiceFinishReason from json.

func (ChatCompletionChoiceFinishReason) Encode

Encode encodes ChatCompletionChoiceFinishReason as json.

func (ChatCompletionChoiceFinishReason) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionChoiceFinishReason) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionChoiceFinishReason) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionChoiceFinishReason) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionChoiceFinishReason) Validate

type ChatCompletionContentPart

type ChatCompletionContentPart struct {
	Type     ChatCompletionContentPartType        `json:"type"`
	Text     OptString                            `json:"text"`
	ImageURL OptChatCompletionContentPartImageURL `json:"image_url"`
}

Ref: #/components/schemas/ChatCompletionContentPart

func (*ChatCompletionContentPart) Decode

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

Decode decodes ChatCompletionContentPart from json.

func (*ChatCompletionContentPart) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionContentPart) GetImageURL

GetImageURL returns the value of ImageURL.

func (*ChatCompletionContentPart) GetText

func (s *ChatCompletionContentPart) GetText() OptString

GetText returns the value of Text.

func (*ChatCompletionContentPart) GetType

GetType returns the value of Type.

func (*ChatCompletionContentPart) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionContentPart) SetImageURL

SetImageURL sets the value of ImageURL.

func (*ChatCompletionContentPart) SetText

func (s *ChatCompletionContentPart) SetText(val OptString)

SetText sets the value of Text.

func (*ChatCompletionContentPart) SetType

SetType sets the value of Type.

func (*ChatCompletionContentPart) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionContentPart) Validate

func (s *ChatCompletionContentPart) Validate() error

type ChatCompletionContentPartImageURL

type ChatCompletionContentPartImageURL struct {
	URL    OptString                                  `json:"url"`
	Detail OptChatCompletionContentPartImageURLDetail `json:"detail"`
}

func (*ChatCompletionContentPartImageURL) Decode

Decode decodes ChatCompletionContentPartImageURL from json.

func (*ChatCompletionContentPartImageURL) Encode

Encode implements json.Marshaler.

func (*ChatCompletionContentPartImageURL) GetDetail

GetDetail returns the value of Detail.

func (*ChatCompletionContentPartImageURL) GetURL

GetURL returns the value of URL.

func (*ChatCompletionContentPartImageURL) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionContentPartImageURL) SetDetail

SetDetail sets the value of Detail.

func (*ChatCompletionContentPartImageURL) SetURL

SetURL sets the value of URL.

func (*ChatCompletionContentPartImageURL) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionContentPartImageURL) Validate

type ChatCompletionContentPartImageURLDetail

type ChatCompletionContentPartImageURLDetail string
const (
	ChatCompletionContentPartImageURLDetailAuto ChatCompletionContentPartImageURLDetail = "auto"
	ChatCompletionContentPartImageURLDetailLow  ChatCompletionContentPartImageURLDetail = "low"
	ChatCompletionContentPartImageURLDetailHigh ChatCompletionContentPartImageURLDetail = "high"
)

func (ChatCompletionContentPartImageURLDetail) AllValues

AllValues returns all ChatCompletionContentPartImageURLDetail values.

func (*ChatCompletionContentPartImageURLDetail) Decode

Decode decodes ChatCompletionContentPartImageURLDetail from json.

func (ChatCompletionContentPartImageURLDetail) Encode

Encode encodes ChatCompletionContentPartImageURLDetail as json.

func (ChatCompletionContentPartImageURLDetail) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionContentPartImageURLDetail) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionContentPartImageURLDetail) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionContentPartImageURLDetail) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionContentPartImageURLDetail) Validate

type ChatCompletionContentPartType

type ChatCompletionContentPartType string
const (
	ChatCompletionContentPartTypeText     ChatCompletionContentPartType = "text"
	ChatCompletionContentPartTypeImageURL ChatCompletionContentPartType = "image_url"
)

func (ChatCompletionContentPartType) AllValues

AllValues returns all ChatCompletionContentPartType values.

func (*ChatCompletionContentPartType) Decode

Decode decodes ChatCompletionContentPartType from json.

func (ChatCompletionContentPartType) Encode

Encode encodes ChatCompletionContentPartType as json.

func (ChatCompletionContentPartType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionContentPartType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionContentPartType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionContentPartType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionContentPartType) Validate

func (s ChatCompletionContentPartType) Validate() error

type ChatCompletionLogprobs

type ChatCompletionLogprobs struct {
	Content OptNilChatCompletionTokenLogprobArray `json:"content"`
	Refusal OptNilChatCompletionTokenLogprobArray `json:"refusal"`
}

Ref: #/components/schemas/ChatCompletionLogprobs

func (*ChatCompletionLogprobs) Decode

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

Decode decodes ChatCompletionLogprobs from json.

func (*ChatCompletionLogprobs) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionLogprobs) GetContent

GetContent returns the value of Content.

func (*ChatCompletionLogprobs) GetRefusal

GetRefusal returns the value of Refusal.

func (*ChatCompletionLogprobs) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionLogprobs) SetContent

SetContent sets the value of Content.

func (*ChatCompletionLogprobs) SetRefusal

SetRefusal sets the value of Refusal.

func (*ChatCompletionLogprobs) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionLogprobs) Validate

func (s *ChatCompletionLogprobs) Validate() error

type ChatCompletionMessage

type ChatCompletionMessage struct {
	Role ChatCompletionMessageRole `json:"role"`
	// The contents of the message.
	Content   NilString                       `json:"content"`
	ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls"`
	// Deprecated: schema marks this property as deprecated.
	FunctionCall OptChatCompletionMessageFunctionCall `json:"function_call"`
	Refusal      OptNilString                         `json:"refusal"`
}

Ref: #/components/schemas/ChatCompletionMessage

func (*ChatCompletionMessage) Decode

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

Decode decodes ChatCompletionMessage from json.

func (*ChatCompletionMessage) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionMessage) GetContent

func (s *ChatCompletionMessage) GetContent() NilString

GetContent returns the value of Content.

func (*ChatCompletionMessage) GetFunctionCall

GetFunctionCall returns the value of FunctionCall.

func (*ChatCompletionMessage) GetRefusal

func (s *ChatCompletionMessage) GetRefusal() OptNilString

GetRefusal returns the value of Refusal.

func (*ChatCompletionMessage) GetRole

GetRole returns the value of Role.

func (*ChatCompletionMessage) GetToolCalls

GetToolCalls returns the value of ToolCalls.

func (*ChatCompletionMessage) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionMessage) SetContent

func (s *ChatCompletionMessage) SetContent(val NilString)

SetContent sets the value of Content.

func (*ChatCompletionMessage) SetFunctionCall

SetFunctionCall sets the value of FunctionCall.

func (*ChatCompletionMessage) SetRefusal

func (s *ChatCompletionMessage) SetRefusal(val OptNilString)

SetRefusal sets the value of Refusal.

func (*ChatCompletionMessage) SetRole

SetRole sets the value of Role.

func (*ChatCompletionMessage) SetToolCalls

SetToolCalls sets the value of ToolCalls.

func (*ChatCompletionMessage) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionMessage) Validate

func (s *ChatCompletionMessage) Validate() error

type ChatCompletionMessageFunctionCall deprecated

type ChatCompletionMessageFunctionCall struct {
	Name      OptString `json:"name"`
	Arguments OptString `json:"arguments"`
}

Deprecated: schema marks this type as deprecated.

func (*ChatCompletionMessageFunctionCall) Decode

Decode decodes ChatCompletionMessageFunctionCall from json.

func (*ChatCompletionMessageFunctionCall) Encode

Encode implements json.Marshaler.

func (*ChatCompletionMessageFunctionCall) GetArguments

func (s *ChatCompletionMessageFunctionCall) GetArguments() OptString

GetArguments returns the value of Arguments.

func (*ChatCompletionMessageFunctionCall) GetName

GetName returns the value of Name.

func (*ChatCompletionMessageFunctionCall) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionMessageFunctionCall) SetArguments

func (s *ChatCompletionMessageFunctionCall) SetArguments(val OptString)

SetArguments sets the value of Arguments.

func (*ChatCompletionMessageFunctionCall) SetName

SetName sets the value of Name.

func (*ChatCompletionMessageFunctionCall) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ChatCompletionMessageParam

type ChatCompletionMessageParam struct {
	// The role of the message author.
	Role ChatCompletionMessageParamRole `json:"role"`
	// The contents of the message.
	Content OptNilChatCompletionMessageParamContent `json:"content"`
	// Optional name for the participant.
	Name OptString `json:"name"`
	// Tool calls generated by the model.
	ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls"`
	// Tool call that this message is responding to.
	ToolCallID OptString `json:"tool_call_id"`
}

Ref: #/components/schemas/ChatCompletionMessageParam

func (*ChatCompletionMessageParam) Decode

Decode decodes ChatCompletionMessageParam from json.

func (*ChatCompletionMessageParam) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionMessageParam) GetContent

GetContent returns the value of Content.

func (*ChatCompletionMessageParam) GetName

GetName returns the value of Name.

func (*ChatCompletionMessageParam) GetRole

GetRole returns the value of Role.

func (*ChatCompletionMessageParam) GetToolCallID

func (s *ChatCompletionMessageParam) GetToolCallID() OptString

GetToolCallID returns the value of ToolCallID.

func (*ChatCompletionMessageParam) GetToolCalls

GetToolCalls returns the value of ToolCalls.

func (*ChatCompletionMessageParam) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionMessageParam) SetContent

SetContent sets the value of Content.

func (*ChatCompletionMessageParam) SetName

func (s *ChatCompletionMessageParam) SetName(val OptString)

SetName sets the value of Name.

func (*ChatCompletionMessageParam) SetRole

SetRole sets the value of Role.

func (*ChatCompletionMessageParam) SetToolCallID

func (s *ChatCompletionMessageParam) SetToolCallID(val OptString)

SetToolCallID sets the value of ToolCallID.

func (*ChatCompletionMessageParam) SetToolCalls

SetToolCalls sets the value of ToolCalls.

func (*ChatCompletionMessageParam) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionMessageParam) Validate

func (s *ChatCompletionMessageParam) Validate() error

type ChatCompletionMessageParamContent

type ChatCompletionMessageParamContent struct {
	// Type selects the active sum variant, switch on this field.
	Type                           ChatCompletionMessageParamContentType
	String                         string
	ChatCompletionContentPartArray []ChatCompletionContentPart
}

The contents of the message. ChatCompletionMessageParamContent represents sum type.

func NewChatCompletionContentPartArrayChatCompletionMessageParamContent

func NewChatCompletionContentPartArrayChatCompletionMessageParamContent(v []ChatCompletionContentPart) ChatCompletionMessageParamContent

NewChatCompletionContentPartArrayChatCompletionMessageParamContent returns new ChatCompletionMessageParamContent from []ChatCompletionContentPart.

func NewStringChatCompletionMessageParamContent

func NewStringChatCompletionMessageParamContent(v string) ChatCompletionMessageParamContent

NewStringChatCompletionMessageParamContent returns new ChatCompletionMessageParamContent from string.

func (*ChatCompletionMessageParamContent) Decode

Decode decodes ChatCompletionMessageParamContent from json.

func (ChatCompletionMessageParamContent) Encode

Encode encodes ChatCompletionMessageParamContent as json.

func (ChatCompletionMessageParamContent) GetChatCompletionContentPartArray

func (s ChatCompletionMessageParamContent) GetChatCompletionContentPartArray() (v []ChatCompletionContentPart, ok bool)

GetChatCompletionContentPartArray returns []ChatCompletionContentPart and true boolean if ChatCompletionMessageParamContent is []ChatCompletionContentPart.

func (ChatCompletionMessageParamContent) GetString

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

GetString returns string and true boolean if ChatCompletionMessageParamContent is string.

func (ChatCompletionMessageParamContent) IsChatCompletionContentPartArray

func (s ChatCompletionMessageParamContent) IsChatCompletionContentPartArray() bool

IsChatCompletionContentPartArray reports whether ChatCompletionMessageParamContent is []ChatCompletionContentPart.

func (ChatCompletionMessageParamContent) IsString

IsString reports whether ChatCompletionMessageParamContent is string.

func (ChatCompletionMessageParamContent) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionMessageParamContent) SetChatCompletionContentPartArray

func (s *ChatCompletionMessageParamContent) SetChatCompletionContentPartArray(v []ChatCompletionContentPart)

SetChatCompletionContentPartArray sets ChatCompletionMessageParamContent to []ChatCompletionContentPart.

func (*ChatCompletionMessageParamContent) SetString

func (s *ChatCompletionMessageParamContent) SetString(v string)

SetString sets ChatCompletionMessageParamContent to string.

func (*ChatCompletionMessageParamContent) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ChatCompletionMessageParamContent) Validate

type ChatCompletionMessageParamContentType

type ChatCompletionMessageParamContentType string

ChatCompletionMessageParamContentType is oneOf type of ChatCompletionMessageParamContent.

const (
	StringChatCompletionMessageParamContent                         ChatCompletionMessageParamContentType = "string"
	ChatCompletionContentPartArrayChatCompletionMessageParamContent ChatCompletionMessageParamContentType = "[]ChatCompletionContentPart"
)

Possible values for ChatCompletionMessageParamContentType.

type ChatCompletionMessageParamRole

type ChatCompletionMessageParamRole string

The role of the message author.

const (
	ChatCompletionMessageParamRoleSystem    ChatCompletionMessageParamRole = "system"
	ChatCompletionMessageParamRoleUser      ChatCompletionMessageParamRole = "user"
	ChatCompletionMessageParamRoleAssistant ChatCompletionMessageParamRole = "assistant"
	ChatCompletionMessageParamRoleTool      ChatCompletionMessageParamRole = "tool"
)

func (ChatCompletionMessageParamRole) AllValues

AllValues returns all ChatCompletionMessageParamRole values.

func (*ChatCompletionMessageParamRole) Decode

Decode decodes ChatCompletionMessageParamRole from json.

func (ChatCompletionMessageParamRole) Encode

Encode encodes ChatCompletionMessageParamRole as json.

func (ChatCompletionMessageParamRole) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionMessageParamRole) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionMessageParamRole) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionMessageParamRole) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionMessageParamRole) Validate

type ChatCompletionMessageRole

type ChatCompletionMessageRole string
const (
	ChatCompletionMessageRoleAssistant ChatCompletionMessageRole = "assistant"
)

func (ChatCompletionMessageRole) AllValues

AllValues returns all ChatCompletionMessageRole values.

func (*ChatCompletionMessageRole) Decode

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

Decode decodes ChatCompletionMessageRole from json.

func (ChatCompletionMessageRole) Encode

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

Encode encodes ChatCompletionMessageRole as json.

func (ChatCompletionMessageRole) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionMessageRole) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionMessageRole) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionMessageRole) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionMessageRole) Validate

func (s ChatCompletionMessageRole) Validate() error

type ChatCompletionMessageToolCall

type ChatCompletionMessageToolCall struct {
	// The ID of the tool call.
	ID       string                                `json:"id"`
	Type     ChatCompletionMessageToolCallType     `json:"type"`
	Function ChatCompletionMessageToolCallFunction `json:"function"`
}

Ref: #/components/schemas/ChatCompletionMessageToolCall

func (*ChatCompletionMessageToolCall) Decode

Decode decodes ChatCompletionMessageToolCall from json.

func (*ChatCompletionMessageToolCall) Encode

Encode implements json.Marshaler.

func (*ChatCompletionMessageToolCall) GetFunction

GetFunction returns the value of Function.

func (*ChatCompletionMessageToolCall) GetID

GetID returns the value of ID.

func (*ChatCompletionMessageToolCall) GetType

GetType returns the value of Type.

func (*ChatCompletionMessageToolCall) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionMessageToolCall) SetFunction

SetFunction sets the value of Function.

func (*ChatCompletionMessageToolCall) SetID

func (s *ChatCompletionMessageToolCall) SetID(val string)

SetID sets the value of ID.

func (*ChatCompletionMessageToolCall) SetType

SetType sets the value of Type.

func (*ChatCompletionMessageToolCall) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionMessageToolCall) Validate

func (s *ChatCompletionMessageToolCall) Validate() error

type ChatCompletionMessageToolCallFunction

type ChatCompletionMessageToolCallFunction struct {
	// The name of the function to call.
	Name string `json:"name"`
	// JSON arguments to pass to the function.
	Arguments string `json:"arguments"`
}

func (*ChatCompletionMessageToolCallFunction) Decode

Decode decodes ChatCompletionMessageToolCallFunction from json.

func (*ChatCompletionMessageToolCallFunction) Encode

Encode implements json.Marshaler.

func (*ChatCompletionMessageToolCallFunction) GetArguments

GetArguments returns the value of Arguments.

func (*ChatCompletionMessageToolCallFunction) GetName

GetName returns the value of Name.

func (*ChatCompletionMessageToolCallFunction) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionMessageToolCallFunction) SetArguments

func (s *ChatCompletionMessageToolCallFunction) SetArguments(val string)

SetArguments sets the value of Arguments.

func (*ChatCompletionMessageToolCallFunction) SetName

SetName sets the value of Name.

func (*ChatCompletionMessageToolCallFunction) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ChatCompletionMessageToolCallType

type ChatCompletionMessageToolCallType string
const (
	ChatCompletionMessageToolCallTypeFunction ChatCompletionMessageToolCallType = "function"
)

func (ChatCompletionMessageToolCallType) AllValues

AllValues returns all ChatCompletionMessageToolCallType values.

func (*ChatCompletionMessageToolCallType) Decode

Decode decodes ChatCompletionMessageToolCallType from json.

func (ChatCompletionMessageToolCallType) Encode

Encode encodes ChatCompletionMessageToolCallType as json.

func (ChatCompletionMessageToolCallType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionMessageToolCallType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionMessageToolCallType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionMessageToolCallType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionMessageToolCallType) Validate

type ChatCompletionNamedToolChoice

type ChatCompletionNamedToolChoice struct {
	Type     ChatCompletionNamedToolChoiceType     `json:"type"`
	Function ChatCompletionNamedToolChoiceFunction `json:"function"`
}

Ref: #/components/schemas/ChatCompletionNamedToolChoice

func (*ChatCompletionNamedToolChoice) Decode

Decode decodes ChatCompletionNamedToolChoice from json.

func (*ChatCompletionNamedToolChoice) Encode

Encode implements json.Marshaler.

func (*ChatCompletionNamedToolChoice) GetFunction

GetFunction returns the value of Function.

func (*ChatCompletionNamedToolChoice) GetType

GetType returns the value of Type.

func (*ChatCompletionNamedToolChoice) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionNamedToolChoice) SetFunction

SetFunction sets the value of Function.

func (*ChatCompletionNamedToolChoice) SetType

SetType sets the value of Type.

func (*ChatCompletionNamedToolChoice) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionNamedToolChoice) Validate

func (s *ChatCompletionNamedToolChoice) Validate() error

type ChatCompletionNamedToolChoiceFunction

type ChatCompletionNamedToolChoiceFunction struct {
	Name string `json:"name"`
}

func (*ChatCompletionNamedToolChoiceFunction) Decode

Decode decodes ChatCompletionNamedToolChoiceFunction from json.

func (*ChatCompletionNamedToolChoiceFunction) Encode

Encode implements json.Marshaler.

func (*ChatCompletionNamedToolChoiceFunction) GetName

GetName returns the value of Name.

func (*ChatCompletionNamedToolChoiceFunction) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionNamedToolChoiceFunction) SetName

SetName sets the value of Name.

func (*ChatCompletionNamedToolChoiceFunction) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ChatCompletionNamedToolChoiceType

type ChatCompletionNamedToolChoiceType string
const (
	ChatCompletionNamedToolChoiceTypeFunction ChatCompletionNamedToolChoiceType = "function"
)

func (ChatCompletionNamedToolChoiceType) AllValues

AllValues returns all ChatCompletionNamedToolChoiceType values.

func (*ChatCompletionNamedToolChoiceType) Decode

Decode decodes ChatCompletionNamedToolChoiceType from json.

func (ChatCompletionNamedToolChoiceType) Encode

Encode encodes ChatCompletionNamedToolChoiceType as json.

func (ChatCompletionNamedToolChoiceType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionNamedToolChoiceType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionNamedToolChoiceType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionNamedToolChoiceType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionNamedToolChoiceType) Validate

type ChatCompletionStreamOptions

type ChatCompletionStreamOptions struct {
	// If true, include usage information in the final chunk.
	IncludeUsage OptBool `json:"include_usage"`
}

Ref: #/components/schemas/ChatCompletionStreamOptions

func (*ChatCompletionStreamOptions) Decode

Decode decodes ChatCompletionStreamOptions from json.

func (*ChatCompletionStreamOptions) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionStreamOptions) GetIncludeUsage

func (s *ChatCompletionStreamOptions) GetIncludeUsage() OptBool

GetIncludeUsage returns the value of IncludeUsage.

func (*ChatCompletionStreamOptions) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionStreamOptions) SetIncludeUsage

func (s *ChatCompletionStreamOptions) SetIncludeUsage(val OptBool)

SetIncludeUsage sets the value of IncludeUsage.

func (*ChatCompletionStreamOptions) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ChatCompletionTokenLogprob

type ChatCompletionTokenLogprob struct {
	Token       string                                      `json:"token"`
	Logprob     float64                                     `json:"logprob"`
	Bytes       []int                                       `json:"bytes"`
	TopLogprobs []ChatCompletionTokenLogprobTopLogprobsItem `json:"top_logprobs"`
}

Ref: #/components/schemas/ChatCompletionTokenLogprob

func (*ChatCompletionTokenLogprob) Decode

Decode decodes ChatCompletionTokenLogprob from json.

func (*ChatCompletionTokenLogprob) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionTokenLogprob) GetBytes

func (s *ChatCompletionTokenLogprob) GetBytes() []int

GetBytes returns the value of Bytes.

func (*ChatCompletionTokenLogprob) GetLogprob

func (s *ChatCompletionTokenLogprob) GetLogprob() float64

GetLogprob returns the value of Logprob.

func (*ChatCompletionTokenLogprob) GetToken

func (s *ChatCompletionTokenLogprob) GetToken() string

GetToken returns the value of Token.

func (*ChatCompletionTokenLogprob) GetTopLogprobs

GetTopLogprobs returns the value of TopLogprobs.

func (*ChatCompletionTokenLogprob) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionTokenLogprob) SetBytes

func (s *ChatCompletionTokenLogprob) SetBytes(val []int)

SetBytes sets the value of Bytes.

func (*ChatCompletionTokenLogprob) SetLogprob

func (s *ChatCompletionTokenLogprob) SetLogprob(val float64)

SetLogprob sets the value of Logprob.

func (*ChatCompletionTokenLogprob) SetToken

func (s *ChatCompletionTokenLogprob) SetToken(val string)

SetToken sets the value of Token.

func (*ChatCompletionTokenLogprob) SetTopLogprobs

SetTopLogprobs sets the value of TopLogprobs.

func (*ChatCompletionTokenLogprob) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionTokenLogprob) Validate

func (s *ChatCompletionTokenLogprob) Validate() error

type ChatCompletionTokenLogprobTopLogprobsItem

type ChatCompletionTokenLogprobTopLogprobsItem struct {
	Token   string  `json:"token"`
	Logprob float64 `json:"logprob"`
	Bytes   []int   `json:"bytes"`
}

func (*ChatCompletionTokenLogprobTopLogprobsItem) Decode

Decode decodes ChatCompletionTokenLogprobTopLogprobsItem from json.

func (*ChatCompletionTokenLogprobTopLogprobsItem) Encode

Encode implements json.Marshaler.

func (*ChatCompletionTokenLogprobTopLogprobsItem) GetBytes

GetBytes returns the value of Bytes.

func (*ChatCompletionTokenLogprobTopLogprobsItem) GetLogprob

GetLogprob returns the value of Logprob.

func (*ChatCompletionTokenLogprobTopLogprobsItem) GetToken

GetToken returns the value of Token.

func (*ChatCompletionTokenLogprobTopLogprobsItem) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionTokenLogprobTopLogprobsItem) SetBytes

SetBytes sets the value of Bytes.

func (*ChatCompletionTokenLogprobTopLogprobsItem) SetLogprob

SetLogprob sets the value of Logprob.

func (*ChatCompletionTokenLogprobTopLogprobsItem) SetToken

SetToken sets the value of Token.

func (*ChatCompletionTokenLogprobTopLogprobsItem) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionTokenLogprobTopLogprobsItem) Validate

type ChatCompletionTool

type ChatCompletionTool struct {
	Type     ChatCompletionToolType `json:"type"`
	Function FunctionObject         `json:"function"`
}

Ref: #/components/schemas/ChatCompletionTool

func (*ChatCompletionTool) Decode

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

Decode decodes ChatCompletionTool from json.

func (*ChatCompletionTool) Encode

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

Encode implements json.Marshaler.

func (*ChatCompletionTool) GetFunction

func (s *ChatCompletionTool) GetFunction() FunctionObject

GetFunction returns the value of Function.

func (*ChatCompletionTool) GetType

GetType returns the value of Type.

func (*ChatCompletionTool) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ChatCompletionTool) SetFunction

func (s *ChatCompletionTool) SetFunction(val FunctionObject)

SetFunction sets the value of Function.

func (*ChatCompletionTool) SetType

SetType sets the value of Type.

func (*ChatCompletionTool) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionTool) Validate

func (s *ChatCompletionTool) Validate() error

type ChatCompletionToolType

type ChatCompletionToolType string
const (
	ChatCompletionToolTypeFunction ChatCompletionToolType = "function"
)

func (ChatCompletionToolType) AllValues

AllValues returns all ChatCompletionToolType values.

func (*ChatCompletionToolType) Decode

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

Decode decodes ChatCompletionToolType from json.

func (ChatCompletionToolType) Encode

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

Encode encodes ChatCompletionToolType as json.

func (ChatCompletionToolType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ChatCompletionToolType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ChatCompletionToolType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ChatCompletionToolType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ChatCompletionToolType) Validate

func (s ChatCompletionToolType) Validate() error

type Client

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

Client implements OAS client.

func NewClient

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

NewClient initializes new Client defined by OAS.

func (*Client) CreateChatCompletion

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

CreateChatCompletion invokes createChatCompletion operation.

Creates a model response for the given chat conversation.

POST /chat/completions

func (*Client) ListModels

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

ListModels invokes listModels operation.

Lists the currently available models.

GET /models

func (*Client) RetrieveModel

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

RetrieveModel invokes retrieveModel operation.

Retrieves a model instance.

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 CompletionUsage

type CompletionUsage struct {
	// Number of tokens in the prompt.
	PromptTokens int `json:"prompt_tokens"`
	// Number of tokens in the completion.
	CompletionTokens int `json:"completion_tokens"`
	// Total number of tokens used.
	TotalTokens             int                                       `json:"total_tokens"`
	PromptTokensDetails     OptCompletionUsagePromptTokensDetails     `json:"prompt_tokens_details"`
	CompletionTokensDetails OptCompletionUsageCompletionTokensDetails `json:"completion_tokens_details"`
}

Ref: #/components/schemas/CompletionUsage

func (*CompletionUsage) Decode

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

Decode decodes CompletionUsage from json.

func (*CompletionUsage) Encode

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

Encode implements json.Marshaler.

func (*CompletionUsage) GetCompletionTokens

func (s *CompletionUsage) GetCompletionTokens() int

GetCompletionTokens returns the value of CompletionTokens.

func (*CompletionUsage) GetCompletionTokensDetails

func (s *CompletionUsage) GetCompletionTokensDetails() OptCompletionUsageCompletionTokensDetails

GetCompletionTokensDetails returns the value of CompletionTokensDetails.

func (*CompletionUsage) GetPromptTokens

func (s *CompletionUsage) GetPromptTokens() int

GetPromptTokens returns the value of PromptTokens.

func (*CompletionUsage) GetPromptTokensDetails

func (s *CompletionUsage) GetPromptTokensDetails() OptCompletionUsagePromptTokensDetails

GetPromptTokensDetails returns the value of PromptTokensDetails.

func (*CompletionUsage) GetTotalTokens

func (s *CompletionUsage) GetTotalTokens() int

GetTotalTokens returns the value of TotalTokens.

func (*CompletionUsage) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CompletionUsage) SetCompletionTokens

func (s *CompletionUsage) SetCompletionTokens(val int)

SetCompletionTokens sets the value of CompletionTokens.

func (*CompletionUsage) SetCompletionTokensDetails

func (s *CompletionUsage) SetCompletionTokensDetails(val OptCompletionUsageCompletionTokensDetails)

SetCompletionTokensDetails sets the value of CompletionTokensDetails.

func (*CompletionUsage) SetPromptTokens

func (s *CompletionUsage) SetPromptTokens(val int)

SetPromptTokens sets the value of PromptTokens.

func (*CompletionUsage) SetPromptTokensDetails

func (s *CompletionUsage) SetPromptTokensDetails(val OptCompletionUsagePromptTokensDetails)

SetPromptTokensDetails sets the value of PromptTokensDetails.

func (*CompletionUsage) SetTotalTokens

func (s *CompletionUsage) SetTotalTokens(val int)

SetTotalTokens sets the value of TotalTokens.

func (*CompletionUsage) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CompletionUsageCompletionTokensDetails

type CompletionUsageCompletionTokensDetails struct {
	ReasoningTokens          OptInt `json:"reasoning_tokens"`
	AudioTokens              OptInt `json:"audio_tokens"`
	AcceptedPredictionTokens OptInt `json:"accepted_prediction_tokens"`
	RejectedPredictionTokens OptInt `json:"rejected_prediction_tokens"`
}

func (*CompletionUsageCompletionTokensDetails) Decode

Decode decodes CompletionUsageCompletionTokensDetails from json.

func (*CompletionUsageCompletionTokensDetails) Encode

Encode implements json.Marshaler.

func (*CompletionUsageCompletionTokensDetails) GetAcceptedPredictionTokens

func (s *CompletionUsageCompletionTokensDetails) GetAcceptedPredictionTokens() OptInt

GetAcceptedPredictionTokens returns the value of AcceptedPredictionTokens.

func (*CompletionUsageCompletionTokensDetails) GetAudioTokens

func (s *CompletionUsageCompletionTokensDetails) GetAudioTokens() OptInt

GetAudioTokens returns the value of AudioTokens.

func (*CompletionUsageCompletionTokensDetails) GetReasoningTokens

func (s *CompletionUsageCompletionTokensDetails) GetReasoningTokens() OptInt

GetReasoningTokens returns the value of ReasoningTokens.

func (*CompletionUsageCompletionTokensDetails) GetRejectedPredictionTokens

func (s *CompletionUsageCompletionTokensDetails) GetRejectedPredictionTokens() OptInt

GetRejectedPredictionTokens returns the value of RejectedPredictionTokens.

func (*CompletionUsageCompletionTokensDetails) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CompletionUsageCompletionTokensDetails) SetAcceptedPredictionTokens

func (s *CompletionUsageCompletionTokensDetails) SetAcceptedPredictionTokens(val OptInt)

SetAcceptedPredictionTokens sets the value of AcceptedPredictionTokens.

func (*CompletionUsageCompletionTokensDetails) SetAudioTokens

func (s *CompletionUsageCompletionTokensDetails) SetAudioTokens(val OptInt)

SetAudioTokens sets the value of AudioTokens.

func (*CompletionUsageCompletionTokensDetails) SetReasoningTokens

func (s *CompletionUsageCompletionTokensDetails) SetReasoningTokens(val OptInt)

SetReasoningTokens sets the value of ReasoningTokens.

func (*CompletionUsageCompletionTokensDetails) SetRejectedPredictionTokens

func (s *CompletionUsageCompletionTokensDetails) SetRejectedPredictionTokens(val OptInt)

SetRejectedPredictionTokens sets the value of RejectedPredictionTokens.

func (*CompletionUsageCompletionTokensDetails) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CompletionUsagePromptTokensDetails

type CompletionUsagePromptTokensDetails struct {
	CachedTokens OptInt `json:"cached_tokens"`
	AudioTokens  OptInt `json:"audio_tokens"`
}

func (*CompletionUsagePromptTokensDetails) Decode

Decode decodes CompletionUsagePromptTokensDetails from json.

func (*CompletionUsagePromptTokensDetails) Encode

Encode implements json.Marshaler.

func (*CompletionUsagePromptTokensDetails) GetAudioTokens

func (s *CompletionUsagePromptTokensDetails) GetAudioTokens() OptInt

GetAudioTokens returns the value of AudioTokens.

func (*CompletionUsagePromptTokensDetails) GetCachedTokens

func (s *CompletionUsagePromptTokensDetails) GetCachedTokens() OptInt

GetCachedTokens returns the value of CachedTokens.

func (*CompletionUsagePromptTokensDetails) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CompletionUsagePromptTokensDetails) SetAudioTokens

func (s *CompletionUsagePromptTokensDetails) SetAudioTokens(val OptInt)

SetAudioTokens sets the value of AudioTokens.

func (*CompletionUsagePromptTokensDetails) SetCachedTokens

func (s *CompletionUsagePromptTokensDetails) SetCachedTokens(val OptInt)

SetCachedTokens sets the value of CachedTokens.

func (*CompletionUsagePromptTokensDetails) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateChatCompletionBadRequest

type CreateChatCompletionBadRequest ErrorResponse

func (*CreateChatCompletionBadRequest) Decode

Decode decodes CreateChatCompletionBadRequest from json.

func (*CreateChatCompletionBadRequest) Encode

Encode encodes CreateChatCompletionBadRequest as json.

func (*CreateChatCompletionBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateChatCompletionInternalServerError

type CreateChatCompletionInternalServerError ErrorResponse

func (*CreateChatCompletionInternalServerError) Decode

Decode decodes CreateChatCompletionInternalServerError from json.

func (*CreateChatCompletionInternalServerError) Encode

Encode encodes CreateChatCompletionInternalServerError as json.

func (*CreateChatCompletionInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateChatCompletionRequest

type CreateChatCompletionRequest struct {
	// ID of the model to use.
	Model string `json:"model"`
	// A list of messages comprising the conversation.
	Messages []ChatCompletionMessageParam `json:"messages"`
	// Sampling temperature between 0 and 2.
	Temperature OptNilFloat64 `json:"temperature"`
	// Nucleus sampling probability.
	TopP OptNilFloat64 `json:"top_p"`
	// Number of chat completion choices to generate.
	N OptNilInt `json:"n"`
	// If true, partial message deltas will be sent as SSE.
	Stream OptNilBool `json:"stream"`
	// Stop sequences.
	Stop OptNilCreateChatCompletionRequestStop `json:"stop"`
	// Maximum number of tokens to generate.
	MaxTokens OptNilInt `json:"max_tokens"`
	// Maximum number of tokens to generate (alternative to max_tokens).
	MaxCompletionTokens OptNilInt `json:"max_completion_tokens"`
	// Penalty for token presence.
	PresencePenalty OptNilFloat64 `json:"presence_penalty"`
	// Penalty for token frequency.
	FrequencyPenalty OptNilFloat64 `json:"frequency_penalty"`
	// Modify likelihood of specified tokens.
	LogitBias OptNilCreateChatCompletionRequestLogitBias `json:"logit_bias"`
	// Unique identifier for the end-user.
	User OptString `json:"user"`
	// List of tools the model may call.
	Tools []ChatCompletionTool `json:"tools"`
	// Controls which tool is called by the model.
	ToolChoice     OptCreateChatCompletionRequestToolChoice `json:"tool_choice"`
	ResponseFormat OptResponseFormat                        `json:"response_format"`
	// Seed for deterministic sampling.
	Seed          OptNilInt                         `json:"seed"`
	StreamOptions OptNilChatCompletionStreamOptions `json:"stream_options"`
	// Custom metadata.
	Metadata OptNilCreateChatCompletionRequestMetadata `json:"metadata"`
}

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

func (s *CreateChatCompletionRequest) GetMaxCompletionTokens() OptNilInt

GetMaxCompletionTokens returns the value of MaxCompletionTokens.

func (*CreateChatCompletionRequest) GetMaxTokens

func (s *CreateChatCompletionRequest) GetMaxTokens() OptNilInt

GetMaxTokens returns the value of MaxTokens.

func (*CreateChatCompletionRequest) GetMessages

GetMessages returns the value of Messages.

func (*CreateChatCompletionRequest) GetMetadata

GetMetadata returns the value of Metadata.

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

func (s *CreateChatCompletionRequest) GetResponseFormat() OptResponseFormat

GetResponseFormat returns the value of ResponseFormat.

func (*CreateChatCompletionRequest) GetSeed

GetSeed returns the value of Seed.

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

GetStreamOptions returns the value of StreamOptions.

func (*CreateChatCompletionRequest) GetTemperature

func (s *CreateChatCompletionRequest) GetTemperature() OptNilFloat64

GetTemperature returns the value of Temperature.

func (*CreateChatCompletionRequest) GetToolChoice

GetToolChoice returns the value of ToolChoice.

func (*CreateChatCompletionRequest) GetTools

GetTools returns the value of Tools.

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

func (s *CreateChatCompletionRequest) SetMaxCompletionTokens(val OptNilInt)

SetMaxCompletionTokens sets the value of MaxCompletionTokens.

func (*CreateChatCompletionRequest) SetMaxTokens

func (s *CreateChatCompletionRequest) SetMaxTokens(val OptNilInt)

SetMaxTokens sets the value of MaxTokens.

func (*CreateChatCompletionRequest) SetMessages

SetMessages sets the value of Messages.

func (*CreateChatCompletionRequest) SetMetadata

SetMetadata sets the value of Metadata.

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

func (s *CreateChatCompletionRequest) SetResponseFormat(val OptResponseFormat)

SetResponseFormat sets the value of ResponseFormat.

func (*CreateChatCompletionRequest) SetSeed

func (s *CreateChatCompletionRequest) SetSeed(val OptNilInt)

SetSeed sets the value of Seed.

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

SetStreamOptions sets the value of StreamOptions.

func (*CreateChatCompletionRequest) SetTemperature

func (s *CreateChatCompletionRequest) SetTemperature(val OptNilFloat64)

SetTemperature sets the value of Temperature.

func (*CreateChatCompletionRequest) SetToolChoice

SetToolChoice sets the value of ToolChoice.

func (*CreateChatCompletionRequest) SetTools

SetTools sets the value of Tools.

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 map[string]int

Modify likelihood of specified tokens.

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 CreateChatCompletionRequestMetadata

type CreateChatCompletionRequestMetadata map[string]string

Custom metadata.

func (*CreateChatCompletionRequestMetadata) Decode

Decode decodes CreateChatCompletionRequestMetadata from json.

func (CreateChatCompletionRequestMetadata) Encode

Encode implements json.Marshaler.

func (CreateChatCompletionRequestMetadata) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionRequestMetadata) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateChatCompletionRequestStop

type CreateChatCompletionRequestStop struct {
	// Type selects the active sum variant, switch on this field.
	Type        CreateChatCompletionRequestStopType
	String      string
	StringArray []string
}

Stop sequences. 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 CreateChatCompletionRequestToolChoice

type CreateChatCompletionRequestToolChoice struct {
	// Type selects the active sum variant, switch on this field.
	Type                                   CreateChatCompletionRequestToolChoiceType
	CreateChatCompletionRequestToolChoice0 CreateChatCompletionRequestToolChoice0
	ChatCompletionNamedToolChoice          ChatCompletionNamedToolChoice
}

Controls which tool is called by the model. CreateChatCompletionRequestToolChoice represents sum type.

func NewChatCompletionNamedToolChoiceCreateChatCompletionRequestToolChoice

func NewChatCompletionNamedToolChoiceCreateChatCompletionRequestToolChoice(v ChatCompletionNamedToolChoice) CreateChatCompletionRequestToolChoice

NewChatCompletionNamedToolChoiceCreateChatCompletionRequestToolChoice returns new CreateChatCompletionRequestToolChoice from ChatCompletionNamedToolChoice.

func NewCreateChatCompletionRequestToolChoice0CreateChatCompletionRequestToolChoice

func NewCreateChatCompletionRequestToolChoice0CreateChatCompletionRequestToolChoice(v CreateChatCompletionRequestToolChoice0) CreateChatCompletionRequestToolChoice

NewCreateChatCompletionRequestToolChoice0CreateChatCompletionRequestToolChoice returns new CreateChatCompletionRequestToolChoice from CreateChatCompletionRequestToolChoice0.

func (*CreateChatCompletionRequestToolChoice) Decode

Decode decodes CreateChatCompletionRequestToolChoice from json.

func (CreateChatCompletionRequestToolChoice) Encode

Encode encodes CreateChatCompletionRequestToolChoice as json.

func (CreateChatCompletionRequestToolChoice) GetChatCompletionNamedToolChoice

func (s CreateChatCompletionRequestToolChoice) GetChatCompletionNamedToolChoice() (v ChatCompletionNamedToolChoice, ok bool)

GetChatCompletionNamedToolChoice returns ChatCompletionNamedToolChoice and true boolean if CreateChatCompletionRequestToolChoice is ChatCompletionNamedToolChoice.

func (CreateChatCompletionRequestToolChoice) GetCreateChatCompletionRequestToolChoice0

func (s CreateChatCompletionRequestToolChoice) GetCreateChatCompletionRequestToolChoice0() (v CreateChatCompletionRequestToolChoice0, ok bool)

GetCreateChatCompletionRequestToolChoice0 returns CreateChatCompletionRequestToolChoice0 and true boolean if CreateChatCompletionRequestToolChoice is CreateChatCompletionRequestToolChoice0.

func (CreateChatCompletionRequestToolChoice) IsChatCompletionNamedToolChoice

func (s CreateChatCompletionRequestToolChoice) IsChatCompletionNamedToolChoice() bool

IsChatCompletionNamedToolChoice reports whether CreateChatCompletionRequestToolChoice is ChatCompletionNamedToolChoice.

func (CreateChatCompletionRequestToolChoice) IsCreateChatCompletionRequestToolChoice0

func (s CreateChatCompletionRequestToolChoice) IsCreateChatCompletionRequestToolChoice0() bool

IsCreateChatCompletionRequestToolChoice0 reports whether CreateChatCompletionRequestToolChoice is CreateChatCompletionRequestToolChoice0.

func (CreateChatCompletionRequestToolChoice) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionRequestToolChoice) SetChatCompletionNamedToolChoice

func (s *CreateChatCompletionRequestToolChoice) SetChatCompletionNamedToolChoice(v ChatCompletionNamedToolChoice)

SetChatCompletionNamedToolChoice sets CreateChatCompletionRequestToolChoice to ChatCompletionNamedToolChoice.

func (*CreateChatCompletionRequestToolChoice) SetCreateChatCompletionRequestToolChoice0

func (s *CreateChatCompletionRequestToolChoice) SetCreateChatCompletionRequestToolChoice0(v CreateChatCompletionRequestToolChoice0)

SetCreateChatCompletionRequestToolChoice0 sets CreateChatCompletionRequestToolChoice to CreateChatCompletionRequestToolChoice0.

func (*CreateChatCompletionRequestToolChoice) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (CreateChatCompletionRequestToolChoice) Validate

type CreateChatCompletionRequestToolChoice0

type CreateChatCompletionRequestToolChoice0 string
const (
	CreateChatCompletionRequestToolChoice0None     CreateChatCompletionRequestToolChoice0 = "none"
	CreateChatCompletionRequestToolChoice0Auto     CreateChatCompletionRequestToolChoice0 = "auto"
	CreateChatCompletionRequestToolChoice0Required CreateChatCompletionRequestToolChoice0 = "required"
)

func (CreateChatCompletionRequestToolChoice0) AllValues

AllValues returns all CreateChatCompletionRequestToolChoice0 values.

func (*CreateChatCompletionRequestToolChoice0) Decode

Decode decodes CreateChatCompletionRequestToolChoice0 from json.

func (CreateChatCompletionRequestToolChoice0) Encode

Encode encodes CreateChatCompletionRequestToolChoice0 as json.

func (CreateChatCompletionRequestToolChoice0) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CreateChatCompletionRequestToolChoice0) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CreateChatCompletionRequestToolChoice0) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateChatCompletionRequestToolChoice0) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateChatCompletionRequestToolChoice0) Validate

type CreateChatCompletionRequestToolChoiceType

type CreateChatCompletionRequestToolChoiceType string

CreateChatCompletionRequestToolChoiceType is oneOf type of CreateChatCompletionRequestToolChoice.

const (
	CreateChatCompletionRequestToolChoice0CreateChatCompletionRequestToolChoice CreateChatCompletionRequestToolChoiceType = "CreateChatCompletionRequestToolChoice0"
	ChatCompletionNamedToolChoiceCreateChatCompletionRequestToolChoice          CreateChatCompletionRequestToolChoiceType = "ChatCompletionNamedToolChoice"
)

Possible values for CreateChatCompletionRequestToolChoiceType.

type CreateChatCompletionRes

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

type CreateChatCompletionResponse

type CreateChatCompletionResponse struct {
	// Unique identifier for the completion.
	ID     string                             `json:"id"`
	Object CreateChatCompletionResponseObject `json:"object"`
	// Unix timestamp of when the completion was created.
	Created int `json:"created"`
	// The model used for completion.
	Model   string                 `json:"model"`
	Choices []ChatCompletionChoice `json:"choices"`
	Usage   OptCompletionUsage     `json:"usage"`
	// Backend configuration fingerprint.
	SystemFingerprint OptString `json:"system_fingerprint"`
	// The service tier used.
	ServiceTier OptNilString `json:"service_tier"`
}

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

GetObject returns the value of Object.

func (*CreateChatCompletionResponse) GetServiceTier

func (s *CreateChatCompletionResponse) GetServiceTier() OptNilString

GetServiceTier returns the value of ServiceTier.

func (*CreateChatCompletionResponse) GetSystemFingerprint

func (s *CreateChatCompletionResponse) GetSystemFingerprint() OptString

GetSystemFingerprint returns the value of SystemFingerprint.

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

SetObject sets the value of Object.

func (*CreateChatCompletionResponse) SetServiceTier

func (s *CreateChatCompletionResponse) SetServiceTier(val OptNilString)

SetServiceTier sets the value of ServiceTier.

func (*CreateChatCompletionResponse) SetSystemFingerprint

func (s *CreateChatCompletionResponse) SetSystemFingerprint(val OptString)

SetSystemFingerprint sets the value of SystemFingerprint.

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 CreateChatCompletionResponseObject

type CreateChatCompletionResponseObject string
const (
	CreateChatCompletionResponseObjectChatCompletion CreateChatCompletionResponseObject = "chat.completion"
)

func (CreateChatCompletionResponseObject) AllValues

AllValues returns all CreateChatCompletionResponseObject values.

func (*CreateChatCompletionResponseObject) Decode

Decode decodes CreateChatCompletionResponseObject from json.

func (CreateChatCompletionResponseObject) Encode

Encode encodes CreateChatCompletionResponseObject as json.

func (CreateChatCompletionResponseObject) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CreateChatCompletionResponseObject) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CreateChatCompletionResponseObject) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateChatCompletionResponseObject) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateChatCompletionResponseObject) Validate

type CreateChatCompletionUnauthorized

type CreateChatCompletionUnauthorized ErrorResponse

func (*CreateChatCompletionUnauthorized) Decode

Decode decodes CreateChatCompletionUnauthorized from json.

func (*CreateChatCompletionUnauthorized) Encode

Encode encodes CreateChatCompletionUnauthorized as json.

func (*CreateChatCompletionUnauthorized) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateChatCompletionUnauthorized) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorResponse

type ErrorResponse struct {
	Error ErrorResponseError `json:"error"`
}

Ref: #/components/schemas/ErrorResponse

func (*ErrorResponse) Decode

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

Decode decodes ErrorResponse from json.

func (*ErrorResponse) Encode

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

Encode implements json.Marshaler.

func (*ErrorResponse) GetError

func (s *ErrorResponse) GetError() ErrorResponseError

GetError returns the value of Error.

func (*ErrorResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ErrorResponse) SetError

func (s *ErrorResponse) SetError(val ErrorResponseError)

SetError sets the value of Error.

func (*ErrorResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorResponseError

type ErrorResponseError struct {
	// Human-readable error message.
	Message string `json:"message"`
	// Error type.
	Type string `json:"type"`
	// The parameter that caused the error.
	Param OptNilString `json:"param"`
	// Error code.
	Code OptNilString `json:"code"`
}

func (*ErrorResponseError) Decode

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

Decode decodes ErrorResponseError from json.

func (*ErrorResponseError) Encode

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

Encode implements json.Marshaler.

func (*ErrorResponseError) GetCode

func (s *ErrorResponseError) GetCode() OptNilString

GetCode returns the value of Code.

func (*ErrorResponseError) GetMessage

func (s *ErrorResponseError) GetMessage() string

GetMessage returns the value of Message.

func (*ErrorResponseError) GetParam

func (s *ErrorResponseError) GetParam() OptNilString

GetParam returns the value of Param.

func (*ErrorResponseError) GetType

func (s *ErrorResponseError) GetType() string

GetType returns the value of Type.

func (*ErrorResponseError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ErrorResponseError) SetCode

func (s *ErrorResponseError) SetCode(val OptNilString)

SetCode sets the value of Code.

func (*ErrorResponseError) SetMessage

func (s *ErrorResponseError) SetMessage(val string)

SetMessage sets the value of Message.

func (*ErrorResponseError) SetParam

func (s *ErrorResponseError) SetParam(val OptNilString)

SetParam sets the value of Param.

func (*ErrorResponseError) SetType

func (s *ErrorResponseError) SetType(val string)

SetType sets the value of Type.

func (*ErrorResponseError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type FunctionObject

type FunctionObject struct {
	// The name of the function.
	Name string `json:"name"`
	// Description of what the function does.
	Description OptString `json:"description"`
	// JSON Schema for the function parameters.
	Parameters *FunctionObjectParameters `json:"parameters"`
	// Whether to enable strict schema adherence.
	Strict OptNilBool `json:"strict"`
}

Ref: #/components/schemas/FunctionObject

func (*FunctionObject) Decode

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

Decode decodes FunctionObject from json.

func (*FunctionObject) Encode

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

Encode implements json.Marshaler.

func (*FunctionObject) GetDescription

func (s *FunctionObject) GetDescription() OptString

GetDescription returns the value of Description.

func (*FunctionObject) GetName

func (s *FunctionObject) GetName() string

GetName returns the value of Name.

func (*FunctionObject) GetParameters

func (s *FunctionObject) GetParameters() *FunctionObjectParameters

GetParameters returns the value of Parameters.

func (*FunctionObject) GetStrict

func (s *FunctionObject) GetStrict() OptNilBool

GetStrict returns the value of Strict.

func (*FunctionObject) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*FunctionObject) SetDescription

func (s *FunctionObject) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*FunctionObject) SetName

func (s *FunctionObject) SetName(val string)

SetName sets the value of Name.

func (*FunctionObject) SetParameters

func (s *FunctionObject) SetParameters(val *FunctionObjectParameters)

SetParameters sets the value of Parameters.

func (*FunctionObject) SetStrict

func (s *FunctionObject) SetStrict(val OptNilBool)

SetStrict sets the value of Strict.

func (*FunctionObject) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type FunctionObjectParameters

type FunctionObjectParameters struct{}

JSON Schema for the function parameters.

func (*FunctionObjectParameters) Decode

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

Decode decodes FunctionObjectParameters from json.

func (*FunctionObjectParameters) Encode

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

Encode implements json.Marshaler.

func (*FunctionObjectParameters) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*FunctionObjectParameters) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Handler

type Handler interface {
	// CreateChatCompletion implements createChatCompletion operation.
	//
	// Creates a model response for the given chat conversation.
	//
	// POST /chat/completions
	CreateChatCompletion(ctx context.Context, req *CreateChatCompletionRequest) (CreateChatCompletionRes, error)
	// ListModels implements listModels operation.
	//
	// Lists the currently available models.
	//
	// GET /models
	ListModels(ctx context.Context) (*ListModelsResponse, error)
	// RetrieveModel implements retrieveModel operation.
	//
	// Retrieves a model instance.
	//
	// GET /models/{model}
	RetrieveModel(ctx context.Context, params RetrieveModelParams) (RetrieveModelRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// CreateChatCompletion invokes createChatCompletion operation.
	//
	// Creates a model response for the given chat conversation.
	//
	// POST /chat/completions
	CreateChatCompletion(ctx context.Context, request *CreateChatCompletionRequest) (CreateChatCompletionRes, error)
	// ListModels invokes listModels operation.
	//
	// Lists the currently available models.
	//
	// GET /models
	ListModels(ctx context.Context) (*ListModelsResponse, error)
	// RetrieveModel invokes retrieveModel operation.
	//
	// Retrieves a model instance.
	//
	// GET /models/{model}
	RetrieveModel(ctx context.Context, params RetrieveModelParams) (RetrieveModelRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type ListModelsResponse

type ListModelsResponse struct {
	Object ListModelsResponseObject `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

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

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 ListModelsResponseObject

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

func (ListModelsResponseObject) AllValues

AllValues returns all ListModelsResponseObject values.

func (*ListModelsResponseObject) Decode

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

Decode decodes ListModelsResponseObject from json.

func (ListModelsResponseObject) Encode

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

Encode encodes ListModelsResponseObject as json.

func (ListModelsResponseObject) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ListModelsResponseObject) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ListModelsResponseObject) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListModelsResponseObject) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ListModelsResponseObject) Validate

func (s ListModelsResponseObject) Validate() error

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type Model

type Model struct {
	// The model identifier.
	ID     string      `json:"id"`
	Object ModelObject `json:"object"`
	// Unix timestamp when the model was created.
	Created int `json:"created"`
	// Organization that owns the model.
	OwnedBy string `json:"owned_by"`
}

Ref: #/components/schemas/Model

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 implements json.Marshaler.

func (*Model) GetCreated

func (s *Model) GetCreated() int

GetCreated returns the value of Created.

func (*Model) GetID

func (s *Model) GetID() string

GetID returns the value of ID.

func (*Model) GetObject

func (s *Model) GetObject() ModelObject

GetObject returns the value of Object.

func (*Model) GetOwnedBy

func (s *Model) GetOwnedBy() string

GetOwnedBy returns the value of OwnedBy.

func (*Model) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Model) SetCreated

func (s *Model) SetCreated(val int)

SetCreated sets the value of Created.

func (*Model) SetID

func (s *Model) SetID(val string)

SetID sets the value of ID.

func (*Model) SetObject

func (s *Model) SetObject(val ModelObject)

SetObject sets the value of Object.

func (*Model) SetOwnedBy

func (s *Model) SetOwnedBy(val string)

SetOwnedBy sets the value of OwnedBy.

func (*Model) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Model) Validate

func (s *Model) Validate() error

type ModelObject

type ModelObject string
const (
	ModelObjectModel ModelObject = "model"
)

func (ModelObject) AllValues

func (ModelObject) AllValues() []ModelObject

AllValues returns all ModelObject values.

func (*ModelObject) Decode

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

Decode decodes ModelObject from json.

func (ModelObject) Encode

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

Encode encodes ModelObject as json.

func (ModelObject) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ModelObject) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ModelObject) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ModelObject) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ModelObject) Validate

func (s ModelObject) Validate() error

type NilChatCompletionChoiceFinishReason

type NilChatCompletionChoiceFinishReason struct {
	Value ChatCompletionChoiceFinishReason
	Null  bool
}

NilChatCompletionChoiceFinishReason is nullable ChatCompletionChoiceFinishReason.

func NewNilChatCompletionChoiceFinishReason

func NewNilChatCompletionChoiceFinishReason(v ChatCompletionChoiceFinishReason) NilChatCompletionChoiceFinishReason

NewNilChatCompletionChoiceFinishReason returns new NilChatCompletionChoiceFinishReason with value set to v.

func (*NilChatCompletionChoiceFinishReason) Decode

Decode decodes ChatCompletionChoiceFinishReason from json.

func (NilChatCompletionChoiceFinishReason) Encode

Encode encodes ChatCompletionChoiceFinishReason as json.

func (NilChatCompletionChoiceFinishReason) Get

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

func (NilChatCompletionChoiceFinishReason) IsNull

IsNull returns true if value is Null.

func (NilChatCompletionChoiceFinishReason) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (NilChatCompletionChoiceFinishReason) Or

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

func (*NilChatCompletionChoiceFinishReason) SetTo

SetTo sets value to v.

func (*NilChatCompletionChoiceFinishReason) SetToNull

func (o *NilChatCompletionChoiceFinishReason) SetToNull()

SetToNull sets value to null.

func (*NilChatCompletionChoiceFinishReason) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type NilString

type NilString struct {
	Value string
	Null  bool
}

NilString is nullable string.

func NewNilString

func NewNilString(v string) NilString

NewNilString returns new NilString with value set to v.

func (*NilString) Decode

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

Decode decodes string from json.

func (NilString) Encode

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

Encode encodes string as json.

func (NilString) Get

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

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

func (NilString) IsNull

func (o NilString) IsNull() bool

IsNull returns true if value is Null.

func (NilString) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (NilString) Or

func (o NilString) Or(d string) string

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

func (*NilString) SetTo

func (o *NilString) SetTo(v string)

SetTo sets value to v.

func (*NilString) SetToNull

func (o *NilString) SetToNull()

SetToNull sets value to null.

func (*NilString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	CreateChatCompletionOperation OperationName = "CreateChatCompletion"
	ListModelsOperation           OperationName = "ListModels"
	RetrieveModelOperation        OperationName = "RetrieveModel"
)

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

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

Decode decodes bool from json.

func (OptBool) Encode

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

Encode encodes bool as json.

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

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

MarshalJSON implements stdjson.Marshaler.

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.

func (*OptBool) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptChatCompletionContentPartImageURL

type OptChatCompletionContentPartImageURL struct {
	Value ChatCompletionContentPartImageURL
	Set   bool
}

OptChatCompletionContentPartImageURL is optional ChatCompletionContentPartImageURL.

func NewOptChatCompletionContentPartImageURL

func NewOptChatCompletionContentPartImageURL(v ChatCompletionContentPartImageURL) OptChatCompletionContentPartImageURL

NewOptChatCompletionContentPartImageURL returns new OptChatCompletionContentPartImageURL with value set to v.

func (*OptChatCompletionContentPartImageURL) Decode

Decode decodes ChatCompletionContentPartImageURL from json.

func (OptChatCompletionContentPartImageURL) Encode

Encode encodes ChatCompletionContentPartImageURL as json.

func (OptChatCompletionContentPartImageURL) Get

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

func (OptChatCompletionContentPartImageURL) IsSet

IsSet returns true if OptChatCompletionContentPartImageURL was set.

func (OptChatCompletionContentPartImageURL) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptChatCompletionContentPartImageURL) Or

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

func (*OptChatCompletionContentPartImageURL) Reset

Reset unsets value.

func (*OptChatCompletionContentPartImageURL) SetTo

SetTo sets value to v.

func (*OptChatCompletionContentPartImageURL) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptChatCompletionContentPartImageURLDetail

type OptChatCompletionContentPartImageURLDetail struct {
	Value ChatCompletionContentPartImageURLDetail
	Set   bool
}

OptChatCompletionContentPartImageURLDetail is optional ChatCompletionContentPartImageURLDetail.

func NewOptChatCompletionContentPartImageURLDetail

func NewOptChatCompletionContentPartImageURLDetail(v ChatCompletionContentPartImageURLDetail) OptChatCompletionContentPartImageURLDetail

NewOptChatCompletionContentPartImageURLDetail returns new OptChatCompletionContentPartImageURLDetail with value set to v.

func (*OptChatCompletionContentPartImageURLDetail) Decode

Decode decodes ChatCompletionContentPartImageURLDetail from json.

func (OptChatCompletionContentPartImageURLDetail) Encode

Encode encodes ChatCompletionContentPartImageURLDetail as json.

func (OptChatCompletionContentPartImageURLDetail) Get

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

func (OptChatCompletionContentPartImageURLDetail) IsSet

IsSet returns true if OptChatCompletionContentPartImageURLDetail was set.

func (OptChatCompletionContentPartImageURLDetail) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptChatCompletionContentPartImageURLDetail) Or

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

func (*OptChatCompletionContentPartImageURLDetail) Reset

Reset unsets value.

func (*OptChatCompletionContentPartImageURLDetail) SetTo

SetTo sets value to v.

func (*OptChatCompletionContentPartImageURLDetail) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptChatCompletionMessageFunctionCall

type OptChatCompletionMessageFunctionCall struct {
	Value ChatCompletionMessageFunctionCall
	Set   bool
}

OptChatCompletionMessageFunctionCall is optional ChatCompletionMessageFunctionCall.

func NewOptChatCompletionMessageFunctionCall

func NewOptChatCompletionMessageFunctionCall(v ChatCompletionMessageFunctionCall) OptChatCompletionMessageFunctionCall

NewOptChatCompletionMessageFunctionCall returns new OptChatCompletionMessageFunctionCall with value set to v.

func (*OptChatCompletionMessageFunctionCall) Decode

Decode decodes ChatCompletionMessageFunctionCall from json.

func (OptChatCompletionMessageFunctionCall) Encode

Encode encodes ChatCompletionMessageFunctionCall as json.

func (OptChatCompletionMessageFunctionCall) Get

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

func (OptChatCompletionMessageFunctionCall) IsSet

IsSet returns true if OptChatCompletionMessageFunctionCall was set.

func (OptChatCompletionMessageFunctionCall) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptChatCompletionMessageFunctionCall) Or

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

func (*OptChatCompletionMessageFunctionCall) Reset

Reset unsets value.

func (*OptChatCompletionMessageFunctionCall) SetTo

SetTo sets value to v.

func (*OptChatCompletionMessageFunctionCall) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCompletionUsage

type OptCompletionUsage struct {
	Value CompletionUsage
	Set   bool
}

OptCompletionUsage is optional CompletionUsage.

func NewOptCompletionUsage

func NewOptCompletionUsage(v CompletionUsage) OptCompletionUsage

NewOptCompletionUsage returns new OptCompletionUsage with value set to v.

func (*OptCompletionUsage) Decode

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

Decode decodes CompletionUsage from json.

func (OptCompletionUsage) Encode

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

Encode encodes CompletionUsage as json.

func (OptCompletionUsage) Get

func (o OptCompletionUsage) Get() (v CompletionUsage, ok bool)

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

func (OptCompletionUsage) IsSet

func (o OptCompletionUsage) IsSet() bool

IsSet returns true if OptCompletionUsage was set.

func (OptCompletionUsage) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptCompletionUsage) Or

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

func (*OptCompletionUsage) Reset

func (o *OptCompletionUsage) Reset()

Reset unsets value.

func (*OptCompletionUsage) SetTo

func (o *OptCompletionUsage) SetTo(v CompletionUsage)

SetTo sets value to v.

func (*OptCompletionUsage) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCompletionUsageCompletionTokensDetails

type OptCompletionUsageCompletionTokensDetails struct {
	Value CompletionUsageCompletionTokensDetails
	Set   bool
}

OptCompletionUsageCompletionTokensDetails is optional CompletionUsageCompletionTokensDetails.

func NewOptCompletionUsageCompletionTokensDetails

func NewOptCompletionUsageCompletionTokensDetails(v CompletionUsageCompletionTokensDetails) OptCompletionUsageCompletionTokensDetails

NewOptCompletionUsageCompletionTokensDetails returns new OptCompletionUsageCompletionTokensDetails with value set to v.

func (*OptCompletionUsageCompletionTokensDetails) Decode

Decode decodes CompletionUsageCompletionTokensDetails from json.

func (OptCompletionUsageCompletionTokensDetails) Encode

Encode encodes CompletionUsageCompletionTokensDetails as json.

func (OptCompletionUsageCompletionTokensDetails) Get

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

func (OptCompletionUsageCompletionTokensDetails) IsSet

IsSet returns true if OptCompletionUsageCompletionTokensDetails was set.

func (OptCompletionUsageCompletionTokensDetails) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptCompletionUsageCompletionTokensDetails) Or

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

func (*OptCompletionUsageCompletionTokensDetails) Reset

Reset unsets value.

func (*OptCompletionUsageCompletionTokensDetails) SetTo

SetTo sets value to v.

func (*OptCompletionUsageCompletionTokensDetails) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCompletionUsagePromptTokensDetails

type OptCompletionUsagePromptTokensDetails struct {
	Value CompletionUsagePromptTokensDetails
	Set   bool
}

OptCompletionUsagePromptTokensDetails is optional CompletionUsagePromptTokensDetails.

func NewOptCompletionUsagePromptTokensDetails

func NewOptCompletionUsagePromptTokensDetails(v CompletionUsagePromptTokensDetails) OptCompletionUsagePromptTokensDetails

NewOptCompletionUsagePromptTokensDetails returns new OptCompletionUsagePromptTokensDetails with value set to v.

func (*OptCompletionUsagePromptTokensDetails) Decode

Decode decodes CompletionUsagePromptTokensDetails from json.

func (OptCompletionUsagePromptTokensDetails) Encode

Encode encodes CompletionUsagePromptTokensDetails as json.

func (OptCompletionUsagePromptTokensDetails) Get

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

func (OptCompletionUsagePromptTokensDetails) IsSet

IsSet returns true if OptCompletionUsagePromptTokensDetails was set.

func (OptCompletionUsagePromptTokensDetails) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptCompletionUsagePromptTokensDetails) Or

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

func (*OptCompletionUsagePromptTokensDetails) Reset

Reset unsets value.

func (*OptCompletionUsagePromptTokensDetails) SetTo

SetTo sets value to v.

func (*OptCompletionUsagePromptTokensDetails) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCreateChatCompletionRequestToolChoice

type OptCreateChatCompletionRequestToolChoice struct {
	Value CreateChatCompletionRequestToolChoice
	Set   bool
}

OptCreateChatCompletionRequestToolChoice is optional CreateChatCompletionRequestToolChoice.

func NewOptCreateChatCompletionRequestToolChoice

func NewOptCreateChatCompletionRequestToolChoice(v CreateChatCompletionRequestToolChoice) OptCreateChatCompletionRequestToolChoice

NewOptCreateChatCompletionRequestToolChoice returns new OptCreateChatCompletionRequestToolChoice with value set to v.

func (*OptCreateChatCompletionRequestToolChoice) Decode

Decode decodes CreateChatCompletionRequestToolChoice from json.

func (OptCreateChatCompletionRequestToolChoice) Encode

Encode encodes CreateChatCompletionRequestToolChoice as json.

func (OptCreateChatCompletionRequestToolChoice) Get

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

func (OptCreateChatCompletionRequestToolChoice) IsSet

IsSet returns true if OptCreateChatCompletionRequestToolChoice was set.

func (OptCreateChatCompletionRequestToolChoice) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptCreateChatCompletionRequestToolChoice) Or

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

func (*OptCreateChatCompletionRequestToolChoice) Reset

Reset unsets value.

func (*OptCreateChatCompletionRequestToolChoice) SetTo

SetTo sets value to v.

func (*OptCreateChatCompletionRequestToolChoice) UnmarshalJSON

func (s *OptCreateChatCompletionRequestToolChoice) 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 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) IsEmpty

func (o OptNilBool) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilBool) IsNull

func (o OptNilBool) IsNull() bool

IsNull 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()

SetToNull sets value to null.

func (*OptNilBool) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilChatCompletionLogprobs

type OptNilChatCompletionLogprobs struct {
	Value ChatCompletionLogprobs
	Set   bool
	Null  bool
}

OptNilChatCompletionLogprobs is optional nullable ChatCompletionLogprobs.

func NewOptNilChatCompletionLogprobs

func NewOptNilChatCompletionLogprobs(v ChatCompletionLogprobs) OptNilChatCompletionLogprobs

NewOptNilChatCompletionLogprobs returns new OptNilChatCompletionLogprobs with value set to v.

func (*OptNilChatCompletionLogprobs) Decode

Decode decodes ChatCompletionLogprobs from json.

func (OptNilChatCompletionLogprobs) Encode

Encode encodes ChatCompletionLogprobs as json.

func (OptNilChatCompletionLogprobs) Get

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

func (OptNilChatCompletionLogprobs) IsEmpty

func (o OptNilChatCompletionLogprobs) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilChatCompletionLogprobs) IsNull

IsNull returns true if value is Null.

func (OptNilChatCompletionLogprobs) IsSet

IsSet returns true if OptNilChatCompletionLogprobs was set.

func (OptNilChatCompletionLogprobs) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilChatCompletionLogprobs) Or

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

func (*OptNilChatCompletionLogprobs) Reset

func (o *OptNilChatCompletionLogprobs) Reset()

Reset unsets value.

func (*OptNilChatCompletionLogprobs) SetTo

SetTo sets value to v.

func (*OptNilChatCompletionLogprobs) SetToNull

func (o *OptNilChatCompletionLogprobs) SetToNull()

SetToNull sets value to null.

func (*OptNilChatCompletionLogprobs) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilChatCompletionMessageParamContent

type OptNilChatCompletionMessageParamContent struct {
	Value ChatCompletionMessageParamContent
	Set   bool
	Null  bool
}

OptNilChatCompletionMessageParamContent is optional nullable ChatCompletionMessageParamContent.

func NewOptNilChatCompletionMessageParamContent

func NewOptNilChatCompletionMessageParamContent(v ChatCompletionMessageParamContent) OptNilChatCompletionMessageParamContent

NewOptNilChatCompletionMessageParamContent returns new OptNilChatCompletionMessageParamContent with value set to v.

func (*OptNilChatCompletionMessageParamContent) Decode

Decode decodes ChatCompletionMessageParamContent from json.

func (OptNilChatCompletionMessageParamContent) Encode

Encode encodes ChatCompletionMessageParamContent as json.

func (OptNilChatCompletionMessageParamContent) Get

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

func (OptNilChatCompletionMessageParamContent) IsEmpty

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilChatCompletionMessageParamContent) IsNull

IsNull returns true if value is Null.

func (OptNilChatCompletionMessageParamContent) IsSet

IsSet returns true if OptNilChatCompletionMessageParamContent was set.

func (OptNilChatCompletionMessageParamContent) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilChatCompletionMessageParamContent) Or

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

func (*OptNilChatCompletionMessageParamContent) Reset

Reset unsets value.

func (*OptNilChatCompletionMessageParamContent) SetTo

SetTo sets value to v.

func (*OptNilChatCompletionMessageParamContent) SetToNull

SetToNull sets value to null.

func (*OptNilChatCompletionMessageParamContent) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilChatCompletionStreamOptions

type OptNilChatCompletionStreamOptions struct {
	Value ChatCompletionStreamOptions
	Set   bool
	Null  bool
}

OptNilChatCompletionStreamOptions is optional nullable ChatCompletionStreamOptions.

func NewOptNilChatCompletionStreamOptions

func NewOptNilChatCompletionStreamOptions(v ChatCompletionStreamOptions) OptNilChatCompletionStreamOptions

NewOptNilChatCompletionStreamOptions returns new OptNilChatCompletionStreamOptions with value set to v.

func (*OptNilChatCompletionStreamOptions) Decode

Decode decodes ChatCompletionStreamOptions from json.

func (OptNilChatCompletionStreamOptions) Encode

Encode encodes ChatCompletionStreamOptions as json.

func (OptNilChatCompletionStreamOptions) Get

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

func (OptNilChatCompletionStreamOptions) IsEmpty

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilChatCompletionStreamOptions) IsNull

IsNull returns true if value is Null.

func (OptNilChatCompletionStreamOptions) IsSet

IsSet returns true if OptNilChatCompletionStreamOptions was set.

func (OptNilChatCompletionStreamOptions) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilChatCompletionStreamOptions) Or

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

func (*OptNilChatCompletionStreamOptions) Reset

Reset unsets value.

func (*OptNilChatCompletionStreamOptions) SetTo

SetTo sets value to v.

func (*OptNilChatCompletionStreamOptions) SetToNull

func (o *OptNilChatCompletionStreamOptions) SetToNull()

SetToNull sets value to null.

func (*OptNilChatCompletionStreamOptions) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilChatCompletionTokenLogprobArray

type OptNilChatCompletionTokenLogprobArray struct {
	Value []ChatCompletionTokenLogprob
	Set   bool
	Null  bool
}

OptNilChatCompletionTokenLogprobArray is optional nullable []ChatCompletionTokenLogprob.

func NewOptNilChatCompletionTokenLogprobArray

func NewOptNilChatCompletionTokenLogprobArray(v []ChatCompletionTokenLogprob) OptNilChatCompletionTokenLogprobArray

NewOptNilChatCompletionTokenLogprobArray returns new OptNilChatCompletionTokenLogprobArray with value set to v.

func (*OptNilChatCompletionTokenLogprobArray) Decode

Decode decodes []ChatCompletionTokenLogprob from json.

func (OptNilChatCompletionTokenLogprobArray) Encode

Encode encodes []ChatCompletionTokenLogprob as json.

func (OptNilChatCompletionTokenLogprobArray) Get

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

func (OptNilChatCompletionTokenLogprobArray) IsEmpty

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilChatCompletionTokenLogprobArray) IsNull

IsNull returns true if value is Null.

func (OptNilChatCompletionTokenLogprobArray) IsSet

IsSet returns true if OptNilChatCompletionTokenLogprobArray was set.

func (OptNilChatCompletionTokenLogprobArray) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptNilChatCompletionTokenLogprobArray) Or

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

func (*OptNilChatCompletionTokenLogprobArray) Reset

Reset unsets value.

func (*OptNilChatCompletionTokenLogprobArray) SetTo

SetTo sets value to v.

func (*OptNilChatCompletionTokenLogprobArray) SetToNull

SetToNull sets value to null.

func (*OptNilChatCompletionTokenLogprobArray) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateChatCompletionRequestLogitBias

type OptNilCreateChatCompletionRequestLogitBias struct {
	Value CreateChatCompletionRequestLogitBias
	Set   bool
	Null  bool
}

OptNilCreateChatCompletionRequestLogitBias is optional nullable CreateChatCompletionRequestLogitBias.

func NewOptNilCreateChatCompletionRequestLogitBias

func NewOptNilCreateChatCompletionRequestLogitBias(v CreateChatCompletionRequestLogitBias) OptNilCreateChatCompletionRequestLogitBias

NewOptNilCreateChatCompletionRequestLogitBias returns new OptNilCreateChatCompletionRequestLogitBias with value set to v.

func (*OptNilCreateChatCompletionRequestLogitBias) Decode

Decode decodes CreateChatCompletionRequestLogitBias from json.

func (OptNilCreateChatCompletionRequestLogitBias) Encode

Encode encodes CreateChatCompletionRequestLogitBias as json.

func (OptNilCreateChatCompletionRequestLogitBias) Get

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

func (OptNilCreateChatCompletionRequestLogitBias) IsEmpty

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilCreateChatCompletionRequestLogitBias) IsNull

IsNull returns true if value is Null.

func (OptNilCreateChatCompletionRequestLogitBias) IsSet

IsSet returns true if OptNilCreateChatCompletionRequestLogitBias was set.

func (OptNilCreateChatCompletionRequestLogitBias) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateChatCompletionRequestLogitBias) Or

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

func (*OptNilCreateChatCompletionRequestLogitBias) Reset

Reset unsets value.

func (*OptNilCreateChatCompletionRequestLogitBias) SetTo

SetTo sets value to v.

func (*OptNilCreateChatCompletionRequestLogitBias) SetToNull

SetToNull sets value to null.

func (*OptNilCreateChatCompletionRequestLogitBias) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilCreateChatCompletionRequestMetadata

type OptNilCreateChatCompletionRequestMetadata struct {
	Value CreateChatCompletionRequestMetadata
	Set   bool
	Null  bool
}

OptNilCreateChatCompletionRequestMetadata is optional nullable CreateChatCompletionRequestMetadata.

func NewOptNilCreateChatCompletionRequestMetadata

func NewOptNilCreateChatCompletionRequestMetadata(v CreateChatCompletionRequestMetadata) OptNilCreateChatCompletionRequestMetadata

NewOptNilCreateChatCompletionRequestMetadata returns new OptNilCreateChatCompletionRequestMetadata with value set to v.

func (*OptNilCreateChatCompletionRequestMetadata) Decode

Decode decodes CreateChatCompletionRequestMetadata from json.

func (OptNilCreateChatCompletionRequestMetadata) Encode

Encode encodes CreateChatCompletionRequestMetadata as json.

func (OptNilCreateChatCompletionRequestMetadata) Get

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

func (OptNilCreateChatCompletionRequestMetadata) IsEmpty

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilCreateChatCompletionRequestMetadata) IsNull

IsNull returns true if value is Null.

func (OptNilCreateChatCompletionRequestMetadata) IsSet

IsSet returns true if OptNilCreateChatCompletionRequestMetadata was set.

func (OptNilCreateChatCompletionRequestMetadata) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (OptNilCreateChatCompletionRequestMetadata) Or

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

func (*OptNilCreateChatCompletionRequestMetadata) Reset

Reset unsets value.

func (*OptNilCreateChatCompletionRequestMetadata) SetTo

SetTo sets value to v.

func (*OptNilCreateChatCompletionRequestMetadata) SetToNull

SetToNull sets value to null.

func (*OptNilCreateChatCompletionRequestMetadata) UnmarshalJSON

func (s *OptNilCreateChatCompletionRequestMetadata) 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) IsEmpty

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilCreateChatCompletionRequestStop) IsNull

IsNull 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

SetToNull sets value to null.

func (*OptNilCreateChatCompletionRequestStop) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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

func (o OptNilFloat64) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilFloat64) IsNull

func (o OptNilFloat64) IsNull() bool

IsNull 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()

SetToNull sets value to null.

func (*OptNilFloat64) UnmarshalJSON

func (s *OptNilFloat64) 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) IsEmpty

func (o OptNilInt) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilInt) IsNull

func (o OptNilInt) IsNull() bool

IsNull 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()

SetToNull 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) IsEmpty

func (o OptNilString) IsEmpty() bool

IsEmpty returns true if the field was omitted from the payload (not Set and not Null).

func (OptNilString) IsNull

func (o OptNilString) IsNull() bool

IsNull 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()

SetToNull sets value to null.

func (*OptNilString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptResponseFormat

type OptResponseFormat struct {
	Value ResponseFormat
	Set   bool
}

OptResponseFormat is optional ResponseFormat.

func NewOptResponseFormat

func NewOptResponseFormat(v ResponseFormat) OptResponseFormat

NewOptResponseFormat returns new OptResponseFormat with value set to v.

func (*OptResponseFormat) Decode

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

Decode decodes ResponseFormat from json.

func (OptResponseFormat) Encode

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

Encode encodes ResponseFormat as json.

func (OptResponseFormat) Get

func (o OptResponseFormat) Get() (v ResponseFormat, ok bool)

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

func (OptResponseFormat) IsSet

func (o OptResponseFormat) IsSet() bool

IsSet returns true if OptResponseFormat was set.

func (OptResponseFormat) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptResponseFormat) Or

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

func (*OptResponseFormat) Reset

func (o *OptResponseFormat) Reset()

Reset unsets value.

func (*OptResponseFormat) SetTo

func (o *OptResponseFormat) SetTo(v ResponseFormat)

SetTo sets value to v.

func (*OptResponseFormat) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptResponseFormatJSONSchema

type OptResponseFormatJSONSchema struct {
	Value ResponseFormatJSONSchema
	Set   bool
}

OptResponseFormatJSONSchema is optional ResponseFormatJSONSchema.

func NewOptResponseFormatJSONSchema

func NewOptResponseFormatJSONSchema(v ResponseFormatJSONSchema) OptResponseFormatJSONSchema

NewOptResponseFormatJSONSchema returns new OptResponseFormatJSONSchema with value set to v.

func (*OptResponseFormatJSONSchema) Decode

Decode decodes ResponseFormatJSONSchema from json.

func (OptResponseFormatJSONSchema) Encode

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

Encode encodes ResponseFormatJSONSchema as json.

func (OptResponseFormatJSONSchema) Get

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

func (OptResponseFormatJSONSchema) IsSet

IsSet returns true if OptResponseFormatJSONSchema was set.

func (OptResponseFormatJSONSchema) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptResponseFormatJSONSchema) Or

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

func (*OptResponseFormatJSONSchema) Reset

func (o *OptResponseFormatJSONSchema) Reset()

Reset unsets value.

func (*OptResponseFormatJSONSchema) SetTo

SetTo sets value to v.

func (*OptResponseFormatJSONSchema) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptResponseFormatType

type OptResponseFormatType struct {
	Value ResponseFormatType
	Set   bool
}

OptResponseFormatType is optional ResponseFormatType.

func NewOptResponseFormatType

func NewOptResponseFormatType(v ResponseFormatType) OptResponseFormatType

NewOptResponseFormatType returns new OptResponseFormatType with value set to v.

func (*OptResponseFormatType) Decode

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

Decode decodes ResponseFormatType from json.

func (OptResponseFormatType) Encode

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

Encode encodes ResponseFormatType as json.

func (OptResponseFormatType) Get

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

func (OptResponseFormatType) IsSet

func (o OptResponseFormatType) IsSet() bool

IsSet returns true if OptResponseFormatType was set.

func (OptResponseFormatType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptResponseFormatType) Or

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

func (*OptResponseFormatType) Reset

func (o *OptResponseFormatType) Reset()

Reset unsets value.

func (*OptResponseFormatType) SetTo

SetTo sets value to v.

func (*OptResponseFormatType) UnmarshalJSON

func (s *OptResponseFormatType) 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 WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

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 ResponseFormat

type ResponseFormat struct {
	Type       OptResponseFormatType       `json:"type"`
	JSONSchema OptResponseFormatJSONSchema `json:"json_schema"`
}

Ref: #/components/schemas/ResponseFormat

func (*ResponseFormat) Decode

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

Decode decodes ResponseFormat from json.

func (*ResponseFormat) Encode

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

Encode implements json.Marshaler.

func (*ResponseFormat) GetJSONSchema

func (s *ResponseFormat) GetJSONSchema() OptResponseFormatJSONSchema

GetJSONSchema returns the value of JSONSchema.

func (*ResponseFormat) GetType

GetType returns the value of Type.

func (*ResponseFormat) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ResponseFormat) SetJSONSchema

func (s *ResponseFormat) SetJSONSchema(val OptResponseFormatJSONSchema)

SetJSONSchema sets the value of JSONSchema.

func (*ResponseFormat) SetType

func (s *ResponseFormat) SetType(val OptResponseFormatType)

SetType sets the value of Type.

func (*ResponseFormat) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ResponseFormat) Validate

func (s *ResponseFormat) Validate() error

type ResponseFormatJSONSchema

type ResponseFormatJSONSchema struct {
	Name        OptString                       `json:"name"`
	Description OptString                       `json:"description"`
	Schema      *ResponseFormatJSONSchemaSchema `json:"schema"`
	Strict      OptBool                         `json:"strict"`
}

func (*ResponseFormatJSONSchema) Decode

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

Decode decodes ResponseFormatJSONSchema from json.

func (*ResponseFormatJSONSchema) Encode

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

Encode implements json.Marshaler.

func (*ResponseFormatJSONSchema) GetDescription

func (s *ResponseFormatJSONSchema) GetDescription() OptString

GetDescription returns the value of Description.

func (*ResponseFormatJSONSchema) GetName

func (s *ResponseFormatJSONSchema) GetName() OptString

GetName returns the value of Name.

func (*ResponseFormatJSONSchema) GetSchema

GetSchema returns the value of Schema.

func (*ResponseFormatJSONSchema) GetStrict

func (s *ResponseFormatJSONSchema) GetStrict() OptBool

GetStrict returns the value of Strict.

func (*ResponseFormatJSONSchema) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ResponseFormatJSONSchema) SetDescription

func (s *ResponseFormatJSONSchema) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*ResponseFormatJSONSchema) SetName

func (s *ResponseFormatJSONSchema) SetName(val OptString)

SetName sets the value of Name.

func (*ResponseFormatJSONSchema) SetSchema

SetSchema sets the value of Schema.

func (*ResponseFormatJSONSchema) SetStrict

func (s *ResponseFormatJSONSchema) SetStrict(val OptBool)

SetStrict sets the value of Strict.

func (*ResponseFormatJSONSchema) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ResponseFormatJSONSchemaSchema

type ResponseFormatJSONSchemaSchema struct{}

func (*ResponseFormatJSONSchemaSchema) Decode

Decode decodes ResponseFormatJSONSchemaSchema from json.

func (*ResponseFormatJSONSchemaSchema) Encode

Encode implements json.Marshaler.

func (*ResponseFormatJSONSchemaSchema) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ResponseFormatJSONSchemaSchema) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ResponseFormatType

type ResponseFormatType string
const (
	ResponseFormatTypeText       ResponseFormatType = "text"
	ResponseFormatTypeJSONObject ResponseFormatType = "json_object"
	ResponseFormatTypeJSONSchema ResponseFormatType = "json_schema"
)

func (ResponseFormatType) AllValues

func (ResponseFormatType) AllValues() []ResponseFormatType

AllValues returns all ResponseFormatType values.

func (*ResponseFormatType) Decode

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

Decode decodes ResponseFormatType from json.

func (ResponseFormatType) Encode

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

Encode encodes ResponseFormatType as json.

func (ResponseFormatType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ResponseFormatType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ResponseFormatType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ResponseFormatType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ResponseFormatType) Validate

func (s ResponseFormatType) Validate() error

type RetrieveModelParams

type RetrieveModelParams struct {
	// The ID of the model to retrieve.
	Model string
}

RetrieveModelParams is parameters of retrieveModel operation.

type RetrieveModelRes

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

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

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

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 SecurityHandler

type SecurityHandler interface {
	// HandleBearerAuth handles BearerAuth security.
	HandleBearerAuth(ctx context.Context, operationName OperationName, t BearerAuth) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// BearerAuth provides BearerAuth security value.
	BearerAuth(ctx context.Context, operationName OperationName) (BearerAuth, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

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, sec SecurityHandler, 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) CreateChatCompletion

CreateChatCompletion implements createChatCompletion operation.

Creates a model response for the given chat conversation.

POST /chat/completions

func (UnimplementedHandler) ListModels

ListModels implements listModels operation.

Lists the currently available models.

GET /models

func (UnimplementedHandler) RetrieveModel

RetrieveModel implements retrieveModel operation.

Retrieves a model instance.

GET /models/{model}

Jump to

Keyboard shortcuts

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