object

package
v1.798.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScaleStatePublic = "Public"
	ScaleStateHidden = "Hidden"
)

Scale state values for visibility (which scales are included in public lists).

View Source
const (
	UserOwner = "basic"
)

Variables

View Source
var (
	ApiThroughput = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name: "openagent_api_throughput",
		Help: "The throughput of each api access",
	}, []string{"path", "method"})

	ApiLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name: "openagent_api_latency",
		Help: "API processing latency in milliseconds",
	}, []string{"path", "method"})

	CpuUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name: "openagent_cpu_usage",
		Help: "openagent cpu usage",
	}, []string{"cpuNum"})

	MemoryUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name: "openagent_memory_usage",
		Help: "openagent memory usage in Byte",
	}, []string{"type"})

	TotalThroughput = promauto.NewGauge(prometheus.GaugeOpts{
		Name: "openagent_total_throughput",
		Help: "The total throughput of openagent",
	})
)
View Source
var OpenAgentHost = ""

Functions

func AddArticle

func AddArticle(article *Article) (bool, error)

func AddChat

func AddChat(chat *Chat) (bool, error)

func AddFile

func AddFile(file *File) (bool, error)

func AddForm

func AddForm(form *Form) (bool, error)

func AddGraph

func AddGraph(graph *Graph) (bool, error)

func AddMessage

func AddMessage(message *Message) (bool, error)

func AddProvider

func AddProvider(provider *Provider) (bool, error)

func AddRecord

func AddRecord(record *Record, lang string) (bool, interface{}, error)

func AddRecords

func AddRecords(records []*Record, syncEnabled bool, lang string) (bool, interface{}, error)

func AddResource added in v1.782.0

func AddResource(resource *Resource) (bool, error)

func AddScale

func AddScale(scale *Scale) (bool, error)

func AddServer added in v1.788.0

func AddServer(server *Server) (bool, error)

func AddSession

func AddSession(session *Session) (bool, error)

func AddSite added in v1.783.0

func AddSite(site *Site) (bool, error)

func AddSkill added in v1.792.0

func AddSkill(s *Skill) (bool, error)

func AddStore

func AddStore(store *Store) (bool, error)

func AddTask

func AddTask(task *Task) (bool, error)

func AddTool added in v1.783.0

func AddTool(t *Tool) (bool, error)

func AddTransactionForMessage

func AddTransactionForMessage(message *Message) error

AddTransactionForMessage creates a transaction in Casdoor for a message with price, sets the message's TransactionId, and if transaction creation fails, updates the message's ErrorText field in the database and returns an error to the caller.

func AddTreeFile

func AddTreeFile(storeId string, userName string, key string, isLeaf bool, filename string, file multipart.File, lang string) (bool, []byte, error)

func AddUser added in v1.779.0

func AddUser(user *User, password string) (bool, error)

func AddVector

func AddVector(vector *Vector) (bool, error)

func AddVectorsForFile

func AddVectorsForFile(store *Store, fileName string, fileUrl string, lang string) (bool, error)

func AddVideo

func AddVideo(video *Video) (bool, error)

func AddWorkflow

func AddWorkflow(workflow *Workflow, lang string) (bool, error)

func CheckUserPassword added in v1.779.0

func CheckUserPassword(user *User, password string) bool

func ClearThroughputPerSecond

func ClearThroughputPerSecond()

func CommitRecord

func CommitRecord(record *Record, lang string) (bool, map[string]interface{}, error)

func CommitRecordSecond

func CommitRecordSecond(record *Record, lang string) (bool, error)

func CommitRecords

func CommitRecords(records []*Record, lang string) (int, []map[string]interface{})

CommitRecords commits multiple records to the blockchain.

func CreateTables

func CreateTables()

func DeleteAllLaterMessages

func DeleteAllLaterMessages(messageId string) error

func DeleteArticle

func DeleteArticle(article *Article) (bool, error)

func DeleteBeegoSession

func DeleteBeegoSession(sessionIds []string)

func DeleteChat

func DeleteChat(chat *Chat) (bool, error)

func DeleteFile

func DeleteFile(file *File, lang string) (bool, error)

func DeleteForm

func DeleteForm(form *Form) (bool, error)

func DeleteGraph

func DeleteGraph(graph *Graph) (bool, error)

func DeleteMessage

func DeleteMessage(message *Message) (bool, error)

func DeleteMessagesByChat

func DeleteMessagesByChat(message *Message) (bool, error)

func DeleteProvider

func DeleteProvider(provider *Provider) (bool, error)

func DeleteRecord

func DeleteRecord(record *Record) (bool, error)

func DeleteResource added in v1.782.0

func DeleteResource(resource *Resource) (bool, error)

func DeleteResourceFile added in v1.782.0

func DeleteResourceFile(resource *Resource, lang string) error

DeleteResourceFile deletes the actual file from the default storage provider using the stored object key.

func DeleteScale

func DeleteScale(scale *Scale) (bool, error)

func DeleteServer added in v1.788.0

func DeleteServer(server *Server) (bool, error)

func DeleteSession

func DeleteSession(id string) (bool, error)

func DeleteSessionId

func DeleteSessionId(id string, sessionId string) (bool, error)

func DeleteSite added in v1.783.0

func DeleteSite(site *Site) (bool, error)

func DeleteSkill added in v1.792.0

func DeleteSkill(s *Skill) (bool, error)

func DeleteStore

func DeleteStore(store *Store) (bool, error)

func DeleteTask

func DeleteTask(task *Task) (bool, error)

func DeleteTool added in v1.783.0

func DeleteTool(t *Tool) (bool, error)

func DeleteTreeFile

func DeleteTreeFile(storeId string, key string, isLeaf bool, lang string) (bool, error)

func DeleteVector

func DeleteVector(vector *Vector) (bool, error)

func DeleteVectorsByFile

func DeleteVectorsByFile(owner string, storeName string, fileKey string) (bool, error)

func DeleteVectorsByStore

func DeleteVectorsByStore(owner string, storeName string) (bool, error)

func DeleteVideo

func DeleteVideo(video *Video) (bool, error)

func DeleteWorkflow

func DeleteWorkflow(workflow *Workflow) (bool, error)

func GenerateWordCloudData

func GenerateWordCloudData(messages []*Message, density int) (string, error)

func GetAnswer

func GetAnswer(provider string, question string, lang string) (string, *model.ModelResult, error)

func GetAnswerFake

func GetAnswerFake(provider string, question string, lang string) (string, *model.ModelResult, error)

GetAnswerFake returns a hardcoded string without calling the LLM API, for fast local debugging. Switch between GetAnswer and GetAnswerFake by commenting one of the two call sites (e.g. in task_analyze.go). Replace fakeAnswer below with your real API response (multi-line raw string is fine).

func GetAnswerWithContext

func GetAnswerWithContext(provider string, question string, history []*model.RawMessage, knowledge []*model.RawMessage, prompt string, lang string) (string, *model.ModelResult, error)

func GetAnswerWithTool

func GetAnswerWithTool(modelProviderName, toolName, question, lang string) (string, *model.ModelResult, error)

func GetArticleCount

func GetArticleCount(owner, field, value string) (int64, error)

func GetChatCount

func GetChatCount(owner string, field string, value string, store string) (int64, error)

func GetChatCountByStoreNames

func GetChatCountByStoreNames(storeNames []string, field, value string) (int64, error)

func GetChatCountByUser

func GetChatCountByUser(user, store, field, value string) (int64, error)

func GetDbSession

func GetDbSession(owner string, offset, limit int, field, value, sortField, sortOrder string) *xorm.Session

func GetFileCount

func GetFileCount(owner, field, value string) (int64, error)

func GetFormCount

func GetFormCount(owner string, field, value string) (int64, error)

func GetGraphCount

func GetGraphCount(owner string, field, value string) (int64, error)

func GetMessageCount

func GetMessageCount(owner string, field string, value string, store string) (int64, error)

func GetMessageCountByStoreNames

func GetMessageCountByStoreNames(storeNames []string, field, value string) (int64, error)

func GetMessageCountByUser

func GetMessageCountByUser(user, store, field, value string) (int64, error)

func GetModelProviderByProviderKey

func GetModelProviderByProviderKey(providerKey string, lang string) (model.ModelProvider, error)

GetModelProviderByProviderKey retrieves both the provider and its model provider by API key

func GetNearMessageCount

func GetNearMessageCount(user string, limitMinutes int) (int, error)

func GetProviderCount

func GetProviderCount(owner, storeName, field, value string) (int64, error)

func GetRecentRawMessages

func GetRecentRawMessages(chat string, createdTime string, memoryLimit int) ([]*model.RawMessage, error)

func GetRecordCount

func GetRecordCount(owner, field, value string) (int64, error)

func GetRefinedQuestion

func GetRefinedQuestion(prompt string, knowledge string, question string) string

func GetResourceCount added in v1.782.0

func GetResourceCount(owner, field, value string) (int64, error)

