utils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAudioSpeechRequest

func BuildAudioSpeechRequest(model string) (io.Reader, error)

func BuildChatCompletionRequest

func BuildChatCompletionRequest(model string) (io.Reader, error)

func BuildEmbeddingsRequest

func BuildEmbeddingsRequest(model string) (io.Reader, error)

func BuildImagesGenerationsRequest

func BuildImagesGenerationsRequest(modelConfig *model.ModelConfig) (io.Reader, error)

func BuildModerationsRequest

func BuildModerationsRequest(model string) (io.Reader, error)

func BuildRequest

func BuildRequest(modelConfig *model.ModelConfig) (io.Reader, mode.Mode, error)

func BuildRerankRequest

func BuildRerankRequest(model string) (io.Reader, error)

func DoRequest

func DoRequest(req *http.Request) (*http.Response, error)

func IsStreamResponse

func IsStreamResponse(resp *http.Response) bool

func UnmarshalGeneralOpenAIRequest

func UnmarshalGeneralOpenAIRequest(req *http.Request) (*model.GeneralOpenAIRequest, error)

func UnmarshalImageRequest

func UnmarshalImageRequest(req *http.Request) (*model.ImageRequest, error)

func UnmarshalMap

func UnmarshalMap(req *http.Request) (map[string]any, error)

func UnmarshalRerankRequest

func UnmarshalRerankRequest(req *http.Request) (*model.RerankRequest, error)

func UnmarshalTTSRequest

func UnmarshalTTSRequest(req *http.Request) (*model.TextToSpeechRequest, error)

Types

type UnsupportedModelTypeError

type UnsupportedModelTypeError struct {
	ModelType string
}

func NewErrUnsupportedModelType

func NewErrUnsupportedModelType(modelType string) *UnsupportedModelTypeError

func (*UnsupportedModelTypeError) Error

func (e *UnsupportedModelTypeError) Error() string

Jump to

Keyboard shortcuts

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