merlin

package
v0.0.0-...-7ee0b9e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HeaderDefault = map[string]string{
		"user-agent":      "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
		"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-Hans;q=0.7",
	}

	ErrUnauth = errors.New("unauth")

	MerlinName = "merlin"
)

Functions

func NewInstControl

func NewInstControl(d time.Duration, ml *Merlin, user []*user) *instCtrl

Types

type Attachment

type Attachment struct {
	Id   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
	Url  string `json:"url"`
}

type Config

type Config struct {
	Authurl string  `yaml:"authurl"`
	Authkey string  `yaml:"authkey"`
	Appurl  string  `yaml:"appurl"`
	Users   []*user `yaml:"users"`
	Debug   bool    `yaml:"debug"`
	Model   model   `yaml:"model,omitempty"`
}

type EventResp

type EventResp struct {
	Status string     `json:"status"`
	Data   *eventData `json:"data"`
}

type Merlin

type Merlin struct {
	// contains filtered or unexported fields
}

func NewMerlinIns

func NewMerlinIns(cfg *Config) *Merlin

func (*Merlin) Name

func (m *Merlin) Name() string

func (*Merlin) Send

func (m *Merlin) Send(prompt string, t pkg.ChatModel) (<-chan *pkg.BackResp, error)

type Mode

type Mode struct {
	Name  pkg.ChatModel
	Model string
}

type TokenResp

type TokenResp struct {
	Status string     `json:"status"`
	Data   *tokenData `json:"data"`
}

type Usage

type Usage struct {
	Used  int    `json:"used"`
	Type  string `json:"type"`
	Limit int    `json:"limit"`
}

type UserData

type UserData struct {
	User *Usage `json:"user"`
}

type UserResp

type UserResp struct {
	Status string    `json:"status"`
	Data   *UserData `json:"data"`
}

Jump to

Keyboard shortcuts

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