func GetRuntimeName added in v1.779.0

func GetRuntimeName(name string) string

func GetScaleCount

func GetScaleCount(owner string, field, value string) (int64, error)

func GetServerCount added in v1.788.0

func GetServerCount(owner, field, value string) (int64, error)

func GetServerMcpToolSet added in v1.788.1

func GetServerMcpToolSet(owner, serverName, lang string) (*mcp.ToolSet, error)

GetServerMcpToolSet loads the named MCP server and returns its tool set.

func GetSessionCount

func GetSessionCount(owner, field, value string) (int64, error)

func GetSkillCount added in v1.792.0

func GetSkillCount(owner, field, value string) (int64, error)

func GetSkillsContent added in v1.792.0

func GetSkillsContent(owner string, skillNames []string) (string, error)

GetSkillsContent loads all named skills for a store and concatenates their content (body of SKILL.md, or custom content) into a single string that is appended to the agent's system prompt.

func GetStoreCount

func GetStoreCount(name, field, value string) (int64, error)

func GetStoreCountByOwner

func GetStoreCountByOwner(owner, field, value string) (int64, error)

func GetTaskCount

func GetTaskCount(owner string, field, value string) (int64, error)

func GetTaskEffectiveScale

func GetTaskEffectiveScale(task *Task) (string, error)

GetTaskEffectiveScale returns rubric text: from referenced Scale.Text when Task.Scale is set.

func GetToolCount added in v1.783.0

func GetToolCount(owner, field, value string) (int64, error)

func GetTwoActiveBlockchainProvider

func GetTwoActiveBlockchainProvider(owner string) (*Provider, *Provider, error)

func GetUsers

func GetUsers(storeName, user string) ([]string, error)

func GetVectorCount

func GetVectorCount(owner string, storeName string, field string, value string) (int64, error)

func GetVectorCountByStoreNames

func GetVectorCountByStoreNames(storeNames []string, field, value string) (int64, error)

func GetVideoCount

func GetVideoCount(owner string, field string, value string) (int64, error)

func GetVisitors added in v1.787.2

func GetVisitors(days int, user string, fieldNames []string, lang string) (map[string][]*Visitor, error)

func GetWorkflowCount

func GetWorkflowCount(owner string, field, value string) (int64, error)

func InitAdapter

func InitAdapter()

func InitCleanupChats

func InitCleanupChats()

func InitCommitRecordsTask

func InitCommitRecordsTask()

func InitConfig

func InitConfig()

func InitDb

func InitDb()

func InitFlag

func InitFlag()

func InitMessageTransactionRetry

func InitMessageTransactionRetry()

func InitStoreCount

func InitStoreCount()

func InitUsers added in v1.779.0

func InitUsers()

func IsAdminUsingDefaultPassword added in v1.779.0

func IsAdminUsingDefaultPassword() bool

func IsSessionDuplicated

func IsSessionDuplicated(id string, sessionId string) (bool, error)

func IsSigninEnabled added in v1.779.0

func IsSigninEnabled() bool

func MergeMcpTools added in v1.788.1

func MergeMcpTools(mcpToolSet *mcp.ToolSet, store *Store, webSearchEnabled bool, lang string) *mcp.ToolSet

MergeMcpTools merges builtin tools (from the store's tool list) and the web-search flag into an existing McpToolSet, creating one if needed.

func PopulateStoreCounts

func PopulateStoreCounts(stores []*Store) error

func PrepareTextToSpeech

func PrepareTextToSpeech(storeId, providerId, messageId, text string, lang string) (*Message, *Chat, tts.TextToSpeechProvider, context.Context, error)

PrepareTextToSpeech prepares the text-to-speech conversion

func QueryRecord

func QueryRecord(id string, lang string) (string, error)

func QueryRecordSecond

func QueryRecordSecond(id string, lang string) (string, error)

func RefineMessageFiles

func RefineMessageFiles(message *Message, origin string, lang string) error

func RefreshFileVectors

func RefreshFileVectors(file *File, lang string) (bool, error)

func RefreshStoreVectors

func RefreshStoreVectors(store *Store, lang string) (bool, error)

func ScanNeedCommitRecords

func ScanNeedCommitRecords()

ScanNeedCommitRecords scans the database table for records that need to be committed but have not yet been committed.

func SetDefaultVodClient

func SetDefaultVodClient(lang string) error

func SplitLastN

func SplitLastN(s, sep string, n int) []string

func SyncDefaultProvidersToStore

func SyncDefaultProvidersToStore(store *Store) error

func SyncMcpTool added in v1.788.1

func SyncMcpTool(id string, server *Server, isCleared bool) (bool, error)

func TestMcpServer added in v1.788.0

func TestMcpServer(s *Server, lang string) (string, error)

TestMcpServer connects to the server URL and calls the tool specified in TestContent (JSON: {"tool": "toolName", "arguments": {...}}).

func TestTool added in v1.783.0

func TestTool(t *Tool, lang string) (string, error)

func UpdateArticle

func UpdateArticle(id string, article *Article) (bool, error)

func UpdateChat

func UpdateChat(id string, chat *Chat) (bool, error)

func UpdateChatStats

func UpdateChatStats(chat *Chat, ttsResult *tts.TextToSpeechResult) error

func UpdateFile

func UpdateFile(id string, file *File) (bool, error)

func UpdateFilesStatusByStore

func UpdateFilesStatusByStore(owner string, storeName string, status FileStatus) error

func UpdateForm

func UpdateForm(id string, form *Form, lang string) (bool, error)

func UpdateGraph

func UpdateGraph(id string, graph *Graph) (bool, error)

func UpdateMessage

func UpdateMessage(id string, message *Message, isHitOnly bool) (bool, error)

func UpdateProvider

func UpdateProvider(id string, provider *Provider) (bool, error)

func UpdateRecord

func UpdateRecord(id string, record *Record, lang string) (bool, error)

func UpdateRecordFields

func UpdateRecordFields(id string, fields map[string]interface{}, lang string) (bool, error)

func UpdateRecordInternal

func UpdateRecordInternal(id int, record Record) error

func UpdateResource added in v1.782.0

func UpdateResource(id string, resource *Resource) (bool, error)

func UpdateScale

func UpdateScale(id string, scale *Scale) (bool, error)

func UpdateServer added in v1.788.0

func UpdateServer(id string, server *Server) (bool, error)

func UpdateSession

func UpdateSession(id string, session *Session) (bool, error)

func UpdateSite added in v1.783.0

func UpdateSite(id string, site *Site) (bool, error)

func UpdateSkill added in v1.792.0

func UpdateSkill(id string, s *Skill) (bool, error)

func UpdateStore

func UpdateStore(id string, store *Store) (bool, error)

func UpdateTask

func UpdateTask(id string, task *Task) (bool, error)

func UpdateTool added in v1.783.0

func UpdateTool(id string, t *Tool) (bool, error)

func UpdateTreeFile

func UpdateTreeFile(storeId string, key string, file *TreeFile) bool

func UpdateUserPassword added in v1.779.0

func UpdateUserPassword(user *User, password string) error

func UpdateUserProfile added in v1.779.0

func UpdateUserProfile(user *User) error

func UpdateVector

func UpdateVector(id string, vector *Vector, lang string) (bool, error)

func UpdateVideo

func UpdateVideo(id string, video *Video) (bool, error)

func UpdateWorkflow

func UpdateWorkflow(id string, workflow *Workflow, lang string) (bool, error)

func UploadFileToStorageSafe

func UploadFileToStorageSafe(objectKey string, fileBytes []byte, origin string, lang string) (fileUrl string, err error)

UploadFileToStorageSafe uploads fileBytes to the default storage provider and returns a public URL. objectKey is the storage path used for PutObject (e.g. "openagent/resources/avatar/user/file.png"); callers should store it as StorageName for later deletion via DeleteResourceFile.

func ValidateTransactionForMessage

func ValidateTransactionForMessage(message *Message) error

ValidateTransactionForMessage validates a transaction in dry run mode before committing it. This checks if the user has sufficient balance without actually creating the transaction.

Types

type Adapter

type Adapter struct {
	DbName string
	// contains filtered or unexported fields
}

Adapter represents the MySQL adapter for policy storage.

func NewAdapter

func NewAdapter(driverName string, dataSourceName string) *Adapter

NewAdapter is the constructor for Adapter.

func NewAdapterWithDbName

func NewAdapterWithDbName(driverName string, dataSourceName string, dbName string) *Adapter

func (*Adapter) CreateDatabase

func (a *Adapter) CreateDatabase() error

type Article

type Article struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Workflow    string `xorm:"varchar(100)" json:"workflow"`
	Type        string `xorm:"varchar(100)" json:"type"`

	Text     string   `xorm:"mediumtext" json:"text"`
	Content  []*Block `xorm:"mediumtext" json:"content"`
	Glossary []string `xorm:"varchar(200)" json:"glossary"`
}

func GetArticle

func GetArticle(id string) (*Article, error)

func GetArticles

