aigc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Completion

type Completion struct {
	Header string `json:"header,omitempty" yaml:"header,omitempty"`
	Model  string `json:"model,omitempty" yaml:"model,omitempty"`
}

type HiAscend

type HiAscend HistoryItems

func (HiAscend) Len

func (a HiAscend) Len() int

func (HiAscend) Less

func (a HiAscend) Less(i, j int) bool

func (HiAscend) Swap

func (a HiAscend) Swap(i, j int)

type HiLogged

type HiLogged HistoryItems

HiLogged 是 HistoryItems 的自定义类型,用于日志输出

func (HiLogged) String

func (z HiLogged) String() string

String 返回每个记录的前30个字的文本,用于日志记录

type HistoryChatItem

type HistoryChatItem struct {
	User      string `json:"u"`
	Assistant string `json:"a"`
}

type HistoryItem

type HistoryItem struct {
	Time int64 `json:"ts"`

	UID string `json:"uid,omitempty"`

	// chat
	ChatItem *HistoryChatItem `json:"ci"`
}

func (*HistoryItem) MarshalBinary

func (z *HistoryItem) MarshalBinary() (data []byte, err error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (*HistoryItem) UnmarshalBinary

func (z *HistoryItem) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshal a binary representation of itself. for redis result.Scan

type HistoryItems

type HistoryItems []HistoryItem

func (HistoryItems) MarshalBinary

func (z HistoryItems) MarshalBinary() (data []byte, err error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (HistoryItems) RecentlyWithTokens

func (z HistoryItems) RecentlyWithTokens(size int) (ohi HistoryItems)

func (HistoryItems) ToText

func (z HistoryItems) ToText() string

ToText 将历史记录转换为纯文本格式

func (*HistoryItems) UnmarshalBinary

func (z *HistoryItems) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshal a binary representation of itself. for redis result.Scan

type MCPServer

type MCPServer struct {
	Code string  `json:"code" yaml:"code"`
	Name string  `json:"name" yaml:"name"`
	Type MCPType `json:"type" yaml:"type"`
	URL  string  `json:"url" yaml:"url"`
}

MCPServer is a MCP server

type MCPType

type MCPType string // 'sse' | 'stdio' | 'inmemory' | 'http'
const (
	MtSSE      MCPType = "sse"
	MtStdIO    MCPType = "stdio"
	MtInMemory MCPType = "inmemory"
	MtHTTP     MCPType = "http"
)

type Message

type Message struct {
	Role    string `json:"role,omitempty" yaml:"role,omitempty"`
	Content string `json:"content" yaml:"content"`
	ID      string `json:"id,omitempty" yaml:"id,omitempty"`
}

type Messages

type Messages []Message

type Preset

type Preset struct {
	Completion   *Completion `json:"completion,omitempty" yaml:"completion,omitempty"`
	Welcome      *Message    `json:"welcome,omitempty" yaml:"welcome,omitempty"`
	MaxTokens    int         `json:"maxTokens,omitempty" yaml:"maxTokens,omitempty"`
	Temperature  float32     `json:"temperature,omitempty" yaml:"temperature,omitempty"`
	Stop         []string    `json:"stop,omitempty" yaml:"stop,omitempty"`
	SystemPrompt string      `json:"systemPrompt,omitempty" yaml:"systemPrompt,omitempty"`
	ToolsPrompt  string      `json:"toolsPrompt,omitempty" yaml:"toolsPrompt,omitempty"`
	MCPServers   []MCPServer `json:"mcps,omitempty" yaml:"mcps,omitempty"`
}

Jump to

Keyboard shortcuts

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