shared

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorObject

type ErrorObject struct {
	Code    string          `json:"code,required,nullable"`
	Message string          `json:"message,required"`
	Param   string          `json:"param,required,nullable"`
	Type    string          `json:"type,required"`
	JSON    errorObjectJSON `json:"-"`
}

func (*ErrorObject) UnmarshalJSON

func (r *ErrorObject) UnmarshalJSON(data []byte) (err error)

type FunctionDefinition

type FunctionDefinition struct {
	// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
	// underscores and dashes, with a maximum length of 64.
	Name string `json:"name,required"`
	// A description of what the function does, used by the model to choose when and
	// how to call the function.
	Description string `json:"description"`
	// The parameters the functions accepts, described as a JSON Schema object. See the
	// [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
	// and the
	// [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
	// documentation about the format.
	//
	// Omitting `parameters` defines a function with an empty parameter list.
	Parameters FunctionParameters `json:"parameters"`
	// Whether to enable strict schema adherence when generating the function call. If
	// set to true, the model will follow the exact schema defined in the `parameters`
	// field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn
	// more about Structured Outputs in the
	// [function calling guide](docs/guides/function-calling).
	Strict bool                   `json:"strict,nullable"`
	JSON   functionDefinitionJSON `json:"-"`
}

func (*FunctionDefinition) UnmarshalJSON

func (r *FunctionDefinition) UnmarshalJSON(data []byte) (err error)

type FunctionDefinitionParam

type FunctionDefinitionParam struct {
	// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
	// underscores and dashes, with a maximum length of 64.
	Name param.Field[string] `json:"name,required"`
	// A description of what the function does, used by the model to choose when and
	// how to call the function.
	Description param.Field[string] `json:"description"`
	// The parameters the functions accepts, described as a JSON Schema object. See the
	// [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
	// and the
	// [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
	// documentation about the format.
	//
	// Omitting `parameters` defines a function with an empty parameter list.
	Parameters param.Field[FunctionParameters] `json:"parameters"`
	// Whether to enable strict schema adherence when generating the function call. If
	// set to true, the model will follow the exact schema defined in the `parameters`
	// field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn
	// more about Structured Outputs in the
	// [function calling guide](docs/guides/function-calling).
	Strict param.Field[bool] `json:"strict"`
}

func (FunctionDefinitionParam) MarshalJSON

func (r FunctionDefinitionParam) MarshalJSON() (data []byte, err error)

type FunctionParameters

type FunctionParameters map[string]interface{}

type ResponseFormatJSONObjectParam

type ResponseFormatJSONObjectParam struct {
	// The type of response format being defined: `json_object`
	Type param.Field[ResponseFormatJSONObjectType] `json:"type,required"`
}

func (ResponseFormatJSONObjectParam) ImplementsChatCompletionNewParamsResponseFormatUnion

func (r ResponseFormatJSONObjectParam) ImplementsChatCompletionNewParamsResponseFormatUnion()

func (ResponseFormatJSONObjectParam) MarshalJSON

func (r ResponseFormatJSONObjectParam) MarshalJSON() (data []byte, err error)

type ResponseFormatJSONObjectType

type ResponseFormatJSONObjectType string

The type of response format being defined: `json_object`

const (
	ResponseFormatJSONObjectTypeJSONObject ResponseFormatJSONObjectType = "json_object"
)

func (ResponseFormatJSONObjectType) IsKnown

func (r ResponseFormatJSONObjectType) IsKnown() bool

type ResponseFormatJSONSchemaJSONSchemaParam

type ResponseFormatJSONSchemaJSONSchemaParam struct {
	// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
	// and dashes, with a maximum length of 64.
	Name param.Field[string] `json:"name,required"`
	// A description of what the response format is for, used by the model to determine
	// how to respond in the format.
	Description param.Field[string] `json:"description"`
	// The schema for the response format, described as a JSON Schema object.
	Schema param.Field[map[string]interface{}] `json:"schema"`
	// Whether to enable strict schema adherence when generating the output. If set to
	// true, the model will always follow the exact schema defined in the `schema`
	// field. Only a subset of JSON Schema is supported when `strict` is `true`. To
	// learn more, read the
	// [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
	Strict param.Field[bool] `json:"strict"`
}

func (ResponseFormatJSONSchemaJSONSchemaParam) MarshalJSON

func (r ResponseFormatJSONSchemaJSONSchemaParam) MarshalJSON() (data []byte, err error)

type ResponseFormatJSONSchemaParam

type ResponseFormatJSONSchemaParam struct {
	JSONSchema param.Field[ResponseFormatJSONSchemaJSONSchemaParam] `json:"json_schema,required"`
	// The type of response format being defined: `json_schema`
	Type param.Field[ResponseFormatJSONSchemaType] `json:"type,required"`
}