func GetArticles(owner string) ([]*Article, error)

func GetGlobalArticles

func GetGlobalArticles() ([]*Article, error)

func GetMaskedArticle

func GetMaskedArticle(article *Article, isMaskEnabled bool) *Article

func GetMaskedArticles

func GetMaskedArticles(articles []*Article, isMaskEnabled bool) []*Article

func GetPaginationArticles

func GetPaginationArticles(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Article, error)

func (*Article) GetId

func (article *Article) GetId() string

type Block

type Block struct {
	Type   string `json:"type"`
	Text   string `json:"text"`
	TextEn string `json:"textEn"`
	Prompt string `json:"prompt"`
	State  string `json:"state"`
}

type Chat

type Chat struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`

	Organization  string   `xorm:"varchar(100)" json:"organization"`
	DisplayName   string   `xorm:"varchar(100)" json:"displayName"`
	Store         string   `xorm:"varchar(100)" json:"store"`
	ModelProvider string   `xorm:"varchar(100)" json:"modelProvider"`
	Tool          string   `xorm:"varchar(100)" json:"tool"`
	Category      string   `xorm:"varchar(100)" json:"category"`
	Type          string   `xorm:"varchar(100)" json:"type"`
	User          string   `xorm:"varchar(100) index" json:"user"`
	User1         string   `xorm:"varchar(100)" json:"user1"`
	User2         string   `xorm:"varchar(100)" json:"user2"`
	Users         []string `xorm:"varchar(100)" json:"users"`
	ClientIp      string   `xorm:"varchar(100)" json:"clientIp"`
	UserAgent     string   `xorm:"varchar(200)" json:"userAgent"`
	ClientIpDesc  string   `xorm:"varchar(100)" json:"clientIpDesc"`
	UserAgentDesc string   `xorm:"varchar(100)" json:"userAgentDesc"`
	MessageCount  int      `json:"messageCount"`
	TokenCount    int      `json:"tokenCount"`
	Price         float64  `json:"price"`
	Currency      string   `xorm:"varchar(100)" json:"currency"`
	IsHidden      bool     `json:"isHidden"`
	IsDeleted     bool     `json:"isDeleted"`
	NeedTitle     bool     `json:"needTitle"`
}

func FilterChatsByTimeRange

func FilterChatsByTimeRange(chats []*Chat, startTime, endTime string) []*Chat

func GetChat

func GetChat(id string) (*Chat, error)

func GetChats

func GetChats(owner string, storeName string, user string) ([]*Chat, error)

func GetGlobalChats

func GetGlobalChats() ([]*Chat, error)

func GetPaginationChats

func GetPaginationChats(owner string, offset, limit int, field, value, sortField, sortOrder string, store string) ([]*Chat, error)

func GetPaginationChatsByStoreNames

func GetPaginationChatsByStoreNames(storeNames []string, offset, limit int, field, value, sortField, sortOrder string) ([]*Chat, error)

func GetPaginationChatsByUser

func GetPaginationChatsByUser(user, store string, offset, limit int, field, value, sortField, sortOrder string) ([]*Chat, error)

func (*Chat) GetId

func (chat *Chat) GetId() string

type DayCount added in v1.776.0

type DayCount struct {
	Date  string `json:"date"`
	Count int    `json:"count"`
}

DayCount holds a date and the number of messages on that day.

type DefaultSearchProvider

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

func NewDefaultSearchProvider

func NewDefaultSearchProvider(owner string) (*DefaultSearchProvider, error)

func (*DefaultSearchProvider) Search

func (p *DefaultSearchProvider) Search(relatedStores []string, embeddingProviderName string, embeddingProviderObj embedding.EmbeddingProvider, modelProviderName string, text string, knowledgeCount int, lang string) ([]Vector, *embedding.EmbeddingResult, error)

type ExampleQuestion

type ExampleQuestion struct {
	Title string `json:"title"`
	Text  string `json:"text"`
	Image string `json:"image"`
}

type File

type File struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(512) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Filename        string     `xorm:"varchar(255)" json:"filename"`
	Size            int64      `json:"size"`
	Store           string     `xorm:"varchar(100)" json:"store"`
	StorageProvider string     `xorm:"varchar(100)" json:"storageProvider"`
	Url             string     `xorm:"varchar(500)" json:"url"`
	TokenCount      int        `json:"tokenCount"`
	Status          FileStatus `xorm:"varchar(100)" json:"status"`
	ErrorText       string     `xorm:"mediumtext" json:"errorText"`
}

func GetFile

func GetFile(id string) (*File, error)

func GetFiles

func GetFiles(owner string) ([]*File, error)

func GetFilesByStore

func GetFilesByStore(owner string, store string) ([]*File, error)

func GetGlobalFiles

func GetGlobalFiles() ([]*File, error)

func GetPaginationFiles

func GetPaginationFiles(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*File, error)

func (*File) GetId

func (file *File) GetId() string

type FileStatus

type FileStatus string
const (
	FileStatusPending    FileStatus = "Pending"
	FileStatusProcessing FileStatus = "Processing"
	FileStatusFinished   FileStatus = "Finished"
	FileStatusError      FileStatus = "Error"
)

type Form

type Form struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Position    string `xorm:"varchar(100)" json:"position"`
	Category    string `xorm:"varchar(100)" json:"category"`
	Type        string `xorm:"varchar(100)" json:"type"`
	Tag         string `xorm:"varchar(100)" json:"tag"`
	Url         string `xorm:"varchar(100)" json:"url"`

	FormItems []*FormItem `xorm:"varchar(5000)" json:"formItems"`
}

func GetForm

func GetForm(id string) (*Form, error)

func GetForms

func GetForms(owner string) ([]*Form, error)

func GetGlobalForms

func GetGlobalForms() ([]*Form, error)

func GetMaskedForm

func GetMaskedForm(form *Form, isMaskEnabled bool) *Form

func GetMaskedForms

func GetMaskedForms(forms []*Form, isMaskEnabled bool) []*Form

func GetPaginationForms

func GetPaginationForms(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Form, error)

func (*Form) GetId

func (form *Form) GetId() string

type FormItem

type FormItem struct {
	Name    string `json:"name"`
	Label   string `json:"label"`
	Type    string `json:"type"`
	Visible bool   `json:"visible"`
	Width   string `json:"width"`
}

type GaugeVecInfo

type GaugeVecInfo struct {
	Method     string  `json:"method"`
	Name       string  `json:"name"`
	Throughput float64 `json:"throughput"`
}

type Graph

type Graph struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Category    string `xorm:"varchar(100)" json:"category"`
	Layout      string `xorm:"varchar(100)" json:"layout"`
	Density     int    `xorm:"int" json:"density"`
	Store       string `xorm:"varchar(100)" json:"store"`
	StartTime   string `xorm:"varchar(100)" json:"startTime"`
	EndTime     string `xorm:"varchar(100)" json:"endTime"`
	Text        string `xorm:"mediumtext" json:"text"`
	ErrorText   string `xorm:"mediumtext" json:"errorText"`
}

func GetGlobalGraphs

func GetGlobalGraphs() ([]*Graph, error)

func GetGraph

func GetGraph(id string) (*Graph, error)

func GetGraphs

func GetGraphs(owner string) ([]*Graph, error)

func GetMaskedGraph

func GetMaskedGraph(graph *Graph, isMaskEnabled bool) *Graph

func GetMaskedGraphs

func GetMaskedGraphs(graphs []*Graph, isMaskEnabled bool) []*Graph

func GetPaginationGraphs

func GetPaginationGraphs(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Graph, error)

func (*Graph) GetId

func (graph *Graph) GetId() string

type GraphNode

type GraphNode struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	Value  int    `json:"val"`
	Color  string `json:"color"`
	Tag    string `json:"tag"`
	Weight int    `json:"weight"`
}

type HierarchySearchProvider

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

func NewHierarchySearchProvider

func NewHierarchySearchProvider(owner string) (*HierarchySearchProvider, error)

func (*HierarchySearchProvider) Search

func (p *HierarchySearchProvider) Search(relatedStores []string, embeddingProviderName string, embeddingProviderObj embedding.EmbeddingProvider, modelProviderName string, text string, knowledgeCount int, lang string) ([]Vector, *embedding.EmbeddingResult, error)

type HistogramVecInfo

type HistogramVecInfo struct {
	Method  string `json:"method"`
	Name    string `json:"name"`
	Count   uint64 `json:"count"`
	Latency string `json:"latency"`
}

type Label

type Label struct {
	Id        string  `xorm:"varchar(100)" json:"id"`
	User      string  `xorm:"varchar(100)" json:"user"`
	Type      string  `xorm:"varchar(100)" json:"type"`
	StartTime float64 `json:"startTime"`
	EndTime   float64 `json:"endTime"`
	Text      string  `xorm:"varchar(100)" json:"text"`
	Speaker   string  `xorm:"varchar(100)" json:"speaker"`
	Tag1      string  `xorm:"varchar(100)" json:"tag1"`
	Tag2      string  `xorm:"varchar(100)" json:"tag2"`
	Tag3      string  `xorm:"varchar(100)" json:"tag3"`
}

type McpTool added in v1.788.1

type McpTool struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	IsAllowed   bool   `json:"isAllowed"`
	InputSchema string `json:"inputSchema,omitempty"`
}

type Message

type Message struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Organization      string               `xorm:"varchar(100)" json:"organization"`
	Store             string               `xorm:"varchar(100)" json:"store"`
	User              string               `xorm:"varchar(100) index" json:"user"`
	Chat              string               `xorm:"varchar(100) index" json:"chat"`
	ReplyTo           string               `xorm:"varchar(100) index" json:"replyTo"`
	Author            string               `xorm:"varchar(100)" json:"author"`
	Text              string               `xorm:"mediumtext" json:"text"`
	ReasonText        string               `xorm:"mediumtext" json:"reasonText"`
	ErrorText         string               `xorm:"mediumtext" json:"errorText"`
	FileName          string               `xorm:"varchar(100)" json:"fileName"`
	Comment           string               `xorm:"mediumtext" json:"comment"`
	TokenCount        int                  `json:"tokenCount"`
	TextTokenCount    int                  `json:"textTokenCount"`
	Price             float64              `json:"price"`
	Currency          string               `xorm:"varchar(100)" json:"currency"`
	IsHidden          bool                 `json:"isHidden"`
	IsDeleted         bool                 `json:"isDeleted"`
	NeedNotify        bool                 `json:"needNotify"`
	IsAlerted         bool                 `json:"isAlerted"`
	IsRegenerated     bool                 `json:"isRegenerated"`
	WebSearchEnabled  bool                 `json:"webSearchEnabled"`
	ModelProvider     string               `xorm:"varchar(100)" json:"modelProvider"`
	EmbeddingProvider string               `xorm:"varchar(100)" json:"embeddingProvider"`
	VectorScores      []VectorScore        `xorm:"mediumtext" json:"vectorScores"`
	LikeUsers         []string             `json:"likeUsers"`
	DisLikeUsers      []string             `json:"dislikeUsers"`
	Suggestions       []Suggestion         `json:"suggestions"`
	ToolCalls         []model.ToolCall     `xorm:"mediumtext" json:"toolCalls"`
	SearchResults     []model.SearchResult `xorm:"mediumtext" json:"searchResults"`

	TransactionId string `xorm:"varchar(100)" json:"transactionId"`
}

func GetChatMessages

func GetChatMessages(chat string) ([]*Message, error)

func GetGlobalFailMessages

func GetGlobalFailMessages() ([]*Message, error)

func GetGlobalMessages

func GetGlobalMessages() ([]*Message, error)

func GetGlobalMessagesByStoreName

func GetGlobalMessagesByStoreName(storeName string) ([]*Message, error)

func GetMessage

func GetMessage(id string) (*Message, error)

func GetMessages

func GetMessages(owner string, user string, storeName string) ([]*Message, error)

func GetMessagesForChats

func GetMessagesForChats(chats []*Chat) ([]*Message, error)

func GetPaginationMessages

func GetPaginationMessages(owner string, offset, limit int, field, value, sortField, sortOrder, store string) ([]*Message, error)

func GetPaginationMessagesByStoreNames

func GetPaginationMessagesByStoreNames(storeNames []string, offset, limit int, field, value, sortField, sortOrder string) ([]*Message, error)

func GetPaginationMessagesByUser

func GetPaginationMessagesByUser(user, store string, offset, limit int, field, value, sortField, sortOrder string) ([]*Message, error)

func (*Message) GetId

func (message *Message) GetId() string

func (*Message) SendEmail

func (message *Message) SendEmail(lang string) error

func (*Message) SendErrorEmail

func (message *Message) SendErrorEmail(errorText string, lang string) error

type MessageHeatmapData added in v1.776.0

type MessageHeatmapData struct {
	Data      []DayCount `json:"data"`
	MaxCount  int        `json:"maxCount"`
	DateRange [2]string  `json:"dateRange"`
}

MessageHeatmapData holds daily message activity aggregated over the past year.

func GetUsageMessageHeatmap added in v1.776.0

func GetUsageMessageHeatmap(owner string) (*MessageHeatmapData, error)

GetUsageMessageHeatmap returns daily message counts over the past year, suitable for rendering a GitHub-style calendar heatmap.

type MyWriter

type MyWriter struct {
	bytes.Buffer
}

func (*MyWriter) Flush

func (w *MyWriter) Flush()

func (*MyWriter) Write

func (w *MyWriter) Write(p []byte) (n int, err error)

type Param

type Param struct {
	Key   string `json:"key"`
	Field string `json:"field"`
	Value string `json:"value"`
}

type PrometheusInfo

type PrometheusInfo struct {
	ApiThroughput   []GaugeVecInfo     `json:"apiThroughput"`
	ApiLatency      []HistogramVecInfo `json:"apiLatency"`
	TotalThroughput float64            `json:"totalThroughput"`
}

func GetPrometheusInfo

func GetPrometheusInfo() (*PrometheusInfo, error)

type Properties

type Properties struct {
	CollectedTime string `xorm:"varchar(100)" json:"collectedTime"`
	Subject       string `xorm:"varchar(100)" json:"subject"`
}

type Provider

type Provider struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName        string `xorm:"varchar(100)" json:"displayName"`
	DisplayName2       string `xorm:"varchar(100)" json:"displayName2"`
	Category           string `xorm:"varchar(100)" json:"category"`
	Type               string `xorm:"varchar(100)" json:"type"`
	SubType            string `xorm:"varchar(100)" json:"subType"`
	Flavor             string `xorm:"varchar(100)" json:"flavor"`
	ClientId           string `xorm:"varchar(100)" json:"clientId"`
	ClientSecret       string `xorm:"varchar(2000)" json:"clientSecret"`
	Region             string `xorm:"varchar(100)" json:"region"`
	ProviderKey        string `xorm:"varchar(100)" json:"providerKey"`
	ProviderUrl        string `xorm:"varchar(200)" json:"providerUrl"`
	ApiVersion         string `xorm:"varchar(100)" json:"apiVersion"`
	CompatibleProvider string `xorm:"varchar(100)" json:"compatibleProvider"`
	Domain             string `xorm:"varchar(200)" json:"domain"`
	Text               string `xorm:"mediumtext" json:"text"`
	ConfigText         string `xorm:"mediumtext" json:"configText"`
	RawText            string `xorm:"mediumtext" json:"rawText"`

	EnableThinking   bool    `json:"enableThinking"`
	Temperature      float32 `xorm:"float" json:"temperature"`
	TopP             float32 `xorm:"float" json:"topP"`
	TopK             int     `xorm:"int" json:"topK"`
	FrequencyPenalty float32 `xorm:"float" json:"frequencyPenalty"`
	PresencePenalty  float32 `xorm:"float" json:"presencePenalty"`

	InputPricePerThousandTokens  float64 `xorm:"DECIMAL(10, 4)" json:"inputPricePerThousandTokens"`
	OutputPricePerThousandTokens float64 `xorm:"DECIMAL(10, 4)" json:"outputPricePerThousandTokens"`
	Currency                     string  `xorm:"varchar(100)" json:"currency"`

	UserKey        string `xorm:"varchar(1000)" json:"userKey"`
	UserCert       string `xorm:"mediumtext" json:"userCert"`
	SignKey        string `xorm:"varchar(1000)" json:"signKey"`
	SignCert       string `xorm:"mediumtext" json:"signCert"`
	ContractName   string `xorm:"varchar(100)" json:"contractName"`
	ContractMethod string `xorm:"varchar(100)" json:"contractMethod"`
	Network        string `xorm:"varchar(100)" json:"network"`
	Chain          string `xorm:"varchar(100)" json:"chain"`
	TestContent    string `xorm:"varchar(500)" json:"testContent"`
	ModelProvider  string `xorm:"varchar(100)" json:"modelProvider"`

	EnableProxy bool   `json:"enableProxy"`
	IsDefault   bool   `json:"isDefault"`
	IsRemote    bool   `json:"isRemote"`
	State       string `xorm:"varchar(100)" json:"state"`
	BrowserUrl  string `xorm:"varchar(200)" json:"browserUrl"`
}

func GetActiveBlockchainProvider

func GetActiveBlockchainProvider(owner string) (*Provider, error)

func GetDefaultBlockchainProvider

func GetDefaultBlockchainProvider() (*Provider, error)

func GetDefaultEmbeddingProvider

func GetDefaultEmbeddingProvider() (*Provider, error)

func GetDefaultModelProvider

func GetDefaultModelProvider() (*Provider, error)

func GetDefaultSpeechToTextProvider

func GetDefaultSpeechToTextProvider() (*Provider, error)

func GetDefaultStorageProvider

func GetDefaultStorageProvider() (*Provider, error)

func GetDefaultTextToSpeechProvider

func GetDefaultTextToSpeechProvider() (*Provider, error)

func GetDefaultVideoProvider

func GetDefaultVideoProvider() (*Provider, error)

func GetEmbeddingProviderFromContext

func GetEmbeddingProviderFromContext(owner string, name string, lang string) (*Provider, embedding.EmbeddingProvider, error)

func GetGlobalProviders

func GetGlobalProviders() ([]*Provider, error)

func GetMaskedProvider

func GetMaskedProvider(provider *Provider, isMaskEnabled bool, user *auth.User) *Provider

func GetMaskedProviders

func GetMaskedProviders(providers []*Provider, isMaskEnabled bool, user *auth.User) []*Provider

func GetModelProviderFromContext

func GetModelProviderFromContext(owner string, name string, lang string) (*Provider, model.ModelProvider, error)

func GetPaginationProviders

func GetPaginationProviders(owner, storeName string, offset, limit int, field, value, sortField, sortOrder string) ([]*Provider, error)

func GetProvider

func GetProvider(id string) (*Provider, error)

func GetProviderByOwnerAndName

func GetProviderByOwnerAndName(owner string, nameOrId string) (*Provider, error)

GetProviderByOwnerAndName resolves a provider row from either a full id (owner/name) or a short name. Short names are looked up under owner first, then under admin when missing (built-in and shared providers are created under admin).

func GetProviderByProviderKey

func GetProviderByProviderKey(providerKey string, lang string) (*Provider, error)

GetProviderByProviderKey retrieves a provider using the Provider key

func GetProviders

func GetProviders(owner string) ([]*Provider, error)

func (*Provider) GetChatProvider

func (p *Provider) GetChatProvider(lang string) (chat.ChatProvider, error)

func (*Provider) GetEmbeddingProvider

func (p *Provider) GetEmbeddingProvider(lang string) (embedding.EmbeddingProvider, error)

func (*Provider) GetId

func (provider *Provider) GetId() string

func (*Provider) GetModelProvider

func (p *Provider) GetModelProvider(lang string) (model.ModelProvider, error)

func (*Provider) GetSpeechToTextProvider

func (p *Provider) GetSpeechToTextProvider(lang string) (stt.SpeechToTextProvider, error)

func (*Provider) GetStorageProviderObj

func (p *Provider) GetStorageProviderObj(vectorStoreId string, lang string) (storage.StorageProvider, error)

func (*Provider) GetTextToSpeechProvider

func (p *Provider) GetTextToSpeechProvider(lang string) (tts.TextToSpeechProvider, error)

type ProviderCategoryCount added in v1.776.0

type ProviderCategoryCount struct {
	Category string `json:"category"`
	Count    int64  `json:"count"`
}

ProviderCategoryCount holds a provider category label and its count.

func GetUsageProviderDistribution added in v1.776.0

func GetUsageProviderDistribution(owner string) ([]*ProviderCategoryCount, error)

GetUsageProviderDistribution returns provider counts grouped by category for the given owner.

type Record

type Record struct {
	Id int `xorm:"int notnull pk autoincr" json:"id"`

	Owner       string `xorm:"varchar(100) index" json:"owner"`
	Name        string `xorm:"varchar(100) index" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Organization string `xorm:"varchar(100)" json:"organization"`
	ClientIp     string `xorm:"varchar(100)" json:"clientIp"`
	UserAgent    string `xorm:"varchar(200)" json:"userAgent"`
	User         string `xorm:"varchar(100)" json:"user"`
	Method       string `xorm:"varchar(100)" json:"method"`
	RequestUri   string `xorm:"varchar(1000)" json:"requestUri"`
	Action       string `xorm:"varchar(1000)" json:"action"`
	Language     string `xorm:"varchar(100)" json:"language"`
	Query        string `xorm:"varchar(100)" json:"query"`
	Region       string `xorm:"varchar(100)" json:"region"`
	City         string `xorm:"varchar(100)" json:"city"`
	Unit         string `xorm:"varchar(100)" json:"unit"`
	Section      string `xorm:"varchar(100)" json:"section"`

	Object    string `xorm:"mediumtext" json:"object"`
	Response  string `xorm:"mediumtext" json:"response"`
	ErrorText string `xorm:"mediumtext" json:"errorText"`

	Provider    string `xorm:"varchar(100)" json:"provider"`
	Block       string `xorm:"varchar(100) index" json:"block"`
	BlockHash   string `xorm:"varchar(500)" json:"blockHash"`
	Transaction string `xorm:"varchar(500)" json:"transaction"`

	Provider2    string `xorm:"varchar(100)" json:"provider2"`
	Block2       string `xorm:"varchar(100)" json:"block2"`
	BlockHash2   string `xorm:"varchar(500)" json:"blockHash2"`
	Transaction2 string `xorm:"varchar(500)" json:"transaction2"`

	Count int `xorm:"int" json:"count"`

	IsTriggered bool `json:"isTriggered"`
	NeedCommit  bool `xorm:"index" json:"needCommit"`
}

