adaptor

package
v0.0.0-...-d3d3e8a Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequest

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

func DoRequestHelper

func DoRequestHelper(a Adaptor, c *gin.Context, meta *meta.Meta, requestBody io.Reader) (*http.Response, error)

func SetupCommonRequestHeader

func SetupCommonRequestHeader(c *gin.Context, req *http.Request, meta *meta.Meta)

Types

type Adaptor

type Adaptor interface {
	Init(meta *meta.Meta)
	GetRequestURL(meta *meta.Meta) (string, error)
	SetupRequestHeader(c *gin.Context, req *http.Request, meta *meta.Meta) error
	ConvertRequest(c *gin.Context, relayMode int, request *model.GeneralOpenAIRequest) (any, error)
	ConvertImageRequest(request *model.ImageRequest) (any, error)
	DoRequest(c *gin.Context, meta *meta.Meta, requestBody io.Reader) (*http.Response, error)
	DoResponse(c *gin.Context, resp *http.Response, meta *meta.Meta) (usage *model.Usage, err *model.ErrorWithStatusCode)
	GetModelList() []string
	GetChannelName() string
}

Directories

Path Synopsis
aws
claude
Package aws provides the AWS adaptor for the relay service.
Package aws provides the AWS adaptor for the relay service.
llama3
Package aws provides the AWS adaptor for the relay service.
Package aws provides the AWS adaptor for the relay service.

Jump to

Keyboard shortcuts

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