func (ResponseFormatJSONSchemaParam) ImplementsChatCompletionNewParamsResponseFormatUnion

func (r ResponseFormatJSONSchemaParam) ImplementsChatCompletionNewParamsResponseFormatUnion()

func (ResponseFormatJSONSchemaParam) MarshalJSON

func (r ResponseFormatJSONSchemaParam) MarshalJSON() (data []byte, err error)

type ResponseFormatJSONSchemaType

type ResponseFormatJSONSchemaType string

The type of response format being defined: `json_schema`

const (
	ResponseFormatJSONSchemaTypeJSONSchema ResponseFormatJSONSchemaType = "json_schema"
)

func (ResponseFormatJSONSchemaType) IsKnown

func (r ResponseFormatJSONSchemaType) IsKnown() bool

type ResponseFormatTextParam

type ResponseFormatTextParam struct {
	// The type of response format being defined: `text`
	Type param.Field[ResponseFormatTextType] `json:"type,required"`
}

func (ResponseFormatTextParam) ImplementsChatCompletionNewParamsResponseFormatUnion

func (r ResponseFormatTextParam) ImplementsChatCompletionNewParamsResponseFormatUnion()

func (ResponseFormatTextParam) MarshalJSON

func (r ResponseFormatTextParam) MarshalJSON() (data []byte, err error)

type ResponseFormatTextType

type ResponseFormatTextType string

The type of response format being defined: `text`

const (
	ResponseFormatTextTypeText ResponseFormatTextType = "text"
)

func (ResponseFormatTextType) IsKnown

func (r ResponseFormatTextType) IsKnown() bool

type UnionFloat

type UnionFloat float64

func (UnionFloat) ImplementsFineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion

func (UnionFloat) ImplementsFineTuningJobNewParamsHyperparametersLearningRateMultiplierUnion()

type UnionInt

type UnionInt int64

func (UnionInt) ImplementsFineTuningJobHyperparametersNEpochsUnion

func (UnionInt) ImplementsFineTuningJobHyperparametersNEpochsUnion()

func (UnionInt) ImplementsFineTuningJobNewParamsHyperparametersBatchSizeUnion

func (UnionInt) ImplementsFineTuningJobNewParamsHyperparametersBatchSizeUnion()

func (UnionInt) ImplementsFineTuningJobNewParamsHyperparametersNEpochsUnion

func (UnionInt) ImplementsFineTuningJobNewParamsHyperparametersNEpochsUnion()

type UnionString

type UnionString string

func (UnionString) ImplementsBetaThreadMessageNewParamsContentUnion

func (UnionString) ImplementsBetaThreadMessageNewParamsContentUnion()

func (UnionString) ImplementsBetaThreadNewAndRunParamsThreadMessagesContentUnion

func (UnionString) ImplementsBetaThreadNewAndRunParamsThreadMessagesContentUnion()

func (UnionString) ImplementsBetaThreadNewParamsMessagesContentUnion

func (UnionString) ImplementsBetaThreadNewParamsMessagesContentUnion()

func (UnionString) ImplementsBetaThreadRunNewParamsAdditionalMessagesContentUnion

func (UnionString) ImplementsBetaThreadRunNewParamsAdditionalMessagesContentUnion()

func (UnionString) ImplementsChatCompletionAssistantMessageParamContentUnion

func (UnionString) ImplementsChatCompletionAssistantMessageParamContentUnion()

func (UnionString) ImplementsChatCompletionNewParamsStopUnion

func (UnionString) ImplementsChatCompletionNewParamsStopUnion()

func (UnionString) ImplementsChatCompletionSystemMessageParamContentUnion

func (UnionString) ImplementsChatCompletionSystemMessageParamContentUnion()

func (UnionString) ImplementsChatCompletionToolMessageParamContentUnion

func (UnionString) ImplementsChatCompletionToolMessageParamContentUnion()

func (UnionString) ImplementsChatCompletionUserMessageParamContentUnion

func (UnionString) ImplementsChatCompletionUserMessageParamContentUnion()

func (UnionString) ImplementsCompletionNewParamsPromptUnion

func (UnionString) ImplementsCompletionNewParamsPromptUnion()

func (UnionString) ImplementsCompletionNewParamsStopUnion

func (UnionString) ImplementsCompletionNewParamsStopUnion()

func (UnionString) ImplementsEmbeddingNewParamsInputUnion

func (UnionString) ImplementsEmbeddingNewParamsInputUnion()

func (UnionString) ImplementsModerationNewParamsInputUnion

func (UnionString) ImplementsModerationNewParamsInputUnion()

Jump to

Keyboard shortcuts

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