func GetPaginationRecords

func GetPaginationRecords(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Record, error)

func GetRecord

func GetRecord(id string, lang string) (*Record, error)

GetRecord retrieves a record by its ID or owner/name format.

func GetRecords

func GetRecords(owner string) ([]*Record, error)

func NewRecord

func NewRecord(ctx *context.Context) (*Record, error)

type Remark

type Remark struct {
	Timestamp string `xorm:"varchar(100)" json:"timestamp"`
	User      string `xorm:"varchar(100)" json:"user"`
	Score     string `xorm:"varchar(100)" json:"score"`
	Text      string `xorm:"varchar(100)" json:"text"`
	IsPublic  bool   `json:"isPublic"`
}

type Resource added in v1.782.0

type Resource struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string `xorm:"varchar(200)" json:"displayName"`
	User        string `xorm:"varchar(100) index" json:"user"`
	Category    string `xorm:"varchar(100)" json:"category"`    // "avatar", "chat", "document"
	FileType    string `xorm:"varchar(100)" json:"fileType"`    // "image", "video", "application", etc.
	FileFormat  string `xorm:"varchar(100)" json:"fileFormat"`  // ".png", ".jpg", ".pdf", ".docx", etc.
	FileName    string `xorm:"varchar(500)" json:"fileName"`    // original filename
	FileSize    int    `json:"fileSize"`                        // size in bytes
	Url         string `xorm:"varchar(500)" json:"url"`         // public accessible URL
	StorageName string `xorm:"varchar(500)" json:"storageName"` // Casdoor object key (used for deletion)
	ObjectType  string `xorm:"varchar(100)" json:"objectType"`  // "store", "task", "message", "chat"
	ObjectId    string `xorm:"varchar(200)" json:"objectId"`    // owner/name of the associated object
}

