meta

package
v0.0.0-...-1389cd0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 6 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 {
	Config  model.ChannelConfig
	Name    string
	BaseURL string
	Key     string
	ID      int
	Type    int
}

type Meta

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

	RequestAt       time.Time
	RequestID       string
	OriginModelName string
	ActualModelName string
	Mode            int
	PromptTokens    int
	IsChannelTest   bool
	// contains filtered or unexported fields
}

func NewMeta

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

func (*Meta) AwsClient

func (m *Meta) AwsClient() *bedrockruntime.Client

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