meta

package
v0.0.0-...-09262b5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMappedModelName

func GetMappedModelName(modelName string, mapping map[string]string) (string, bool)

Types

type ChannelMeta

type ChannelMeta struct {
	Name    string
	BaseURL string
	Key     string
	ID      int
	Type    int
}

type Meta

type Meta struct {
	Channel       *ChannelMeta
	ChannelConfig model.ChannelConfig
	Group         *model.GroupCache
	Token         *model.TokenCache
	ModelConfig   *model.ModelConfig

	Endpoint      string
	RequestAt     time.Time
	RequestID     string
	OriginModel   string
	ActualModel   string
	Mode          int
	InputTokens   int
	IsChannelTest bool
	// contains filtered or unexported fields
}

func NewMeta

func NewMeta(
	channel *model.Channel,
	mode int,
	modelName string,
	modelConfig *model.ModelConfig,
	opts ...Option,
) *Meta

func (*Meta) ClearValues

func (m *Meta) ClearValues()

func (*Meta) Delete

func (m *Meta) Delete(key string)

func (*Meta) Get

func (m *Meta) Get(key string) (any, bool)

func (*Meta) GetBool

func (m *Meta) GetBool(key string) bool

func (*Meta) GetString

func (m *Meta) GetString(key string) string

func (*Meta) MustGet

func (m *Meta) MustGet(key string) any

func (*Meta) Reset

func (m *Meta) Reset(channel *model.Channel)

func (*Meta) Set

func (m *Meta) Set(key string, value any)

type Option

type Option func(meta *Meta)

func WithChannelTest

func WithChannelTest(isChannelTest bool) Option

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithGroup

func WithGroup(group *model.GroupCache) Option

func WithRequestAt

func WithRequestAt(requestAt time.Time) Option

func WithRequestID

func WithRequestID(requestID string) Option

func WithToken

func WithToken(token *model.TokenCache) Option

Jump to

Keyboard shortcuts

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