Resource records every file uploaded through the system (avatars, chat images, task documents, etc.).

func GetGlobalResources added in v1.782.0

func GetGlobalResources(owner string) ([]*Resource, error)

func GetPaginationResources added in v1.782.0

func GetPaginationResources(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Resource, error)

func GetResource added in v1.782.0

func GetResource(id string) (*Resource, error)

func GetResources added in v1.782.0

func GetResources(owner, user string) ([]*Resource, error)

func NewResourceFromUpload added in v1.782.0

func NewResourceFromUpload(owner, user, category, fileName, fileType, fileFormat, url, storageName string, fileSize int, objectType, objectId string) *Resource

NewResourceFromUpload builds a Resource record for a just-uploaded file.

func (*Resource) GetId added in v1.782.0

func (resource *Resource) GetId() string

type Response

type Response struct {
	Status string `json:"status"`
	Msg    string `json:"msg"`
}

type Scale

type Scale struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Text        string `xorm:"mediumtext" json:"text"`
	State       string `xorm:"varchar(50)" json:"state"`
}

Scale is a reusable rubric / evaluation scale (量表), referenced by tasks via Task.Scale (owner/name id).

func GetGlobalScales

func GetGlobalScales() ([]*Scale, error)

func GetMaskedScale

func GetMaskedScale(scale *Scale, isMaskEnabled bool) *Scale

func GetMaskedScales

func GetMaskedScales(scales []*Scale, isMaskEnabled bool) []*Scale

func GetPaginationScales

func GetPaginationScales(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Scale, error)

func GetPublicScales

func GetPublicScales(owner string) ([]*Scale, error)

GetPublicScales returns scales visible to non-admins (Public or empty state).

func GetScale

func GetScale(id string) (*Scale, error)

func GetScales

func GetScales(owner string) ([]*Scale, error)

func (*Scale) GetId

func (s *Scale) GetId() string

type SearchProvider

type SearchProvider interface {
	Search(relatedStores []string, embeddingProviderName string, embeddingProviderObj embedding.EmbeddingProvider, modelProviderName string, text string, knowledgeCount int, lang string) ([]Vector, *embedding.EmbeddingResult, error)
}

func GetSearchProvider

func GetSearchProvider(typ string, owner string) (SearchProvider, error)

type Server added in v1.788.0

type Server struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	Url         string     `xorm:"varchar(500)" json:"url"`
	Token       string     `xorm:"varchar(500)" json:"-"`
	Tools       []*McpTool `xorm:"mediumtext" json:"tools"`
	TestContent string     `xorm:"varchar(500)" json:"testContent"`
	IsDefault   bool       `json:"isDefault"`
}

func GetPaginationServers added in v1.788.0

func GetPaginationServers(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Server, error)

func GetServer added in v1.788.0

func GetServer(id string) (*Server, error)

func GetServerByOwnerAndName added in v1.788.0

func GetServerByOwnerAndName(owner, nameOrId string) (*Server, error)

func GetServers added in v1.788.0

func GetServers(owner string) ([]*Server, error)

func (*Server) BuildMcpToolSet added in v1.788.1

func (s *Server) BuildMcpToolSet() (*mcp.ToolSet, error)

BuildMcpToolSet opens a connection to the server's URL and returns an McpToolSet with the allowed tools and the open connection. The caller must close all connections in McpToolSet.Connections when done.

func (*Server) GetId added in v1.788.0

func (s *Server) GetId() string

type Session

type Session struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	SessionId []string `json:"sessionId"`
}

func GetPaginationSessions

func GetPaginationSessions(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Session, error)

func GetSession

func GetSession(id string) (*Session, error)

func GetSessions

func GetSessions(owner string) ([]*Session, error)

func (*Session) GetId

func (session *Session) GetId() string

type SimilarityIndex

type SimilarityIndex struct {
	Similarity float32
	Index      int
}

type Site added in v1.783.0

type Site struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	ThemeColor    string   `xorm:"varchar(100)" json:"themeColor"`
	HtmlTitle     string   `xorm:"varchar(100)" json:"htmlTitle"`
	FaviconUrl    string   `xorm:"varchar(200)" json:"faviconUrl"`
	LogoUrl       string   `xorm:"varchar(200)" json:"logoUrl"`
	NavbarHtml    string   `xorm:"mediumtext" json:"navbarHtml"`
	FooterHtml    string   `xorm:"mediumtext" json:"footerHtml"`
	StaticBaseUrl string   `xorm:"varchar(500)" json:"staticBaseUrl"`
	NavItems      []string `xorm:"text" json:"navItems"`

	CheckUserBalance bool `xorm:"bool" json:"checkUserBalance"`
}

func GetBuiltInSite added in v1.783.0

func GetBuiltInSite() (*Site, error)

func GetGlobalSites added in v1.783.0

func GetGlobalSites() ([]*Site, error)

func GetSite added in v1.783.0

func GetSite(id string) (*Site, error)

func GetSites added in v1.783.0

func GetSites(owner string) ([]*Site, error)

type Skill added in v1.792.0

type Skill struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string           `xorm:"varchar(200)" json:"displayName"`
	Type        string           `xorm:"varchar(100)" json:"type"`
	Description string           `xorm:"mediumtext" json:"description"`
	Homepage    string           `xorm:"varchar(500)" json:"homepage"`
	Emoji       string           `xorm:"varchar(50)" json:"emoji"`
	Metadata    string           `xorm:"mediumtext" json:"metadata"`
	Content     string           `xorm:"mediumtext" json:"content"`
	SkillMd     string           `xorm:"mediumtext" json:"skillMd"`
	References  []SkillReference `xorm:"mediumtext" json:"references"`

	State string `xorm:"varchar(100)" json:"state"`
}

Skill is a reusable capability definition.

When loaded from a standard skill folder the fields map as follows:

  • SkillMd ← full raw SKILL.md text (front matter + body)
  • Content ← markdown body of SKILL.md (after front matter), injected into system prompt
  • Description ← "description" field from front matter
  • Homepage ← "homepage" field from front matter
  • Emoji ← metadata.openclaw.emoji extracted from front matter
  • Metadata ← raw "metadata:" block text from front matter
  • References ← every file found in references/ directory

func GetGlobalSkills added in v1.792.0

func GetGlobalSkills() ([]*Skill, error)

func GetPaginationSkills added in v1.792.0

func GetPaginationSkills(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Skill, error)

func GetSkill added in v1.792.0

func GetSkill(id string) (*Skill, error)

func GetSkillByOwnerAndName added in v1.792.0

func GetSkillByOwnerAndName(owner string, nameOrId string) (*Skill, error)

func GetSkills added in v1.792.0

func GetSkills(owner string) ([]*Skill, error)

func LoadSkill added in v1.792.0

func LoadSkill(dir string) (*Skill, error)

LoadSkill reads {dir}/SKILL.md and all {dir}/references/*.md files, parses them, and returns a Skill struct ready to be saved with AddSkill.

func (*Skill) GetId added in v1.792.0

func (s *Skill) GetId() string

type SkillReference added in v1.792.0

type SkillReference struct {
	Name    string `json:"name"`    // filename, e.g. "get-started.md"
	Content string `json:"content"` // full file content
}

SkillReference represents a single file inside a skill's references/ directory.

type Store

type Store struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk index(idx_store_name_created)" json:"name"`
	CreatedTime string `xorm:"varchar(100) index(idx_store_name_created)" json:"createdTime"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	StorageProvider      string   `xorm:"varchar(100)" json:"storageProvider"`
	StorageSubpath       string   `xorm:"varchar(100)" json:"storageSubpath"`
	ImageProvider        string   `xorm:"varchar(100)" json:"imageProvider"`
	SplitProvider        string   `xorm:"varchar(100)" json:"splitProvider"`
	SearchProvider       string   `xorm:"varchar(100)" json:"searchProvider"`
	ModelProvider        string   `xorm:"varchar(100)" json:"modelProvider"`
	EmbeddingProvider    string   `xorm:"varchar(100)" json:"embeddingProvider"`
	TextToSpeechProvider string   `xorm:"varchar(100)" json:"textToSpeechProvider"`
	EnableTtsStreaming   bool     `xorm:"bool" json:"enableTtsStreaming"`
	SpeechToTextProvider string   `xorm:"varchar(100)" json:"speechToTextProvider"`
	McpServer            string   `xorm:"varchar(100)" json:"mcpServer"`
	Skills               []string `xorm:"mediumtext" json:"skills"`
	Tools                []string `xorm:"mediumtext" json:"tools"`
	VectorStoreId        string   `xorm:"varchar(100)" json:"vectorStoreId"`
	BuiltinTools         []string `xorm:"varchar(500)" json:"builtinTools"`

	MemoryLimit         int               `json:"memoryLimit"`
	Frequency           int               `json:"frequency"`
	LimitMinutes        int               `json:"limitMinutes"`
	KnowledgeCount      int               `json:"knowledgeCount"`
	SuggestionCount     int               `json:"suggestionCount"`
	Welcome             string            `xorm:"varchar(100)" json:"welcome"`
	WelcomeTitle        string            `xorm:"varchar(100)" json:"welcomeTitle"`
	WelcomeText         string            `xorm:"varchar(100)" json:"welcomeText"`
	Prompt              string            `xorm:"mediumtext" json:"prompt"`
	ExampleQuestions    []ExampleQuestion `xorm:"mediumtext" json:"exampleQuestions"`
	Avatar              string            `xorm:"varchar(200)" json:"avatar"`
	Title               string            `xorm:"varchar(100)" json:"title"`
	VectorStores        []string          `xorm:"mediumtext" json:"vectorStores"`
	ChildStores         []string          `xorm:"mediumtext" json:"childStores"`
	ChildModelProviders []string          `xorm:"mediumtext" json:"childModelProviders"`
	ForbiddenWords      []string          `xorm:"text" json:"forbiddenWords"`
	Owners              []string          `xorm:"mediumtext" json:"owners"`
	ShowAutoRead        bool              `json:"showAutoRead"`
	DisableFileUpload   bool              `json:"disableFileUpload"`
	HideThinking        bool              `json:"hideThinking"`
	EnableExtraOptions  bool              `json:"enableExtraOptions"`
	IsDefault           bool              `json:"isDefault"`
	State               string            `xorm:"varchar(100)" json:"state"`
	SharedBy            string            `xorm:"varchar(100)" json:"sharedBy"`

	ChatCount    int `xorm:"-" json:"chatCount"`
	MessageCount int `xorm:"-" json:"messageCount"`
	VectorCount  int `xorm:"-" json:"vectorCount"`

	FileTree      *TreeFile              `xorm:"mediumtext" json:"fileTree"`
	PropertiesMap map[string]*Properties `xorm:"mediumtext" json:"propertiesMap"`
}

func GetDefaultStore

func GetDefaultStore(owner string) (*Store, error)

func GetGlobalStores

func GetGlobalStores() ([]*Store, error)

GetGlobalStores loads every row in the store table (admin UI / init). Not for hot per-request paths.

func GetPaginationStores

func GetPaginationStores(offset, limit int, name, field, value, sortField, sortOrder string) ([]*Store, error)

func GetPaginationStoresByOwner

func GetPaginationStoresByOwner(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Store, error)

func GetStore

func GetStore(id string) (*Store, error)

func GetStoreForGetApi

func GetStoreForGetApi(id string) (*Store, error)

GetStoreForGetApi resolves owner/name like GetStore. If there is no row for that exact pair and the owner segment is "admin", returns the newest store with the same name under any owner. This fixes links that incorrectly use admin as the owner while the store belongs to another user.

func GetStores

func GetStores(owner string) ([]*Store, error)

func GetStoresByFields

func GetStoresByFields(owner string, fields ...string) ([]*Store, error)

func ResolveStoreByOwnerAndName

func ResolveStoreByOwnerAndName(owner string, storeName string) (*Store, error)

ResolveStoreByOwnerAndName resolves owner/name like ResolveStoreFromId.

func ResolveStoreForChat

func ResolveStoreForChat(chat *Chat) (*Store, error)

ResolveStoreForChat resolves the store referenced by a chat (same semantics as ResolveStoreByOwnerAndName).

func ResolveStoreFromId

func ResolveStoreFromId(id string) (*Store, error)

ResolveStoreFromId loads a store by id, then applies GetStoreForGetApi fallback so chat rows (owner "admin" + store name) still resolve when the store row is owned by a store admin user.

func ShareStore

func ShareStore(srcOwner, srcName, targetUserName, sharedByUserName string) (*Store, error)

ShareStore duplicates only the store row for targetUserName (new owner), sets SharedBy to sharedByUserName (source user name).

func (*Store) ContainsForbiddenWords

func (store *Store) ContainsForbiddenWords(text string) (bool, string)

func (*Store) GetEmbeddingProvider

func (store *Store) GetEmbeddingProvider() (*Provider, error)

func (*Store) GetId

func (store *Store) GetId() string

func (*Store) GetImageProviderObj

func (store *Store) GetImageProviderObj(lang string) (storage.StorageProvider, error)

func (*Store) GetModelProvider

func (store *Store) GetModelProvider() (*Provider, error)

func (*Store) GetSpeechToTextProvider

func (store *Store) GetSpeechToTextProvider() (*Provider, error)

func (*Store) GetStorageProviderObj

func (store *Store) GetStorageProviderObj(lang string) (storage.StorageProvider, error)

func (*Store) GetTextToSpeechProvider

func (store *Store) GetTextToSpeechProvider() (*Provider, error)

func (*Store) GetVideoData

func (store *Store) GetVideoData(lang string) ([]string, error)

func (*Store) Populate

func (store *Store) Populate(origin string, lang string) error

type SubpathStorageProvider

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

func NewSubpathStorageProvider

func NewSubpathStorageProvider(provider storage.StorageProvider, subpath string) *SubpathStorageProvider

func (*SubpathStorageProvider) DeleteObject

func (w *SubpathStorageProvider) DeleteObject(key string) error

func (*SubpathStorageProvider) ListObjects

func (w *SubpathStorageProvider) ListObjects(prefix string) ([]*storage.Object, error)

ListObjects Implements the StorageProvider interface, automatically prepending the subpath prefix in each method

func (*SubpathStorageProvider) PutObject

func (w *SubpathStorageProvider) PutObject(user string, parent string, key string, fileBuffer *bytes.Buffer) (string, error)

type Suggestion

type Suggestion struct {
	Text  string `json:"text"`
	IsHit bool   `json:"isHit"`
}

type Task

type Task struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Provider    string `xorm:"varchar(100)" json:"provider"`
	Type        string `xorm:"varchar(100)" json:"type"`

	Subject  string  `xorm:"varchar(100)" json:"subject"`
	Topic    string  `xorm:"varchar(100)" json:"topic"`
	Score    float64 `xorm:"float" json:"score"`
	Activity string  `xorm:"varchar(100)" json:"activity"`
	Grade    string  `xorm:"varchar(100)" json:"grade"`

	Path  string `xorm:"varchar(100)" json:"path"`
	Scale string `xorm:"varchar(100)" json:"scale"`

	Example string   `xorm:"varchar(200)" json:"example"`
	Labels  []string `xorm:"mediumtext" json:"labels"`
	Log     string   `xorm:"mediumtext" json:"log"`

	Result string `xorm:"mediumtext" json:"result"`

	DocumentUrl  string `xorm:"varchar(500)" json:"documentUrl"`
	DocumentText string `xorm:"mediumtext" json:"documentText"`
}

func GetGlobalTasks

func GetGlobalTasks(owner string) ([]*Task, error)

func GetMaskedTask

func GetMaskedTask(task *Task, isMaskEnabled bool) *Task

func GetMaskedTasks

func GetMaskedTasks(tasks []*Task, isMaskEnabled bool) []*Task

func GetPaginationTasks

func GetPaginationTasks(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Task, error)

func GetTask

func GetTask(id string) (*Task, error)

func GetTasks

func GetTasks(owner string) ([]*Task, error)

func (*Task) GetId

func (task *Task) GetId() string

type TaskResult

type TaskResult struct {
	Title         string                `json:"title"`
	Designer      string                `json:"designer"`
	Stage         string                `json:"stage"`
	Participants  string                `json:"participants"`
	Grade         string                `json:"grade"`
	Instructor    string                `json:"instructor"`
	Subject       string                `json:"subject"`
	School        string                `json:"school"`
	OtherSubjects string                `json:"otherSubjects"`
	Textbook      string                `json:"textbook"`
	Score         float64               `json:"score"`
	Categories    []*TaskResultCategory `json:"categories"`
}

func AnalyzeTask

func AnalyzeTask(task *Task, lang string) (*TaskResult, error)

type TaskResultCategory

type TaskResultCategory struct {
	Name  string            `json:"name"`
	Score float64           `json:"score"`
	Items []*TaskResultItem `json:"items"`
}

type TaskResultItem

type TaskResultItem struct {
	Name         string  `json:"name"`
	Score        float64 `json:"score"`
	Advantage    string  `json:"advantage"`
	Disadvantage string  `json:"disadvantage"`
	Suggestion   string  `json:"suggestion"`
}

type Tool added in v1.783.0

type Tool struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName  string `xorm:"varchar(100)" json:"displayName"`
	DisplayName2 string `xorm:"varchar(100)" json:"displayName2"`
	Type         string `xorm:"varchar(100)" json:"type"`
	SubType      string `xorm:"varchar(100)" json:"subType"`
	ClientId     string `xorm:"varchar(100)" json:"clientId"`
	ClientSecret string `xorm:"varchar(2000)" json:"clientSecret"`
	ProviderUrl  string `xorm:"varchar(200)" json:"providerUrl"`
	EnableProxy  bool   `json:"enableProxy"`

	Mode           string   `xorm:"varchar(100)" json:"mode"`
	TestContent    string   `xorm:"varchar(500)" json:"testContent"`
	ModelProvider  string   `xorm:"varchar(100)" json:"modelProvider"`
	ResultSummary  string   `xorm:"varchar(500)" json:"resultSummary"`
	PromptExamples []string `xorm:"mediumtext" json:"promptExamples"`

	State string `xorm:"varchar(100)" json:"state"`
}

func GetGlobalTools added in v1.783.0

func GetGlobalTools() ([]*Tool, error)

func GetMaskedTool added in v1.783.0

func GetMaskedTool(t *Tool, isMaskEnabled bool, user *auth.User) *Tool

func GetMaskedTools added in v1.783.0

func GetMaskedTools(tools []*Tool, isMaskEnabled bool, user *auth.User) []*Tool

func GetPaginationTools added in v1.783.0

func GetPaginationTools(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Tool, error)

func GetTool added in v1.783.0

func GetTool(id string) (*Tool, error)

func GetToolByOwnerAndName added in v1.783.0

func GetToolByOwnerAndName(owner string, nameOrId string) (*Tool, error)

func GetTools added in v1.783.0

func GetTools(owner string) ([]*Tool, error)

func (*Tool) GetId added in v1.783.0

func (t *Tool) GetId() string

type TreeFile

type TreeFile struct {
	Key         string      `xorm:"varchar(100)" json:"key"`
	Title       string      `xorm:"varchar(100)" json:"title"`
	Size        int64       `json:"size"`
	CreatedTime string      `xorm:"varchar(100)" json:"createdTime"`
	IsLeaf      bool        `json:"isLeaf"`
	Url         string      `xorm:"varchar(255)" json:"url"`
	Children    []*TreeFile `xorm:"varchar(1000)" json:"children"`

	ChildrenMap map[string]*TreeFile `xorm:"-" json:"-"`
}

type TxtLabel

type TxtLabel struct {
	Type      string  `xorm:"varchar(100)" json:"type"`
	StartTime float64 `json:"startTime"`
	EndTime   float64 `json:"endTime"`
	Speaker   string  `xorm:"varchar(100)" json:"speaker"`
	Text      string  `xorm:"varchar(100)" json:"text"`
}

type Usage

type Usage struct {
	Date         string  `json:"date"`
	UserCount    int     `json:"userCount"`
	ChatCount    int     `json:"chatCount"`
	MessageCount int     `json:"messageCount"`
	TokenCount   int     `json:"tokenCount"`
	Price        float64 `json:"price"`
	Currency     string  `json:"currency"`
}

func GetRangeUsages

func GetRangeUsages(rangeType string, count int, user string, storeName string, lang string) ([]*Usage, error)

func GetUsage

func GetUsage(date string) (*Usage, error)

func GetUsages

func GetUsages(days int, user string, storeName string) ([]*Usage, error)

type UsageInfo

type UsageInfo struct {
	Provider   string    `xorm:"varchar(100)" json:"provider"`
	TokenCount int       `json:"tokenCount"`
	StartTime  time.Time `xorm:"created" json:"startTime"`
}

type UsageMetadata

type UsageMetadata struct {
	Organization string `json:"organization"`
	Application  string `json:"application"`
}

func GetDefaultUsageMetadata added in v1.792.0

func GetDefaultUsageMetadata() *UsageMetadata

func GetUsageMetadata

func GetUsageMetadata(lang string) (*UsageMetadata, error)

type User added in v1.779.0

type User struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`

	RuntimeName string `xorm:"varchar(100) index" json:"runtimeName"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Avatar      string `xorm:"text" json:"avatar"`
	Homepage    string `xorm:"varchar(100)" json:"homepage"`

	PasswordHash string `xorm:"varchar(150)" json:"-"`
	IsForbidden  bool   `json:"isForbidden"`
	IsDeleted    bool   `json:"isDeleted"`
}

func GetUser added in v1.779.0

func GetUser(name string) (*User, error)

func GetUserByRuntimeName added in v1.779.0

func GetUserByRuntimeName(runtimeName string) (*User, error)

func GetUserList added in v1.779.0

func GetUserList() ([]*User, error)

func VerifyUser added in v1.779.0

func VerifyUser(username string, password string) (*User, bool, error)

func (*User) GetId added in v1.779.0

func (user *User) GetId() string

func (*User) ToCasdoorUser added in v1.779.0

func (user *User) ToCasdoorUser() auth.User

type UserUsage

type UserUsage struct {
	User         string  `json:"user"`
	Chats        int     `json:"chats"`
	MessageCount int     `json:"messageCount"`
	TokenCount   int     `json:"tokenCount"`
	Price        float64 `json:"price"`
}

func GetUserTableInfos

func GetUserTableInfos(storeName, user string) ([]*UserUsage, error)

type Vector

type Vector struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName string  `xorm:"varchar(100)" json:"displayName"`
	Store       string  `xorm:"varchar(100)" json:"store"`
	Provider    string  `xorm:"varchar(100) index" json:"provider"`
	File        string  `xorm:"varchar(500)" json:"file"`
	Index       int     `json:"index"`
	Text        string  `xorm:"mediumtext" json:"text"`
	TokenCount  int     `json:"tokenCount"`
	Price       float64 `json:"price"`
	Currency    string  `xorm:"varchar(100)" json:"currency"`
	Score       float32 `json:"score"`

	Data      []float32 `xorm:"mediumtext" json:"data"`
	Dimension int       `json:"dimension"`
}

func GetGlobalVectors

func GetGlobalVectors() ([]*Vector, error)

func GetPaginationVectors

func GetPaginationVectors(owner string, storeName string, offset, limit int, field, value, sortField, sortOrder string) ([]*Vector, error)

func GetPaginationVectorsByStoreNames

func GetPaginationVectorsByStoreNames(storeNames []string, offset, limit int, field, value, sortField, sortOrder string) ([]*Vector, error)

func GetVector

func GetVector(id string) (*Vector, error)

func GetVectors

func GetVectors(owner string) ([]*Vector, error)

func (*Vector) GetId

func (vector *Vector) GetId() string

type VectorScore

type VectorScore struct {
	Vector string  `xorm:"varchar(100)" json:"vector"`
	Score  float32 `json:"score"`
}

func GetNearestKnowledge

func GetNearestKnowledge(storeName string, vectorStores []string, searchProviderType string, embeddingProvider *Provider, embeddingProviderObj embedding.EmbeddingProvider, modelProvider *Provider, owner string, text string, knowledgeCount int, lang string) ([]*model.RawMessage, []VectorScore, *embedding.EmbeddingResult, error)

type Video

type Video struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	DisplayName string `xorm:"varchar(500)" json:"displayName"`

	Description    string         `xorm:"mediumtext" json:"description"`
	Tag            string         `xorm:"varchar(100)" json:"tag"`
	Type           string         `xorm:"varchar(100)" json:"type"`
	VideoId        string         `xorm:"varchar(100)" json:"videoId"`
	VideoLength    string         `xorm:"varchar(100)" json:"videoLength"`
	CoverUrl       string         `xorm:"varchar(200)" json:"coverUrl"`
	DownloadUrl    string         `xorm:"varchar(200)" json:"downloadUrl"`
	AudioUrl       string         `xorm:"varchar(200)" json:"audioUrl"`
	EditMode       string         `xorm:"varchar(100)" json:"editMode"`
	Labels         []*Label       `xorm:"mediumtext" json:"labels"`
	Segments       []*Label       `xorm:"mediumtext" json:"segments"`
	LabelCount     int            `xorm:"-" json:"labelCount"`
	SegmentCount   int            `xorm:"-" json:"segmentCount"`
	WordCountMap   map[string]int `xorm:"mediumtext" json:"wordCountMap"`
	DataUrls       []string       `xorm:"mediumtext" json:"dataUrls"`
	DataUrl        string         `xorm:"varchar(200)" json:"dataUrl"`
	TagOnPause     bool           `json:"tagOnPause"`
	Remarks        []*Remark      `xorm:"mediumtext" json:"remarks"`
	Remarks2       []*Remark      `xorm:"mediumtext" json:"remarks2"`
	ExcellentCount int            `json:"excellentCount"`
	State          string         `xorm:"varchar(100)" json:"state"`
	ReviewState    string         `xorm:"varchar(100)" json:"reviewState"`
	IsPublic       bool           `json:"isPublic"`

	School   string   `xorm:"varchar(100)" json:"school"`
	Stage    string   `xorm:"varchar(100)" json:"stage"`
	Grade    string   `xorm:"varchar(100)" json:"grade"`
	Unit     string   `xorm:"varchar(100)" json:"unit"`
	Lesson   string   `xorm:"varchar(100)" json:"lesson"`
	Class    string   `xorm:"varchar(100)" json:"class"`
	Subject  string   `xorm:"varchar(100)" json:"subject"`
	Topic    string   `xorm:"varchar(100)" json:"topic"`
	Grade2   string   `xorm:"varchar(100)" json:"grade2"`
	Keywords []string `xorm:"varchar(200)" json:"keywords"`
	Template string   `xorm:"varchar(200)" json:"template"`

	Task1 string `xorm:"varchar(100)" json:"task1"`
	Task2 string `xorm:"varchar(100)" json:"task2"`
	Task3 string `xorm:"varchar(100)" json:"task3"`

	PlayAuth string `xorm:"-" json:"playAuth"`
}

func GetGlobalVideos

func GetGlobalVideos() ([]*Video, error)

func GetPaginationVideos

func GetPaginationVideos(owner string, offset int, limit int, field string, value string, sortField string, sortOrder string, lang string) ([]*Video, error)

func GetVideo

func GetVideo(id string, lang string) (*Video, error)

func GetVideos

func GetVideos(owner string, lang string) ([]*Video, error)

func (*Video) GetId

func (video *Video) GetId() string

func (*Video) Populate

func (video *Video) Populate(lang string) error

func (*Video) PopulateWordCountMap

func (v *Video) PopulateWordCountMap(lang string) error

type Visitor added in v1.787.2

type Visitor struct {
	Date       string `json:"date"`
	FieldCount map[string]int
}

type Workflow

type Workflow struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	Text             string `xorm:"mediumtext" json:"text"`
	Text2            string `xorm:"mediumtext" json:"text2"`
	Message          string `xorm:"mediumtext" json:"message"`
	QuestionTemplate string `xorm:"mediumtext" json:"questionTemplate"`
}

func GetGlobalWorkflows

func GetGlobalWorkflows() ([]*Workflow, error)

func GetMaskedWorkflow

func GetMaskedWorkflow(workflow *Workflow, isMaskEnabled bool) *Workflow

func GetMaskedWorkflows

func GetMaskedWorkflows(workflows []*Workflow, isMaskEnabled bool) []*Workflow

func GetPaginationWorkflows

func GetPaginationWorkflows(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Workflow, error)

func GetWorkflow

func GetWorkflow(id string) (*Workflow, error)

func GetWorkflows

func GetWorkflows(owner string) ([]*Workflow, error)

func (*Workflow) GetId

func (workflow *Workflow) GetId() string

Jump to

Keyboard shortcuts

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