object

package
v1.776.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 95 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNotDeployed = "Not Deployed"
	StatusPending     = string(v1.PodPending) // "Pending"
	StatusRunning     = string(v1.PodRunning) // "Running"
	StatusUnknown     = string(v1.PodUnknown) // "Unknown"
	StatusFailed      = string(v1.PodFailed)
	StatusTerminating = "Terminating"
	NamespaceFormat   = "openagent-%s"
)
View Source
const (
	NoConnect    = "no_connect"
	Connecting   = "connecting"
	Connected    = "connected"
	Disconnected = "disconnected"
)
View Source
const (
	ScaleStatePublic = "Public"
	ScaleStateHidden = "Hidden"
)

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

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 (
	WecomBotCache        = make(map[string]Provider)
	WecomBotMessageCache = make(map[string]string)
)
View Source
var OpenAgentHost = ""

Functions

func AddApplication

func AddApplication(application *Application) (bool, error)

func AddArticle

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

func AddAsset

func AddAsset(asset *Asset) (bool, error)

func AddCaase

func AddCaase(caase *Caase) (bool, error)

func AddChat

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

func AddConnection

func AddConnection(connection *Connection) (bool, error)

func AddConsultation

func AddConsultation(consultation *Consultation) (bool, error)

func AddContainer

func AddContainer(container *Container) (bool, error)

func AddDetails

func AddDetails(apps []*Application, lang string)

func AddDoctor

func AddDoctor(doctor *Doctor) (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 AddHospital

func AddHospital(hospital *Hospital) (bool, error)

func AddImage

func AddImage(image *Image) (bool, error)

func AddMachine

func AddMachine(machine *Machine) (bool, error)

func AddMessage

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

func AddNode

func AddNode(node *Node) (bool, error)

func AddPatient

func AddPatient(patient *Patient) (bool, error)

func AddPod

func AddPod(pod *Pod) (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 AddScale

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

func AddScan

func AddScan(scan *Scan) (bool, error)

func AddSession

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

func AddStore

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

func AddTask

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

func AddTemplate

func AddTemplate(template *Template) (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 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 AtomicClaimScan

func AtomicClaimScan(owner, name, hostname string) (int64, error)

AtomicClaimScan atomically updates a scan's state from "Pending" to "Running" This operation will only succeed for one instance due to the WHERE condition on state Returns the number of affected rows

func CanEditPatient

func CanEditPatient(user *casdoorsdk.User, patient *Patient) bool

func ClearThroughputPerSecond

func ClearThroughputPerSecond()

func CloseConnection

func CloseConnection(id string, code int, msg string) error

func CloseDbSession

func CloseDbSession(id string, code int, msg string) error

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 DeleteApplication

func DeleteApplication(application *Application, lang string) (bool, error)

func DeleteArticle

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

func DeleteAsset

func DeleteAsset(asset *Asset) (bool, error)

func DeleteBeegoSession

func DeleteBeegoSession(sessionIds []string)

func DeleteCaase

func DeleteCaase(caase *Caase) (bool, error)

func DeleteChat

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

func DeleteConnection

func DeleteConnection(connection *Connection) (bool, error)

func DeleteConnectionById

func DeleteConnectionById(id string) (bool, error)

func DeleteConsultation

func DeleteConsultation(consultation *Consultation) (bool, error)

func DeleteContainer

func DeleteContainer(container *Container) (bool, error)

func DeleteDoctor

func DeleteDoctor(doctor *Doctor) (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 DeleteHospital

func DeleteHospital(hospital *Hospital) (bool, error)

func DeleteImage

func DeleteImage(image *Image) (bool, error)

func DeleteMachine

func DeleteMachine(machine *Machine) (bool, error)

func DeleteMessage

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

func DeleteMessagesByChat

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

func DeleteNode

func DeleteNode(node *Node) (bool, error)

func DeletePatient

func DeletePatient(patient *Patient) (bool, error)

func DeletePod

func DeletePod(pod *Pod) (bool, error)

func DeleteProvider

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

func DeleteRecord

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

func DeleteScale

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

func DeleteScan

func DeleteScan(scan *Scan) (bool, error)

func DeleteSession

func DeleteSession(id string) (bool, error)

func DeleteSessionId

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

func DeleteStore

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

func DeleteTask

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

func DeleteTemplate

func DeleteTemplate(template *Template) (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 DeployApplication

func DeployApplication(application *Application, lang string) (bool, error)

func DeployApplicationSync

func DeployApplicationSync(application *Application, lang string) (bool, error)

func GenerateWordCloudData

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

func GetActivities

func GetActivities(days int, user string, fieldNames []string, lang string) (map[string][]*Activity, error)

func GetAgentClients

func GetAgentClients(agentProviderObj agent.AgentProvider) (*agent.AgentClients, 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, toolProviderName, question, lang string) (string, *model.ModelResult, error)

func GetApplicationCount

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

func GetApplicationFailureReason

func GetApplicationFailureReason(namespace string, lang string) (string, error)

GetApplicationFailureReason returns the failure reason for an application deployment

func GetApplicationStatus

func GetApplicationStatus(owner, name, namespace string, lang string) (string, error)

GetApplicationStatus returns application status as string

func GetArticleCount

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

func GetAssetCount

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

func GetCaaseCount

func GetCaaseCount(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 GetConnectionCount

func GetConnectionCount(owner, status, field, value string) (int64, error)

func GetConsultationCount

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

func GetContainerCount

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

func GetDbSession

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

func GetDoctorCount

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

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 GetHospitalCount

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

func GetImageCount

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

func GetK8sStatus

func GetK8sStatus(lang string) (string, error)

func GetMachineCount

func GetMachineCount(owner, 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 GetNodeCount

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

func GetPatientCount

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

func GetPodCount

func GetPodCount(owner, field, value string) (int64, 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 GetScaleCount

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

func GetScanCount

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

func GetSessionCount

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

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 GetTemplateCount

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

func GetTwoActiveBlockchainProvider

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

func GetURL

func GetURL(namespace string, lang string) (string, error)

GetURL retrieves the access URL for an application

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 GetWecomBotTokenAndKey

func GetWecomBotTokenAndKey(botID string) (string, string, 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 InitScanJobProcessor

func InitScanJobProcessor()

InitScanJobProcessor initializes the scan job processor with a cron job

func InitStoreCount

func InitStoreCount()

func IsAdmin

func IsAdmin(user *casdoorsdk.User) bool

func IsDoctor

func IsDoctor(user *casdoorsdk.User) bool

func IsPatient

func IsPatient(user *casdoorsdk.User) bool

func IsSessionDuplicated

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

func MakeMsgResponse

func MakeMsgResponse(content string, streamId string) (string, error)

func MergeAgentToolClients

func MergeAgentToolClients(agentClients *agent.AgentClients, store *Store, webSearchEnabled bool, lang string) *agent.AgentClients

MergeAgentToolClients merges MCP agent tools with tools from configured Tool providers, plus web-search flag.

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 RefreshMcpTools

func RefreshMcpTools(provider *Provider) error

func RefreshStoreVectors

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

func ScanAssetsFromProvider

func ScanAssetsFromProvider(owner string, providerName 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 SyncDockerContainers

func SyncDockerContainers(owner string) (bool, error)

func SyncImagesCloud

func SyncImagesCloud(owner string, lang string) (bool, error)

func SyncKubernetesPods

func SyncKubernetesPods(owner string) (bool, error)

func SyncMachinesCloud

func SyncMachinesCloud(owner string, lang string) (bool, error)

func TestMcpProvider

func TestMcpProvider(p *Provider, lang string) (string, error)

TestMcpProvider parses provider.testContent as {"tool":"...","arguments":{}} and invokes one MCP tools/call.

func TestToolProvider

func TestToolProvider(p *Provider, lang string) (string, error)

TestToolProvider parses provider.testContent as {"tool":"...","arguments":{}} and invokes one builtin tool.

func UndeployApplication

func UndeployApplication(owner, name, namespace string, lang string) (bool, error)

func UndeployApplicationSync

func UndeployApplicationSync(owner, name, namespace string, lang string) (bool, error)

UndeployApplicationSync undeploys application and waits for it to be completely removed

func UpdateApplication

func UpdateApplication(id string, application *Application, lang string) (bool, error)

func UpdateApplicationStatus

func UpdateApplicationStatus(owner string, name string, status string, lang string) error

func UpdateArticle

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

func UpdateAsset

func UpdateAsset(id string, asset *Asset) (bool, error)

func UpdateCaase

func UpdateCaase(id string, caase *Caase) (bool, error)

func UpdateChat

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

func UpdateChatStats

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

func UpdateConnection

func UpdateConnection(id string, connection *Connection, columns ...string) (bool, error)

func UpdateConsultation

func UpdateConsultation(id string, consultation *Consultation) (bool, error)

func UpdateContainer

func UpdateContainer(id string, container *Container, lang string) (bool, error)

func UpdateDoctor

func UpdateDoctor(id string, doctor *Doctor) (bool, 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 UpdateHospital

func UpdateHospital(id string, hospital *Hospital) (bool, error)

func UpdateImage

func UpdateImage(id string, image *Image) (bool, error)

func UpdateMachine

func UpdateMachine(id string, machine *Machine) (bool, error)

func UpdateMessage

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

func UpdateNode

func UpdateNode(id string, node *Node) (bool, error)

func UpdatePatient

func UpdatePatient(id string, patient *Patient) (bool, error)

func UpdatePod

func UpdatePod(id string, pod *Pod, lang string) (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 UpdateScale

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

func UpdateScan

func UpdateScan(id string, scan *Scan) (bool, error)

func UpdateSession

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

func UpdateStore

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

func UpdateTask

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

func UpdateTemplate

func UpdateTemplate(id string, template *Template) (bool, error)

func UpdateTreeFile

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

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(user string, tag string, parent string, fullFilePath string, fileBytes []byte) (string, error)

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.

func WriteCloseMessage

func WriteCloseMessage(guacSession *guacamole.Session, mode string, code int, msg string)

Types

type Activity

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

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 AlibabaCloudParser

type AlibabaCloudParser struct{}

AlibabaCloudParser implements CloudParser for Alibaba Cloud

func (*AlibabaCloudParser) ScanAssets

func (p *AlibabaCloudParser) ScanAssets(owner string, provider *Provider) ([]*Asset, error)

ScanAssets scans all resources from Alibaba Cloud

type Application

type Application 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"`
	Description string `xorm:"varchar(255)" json:"description"`
	Template    string `xorm:"varchar(100)" json:"template"` // Reference to Template.Name
	Parameters  string `xorm:"mediumtext" json:"parameters"`
	Manifest    string `xorm:"mediumtext" json:"manifest"`    // Deployment manifest
	Status      string `xorm:"varchar(50)" json:"status"`     // Running, Pending, Failed, Not Deployed
	Namespace   string `xorm:"varchar(100)" json:"namespace"` // Kubernetes namespace (auto-generated)
	URL         string `xorm:"varchar(255)" json:"url"`       // Available service URL

	Details *ApplicationView `xorm:"-" json:"details,omitempty"`

	BasicConfigOptions []applicationConfigOption `xorm:"mediumtext" json:"basicConfigOptions"`
}

func GetApplication

func GetApplication(id string) (*Application, error)

func GetApplications

func GetApplications(owner string) ([]*Application, error)

func GetPaginationApplications

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

type ApplicationEvent

type ApplicationEvent struct {
	Name           string `json:"name"`           // Event name
	Type           string `json:"type"`           // Event type: Normal, Warning
	Reason         string `json:"reason"`         // Event reason
	Message        string `json:"message"`        // Event message
	InvolvedObject string `json:"involvedObject"` // Related object
	Source         string `json:"source"`         // Event source
	Count          int    `json:"count"`          // Event occurrence count
	FirstTime      string `json:"firstTime"`      // First occurrence time
	LastTime       string `json:"lastTime"`       // Last occurrence time
}

type ApplicationView

type ApplicationView struct {
	Services    []ServiceDetail    `json:"services"`
	Credentials []EnvVariable      `json:"credentials"`
	Deployments []DeploymentDetail `json:"deployments"`
	Events      []ApplicationEvent `json:"events"`
	Status      string             `json:"status"`
	CreatedTime string             `json:"createdTime"`
	Namespace   string             `json:"namespace"`
	Metrics     *ResourceMetrics   `json:"metrics,omitempty"`
}

func GetApplicationView

func GetApplicationView(namespace string, lang string) (*ApplicationView, error)

GetApplicationView retrieves application view from cache with fallback

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 Asset

type Asset 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(200)" json:"displayName"`

	Provider   string `xorm:"varchar(100)" json:"provider"`
	Id         string `xorm:"varchar(200)" json:"id"`
	Type       string `xorm:"varchar(100)" json:"type"`
	Region     string `xorm:"varchar(100)" json:"region"`
	Zone       string `xorm:"varchar(100)" json:"zone"`
	State      string `xorm:"varchar(100)" json:"state"`
	Tag        string `xorm:"varchar(500)" json:"tag"`
	Username   string `xorm:"varchar(100)" json:"username"`
	Password   string `xorm:"varchar(200)" json:"password"`
	Properties string `xorm:"mediumtext" json:"properties"`
}

func GetAsset

func GetAsset(id string) (*Asset, error)

func GetAssets

func GetAssets(owner string) ([]*Asset, error)

func GetMaskedAsset

func GetMaskedAsset(asset *Asset, isMaskEnabled bool) *Asset

func GetMaskedAssets

func GetMaskedAssets(assets []*Asset, isMaskEnabled bool) []*Asset

func GetPaginationAssets

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

func (*Asset) GetId

func (asset *Asset) GetId() string

func (*Asset) GetScanTarget

func (asset *Asset) GetScanTarget() (string, error)

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 Caase

type Caase 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"`

	Symptoms      string `xorm:"varchar(100)" json:"symptoms"`
	Diagnosis     string `xorm:"varchar(100)" json:"diagnosis"`
	DiagnosisDate string `xorm:"varchar(100)" json:"diagnosisDate"`
	Prescription  string `xorm:"varchar(100)" json:"prescription"`
	FollowUp      string `xorm:"varchar(100)" json:"followUp"`

	Variation                    bool   `xorm:"bool" json:"variation"`
	HISInterfaceInfo             string `xorm:"varchar(100)" json:"hisInterfaceInfo"`
	PrimaryCarePhysician         string `xorm:"varchar(100)" json:"primaryCarePhysician"`
	Type                         string `xorm:"varchar(100)" json:"type"`
	PatientName                  string `xorm:"varchar(100)" json:"patientName"`
	DoctorName                   string `xorm:"varchar(100)" json:"doctorName"`
	HospitalName                 string `xorm:"varchar(100)" json:"hospitalName"`
	SpecialistAllianceId         string `xorm:"varchar(100)" json:"specialistAllianceId"`
	IntegratedCareOrganizationId string `xorm:"varchar(100)" json:"integratedCareOrganizationId"`
}

func FilterCaasesByUser

func FilterCaasesByUser(user *casdoorsdk.User, caases []*Caase) []*Caase

func GetCaase

func GetCaase(id string) (*Caase, error)

func GetCaases

func GetCaases(owner string) ([]*Caase, error)

func GetMaskedCaase

func GetMaskedCaase(caase *Caase, errs ...error) (*Caase, error)

func GetMaskedCaases

func GetMaskedCaases(caases []*Caase, errs ...error) ([]*Caase, error)

func GetPaginationCaases

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

type CacheManager

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

func (*CacheManager) Start

func (cm *CacheManager) Start(lang string) error

Start begins the cache manager

func (*CacheManager) Stop

func (cm *CacheManager) Stop()

Stop stops the cache manager

type CachedMetrics

type CachedMetrics struct {
	TotalCPU         resource.Quantity `json:"totalCPU"`
	TotalMemory      resource.Quantity `json:"totalMemory"`
	PodCount         int               `json:"podCount"`
	CPUPercentage    float64           `json:"cpuPercentage"`
	MemoryPercentage float64           `json:"memoryPercentage"`
	LastUpdated      time.Time         `json:"lastUpdated"`
}

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"`
	ToolProvider  string   `xorm:"varchar(100)" json:"toolProvider"`
	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 CloudParser

type CloudParser interface {
	// ScanAssets scans all resources from the cloud provider and returns them as Asset objects
	ScanAssets(owner string, provider *Provider) ([]*Asset, error)
}

CloudParser defines the interface for cloud resource scanning

func NewCloudParser

func NewCloudParser(providerType string) (CloudParser, error)

NewCloudParser creates a new CloudParser instance based on the provider type

type Connection

type Connection 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"`

	StartTime string `xorm:"varchar(100)" json:"startTime"`
	EndTime   string `xorm:"varchar(100)" json:"endTime"`

	Protocol      string `xorm:"varchar(20)" json:"protocol"`
	ConnectionId  string `xorm:"varchar(50)" json:"connectionId"`
	Node          string `xorm:"varchar(200) index" json:"node"`
	Creator       string `xorm:"varchar(36) index" json:"creator"`
	ClientIp      string `xorm:"varchar(200)" json:"clientIp"`
	UserAgent     string `xorm:"varchar(200)" json:"userAgent"`
	ClientIpDesc  string `xorm:"varchar(100)" json:"clientIpDesc"`
	UserAgentDesc string `xorm:"varchar(100)" json:"userAgentDesc"`
	Width         int    `json:"width"`
	Height        int    `json:"height"`
	Status        string `xorm:"varchar(20) index" json:"status"`
	Recording     string `xorm:"varchar(1000)" json:"recording"`
	Code          int    `json:"code"`
	Message       string `json:"message"`

	Mode       string   `xorm:"varchar(10)" json:"mode"`
	Operations []string `xorm:"json varchar(1000)" json:"operations"`

	Reviewed     bool  `json:"reviewed"`
	CommandCount int64 `json:"commandCount"`
}

func CreateConnection

func CreateConnection(connection *Connection, nodeId string, mode string) (*Connection, error)

func GetConnection

func GetConnection(id string) (*Connection, error)

func GetConnections

func GetConnections(owner string) ([]*Connection, error)

func GetPaginationConnections

func GetPaginationConnections(owner, status string, offset, limit int, field, value, sortField, sortOrder string) ([]*Connection, error)

func GetSessionsByStatus

func GetSessionsByStatus(statuses []string) ([]*Connection, error)

func (*Connection) GetId

func (s *Connection) GetId() string

type Consultation

type Consultation 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"`

	PatientName string   `xorm:"varchar(100)" json:"patientName"`
	DoctorNames []string `xorm:"mediumtext" json:"doctorNames"`
	ExpiredTime string   `xorm:"varchar(100)" json:"expiredTime"`
	State       string   `xorm:"varchar(100)" json:"state"`
}

func FilterConsultationsByUser

func FilterConsultationsByUser(user *casdoorsdk.User, consultations []*Consultation) []*Consultation

func GetConsultation

func GetConsultation(id string) (*Consultation, error)

func GetConsultations

func GetConsultations(owner string) ([]*Consultation, error)

func GetMaskedConsultation

func GetMaskedConsultation(consultation *Consultation, errs ...error) (*Consultation, error)

func GetMaskedConsultations

func GetMaskedConsultations(consultations []*Consultation, errs ...error) ([]*Consultation, error)

func GetPaginationConsultations

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

type Container

type Container struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	Provider    string `xorm:"varchar(100)" json:"provider"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	Image       string `xorm:"varchar(100)" json:"image"`
	ImageId     string `xorm:"varchar(100)" json:"imageId"`
	Command     string `xorm:"varchar(100)" json:"command"`
	SizeRw      int64  `xorm:"varchar(100)"  json:"sizeRw,omitempty"`
	SizeRootFs  int64  `xorm:"varchar(100)"  json:"sizeRootFs,omitempty"`
	// Labels      map[string]string
	State  string `xorm:"varchar(100)" json:"state"`
	Status string `xorm:"varchar(100)" json:"status"`
	Ports  string `xorm:"varchar(100)" json:"ports"`
}

func GetContainer

func GetContainer(id string) (*Container, error)

func GetContainers

func GetContainers(owner string) ([]*Container, error)

func GetMaskedContainer

func GetMaskedContainer(container *Container, errs ...error) (*Container, error)

func GetMaskedContainers

func GetMaskedContainers(containers []*Container, errs ...error) ([]*Container, error)

func GetPaginationContainers

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

func (*Container) GetId

func (container *Container) GetId() string

type ContainerDetail

type ContainerDetail struct {
	Name      string           `json:"name"`
	Image     string           `json:"image"`
	Resources ResourceRequests `json:"resources"`
}

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 DeploymentDetail

type DeploymentDetail struct {
	Name          string            `json:"name"`
	Replicas      int32             `json:"replicas"`
	ReadyReplicas int32             `json:"readyReplicas"`
	Containers    []ContainerDetail `json:"containers"`
	CreatedTime   string            `json:"createdTime"`
	Status        string            `json:"status"`
}

type DiskDetail

type DiskDetail struct {
	DiskId             string
	Size               int32
	Category           string
	Type               string
	Encrypted          bool
	InstanceId         string
	DiskChargeType     string
	DeleteWithInstance bool
	Status             string
}

DiskDetail holds detailed information for a disk

type Doctor

type Doctor 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"`

	Department  string `xorm:"varchar(100)" json:"department"`
	Gender      string `xorm:"varchar(100)" json:"gender"`
	AccessLevel string `xorm:"varchar(100)" json:"accessLevel"`

	HospitalName string `xorm:"varchar(100) index" json:"hospitalName"`
}

func GetDoctor

func GetDoctor(id string) (*Doctor, error)

func GetDoctors

func GetDoctors(owner string) ([]*Doctor, error)

func GetMaskedDoctor

func GetMaskedDoctor(doctor *Doctor, errs ...error) (*Doctor, error)

func GetMaskedDoctors

func GetMaskedDoctors(doctors []*Doctor, errs ...error) ([]*Doctor, error)

func GetPaginationDoctors

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

type EcsInstanceDetail

type EcsInstanceDetail struct {
	InstanceId         string
	InstanceType       string
	ImageId            string
	OSName             string
	Cpu                int32
	Memory             int32
	PublicIp           string
	PrivateIp          string
	InstanceChargeType string
	Status             string
}

EcsInstanceDetail holds detailed information for an ECS instance

type EnvVariable

type EnvVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type EventCache

type EventCache struct {
	Namespace string               `json:"namespace"` // Namespace name
	Events    map[string]*v1.Event `json:"events"`    // Event name -> Event object
}

EventCache represents namespace-level event cache

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 FromUser

type FromUser struct {
	UserId string `json:"userid"`
}

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 Hospital

type Hospital 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"`

	Address string `xorm:"varchar(100)" json:"address"`
}

func GetHospital

func GetHospital(id string) (*Hospital, error)

func GetHospitals

func GetHospitals(owner string) ([]*Hospital, error)

func GetMaskedHospital

func GetMaskedHospital(hospital *Hospital, errs ...error) (*Hospital, error)

func GetMaskedHospitals

func GetMaskedHospitals(hospitals []*Hospital, errs ...error) ([]*Hospital, error)

func GetPaginationHospitals

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

type Image

type Image 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"`
	Category string `xorm:"varchar(100)" json:"category"`

	BootMode                string `xorm:"varchar(100)" json:"bootMode" xml:"bootMode"`
	ImageId                 string `xorm:"varchar(100)" json:"imageId" xml:"imageId"`
	ImageOwnerAlias         string `xorm:"varchar(100)" json:"ImageOwnerAlias" xml:"ImageOwnerAlias"`
	OSName                  string `xorm:"varchar(100)" json:"os" xml:"os"`
	OSNameEn                string `xorm:"varchar(100)" json:"OSNameEn" xml:"OSNameEn"`
	ImageFamily             string `xorm:"varchar(100)" json:"ImageFamily" xml:"ImageFamily"`
	Architecture            string `xorm:"varchar(100)" json:"systemArchitecture" xml:"systemArchitecture"`
	IsSupportIoOptimized    bool   `json:"IsSupportIoOptimized" xml:"IsSupportIoOptimized"`
	Size                    string `xorm:"varchar(100)" json:"size" xml:"size"`
	ResourceGroupId         string `xorm:"varchar(100)" json:"ResourceGroupId" xml:"ResourceGroupId"`
	SupplierName            string `xorm:"varchar(100)" json:"SupplierName" xml:"SupplierName"`
	Description             string `xorm:"varchar(100)" json:"description" xml:"description"`
	Usage                   string `xorm:"varchar(100)" json:"Usage" xml:"Usage"`
	IsCopied                bool   `json:"IsCopied" xml:"IsCopied"`
	LoginAsNonRootSupported bool   `json:"LoginAsNonRootSupported" xml:"LoginAsNonRootSupported"`
	ImageVersion            string `xorm:"varchar(100)" json:"ImageVersion" xml:"ImageVersion"`
	OSType                  string `xorm:"varchar(100)" json:"OSType" xml:"OSType"`
	IsSubscribed            bool   `json:"IsSubscribed" xml:"IsSubscribed"`
	IsSupportCloudinit      bool   `json:"IsSupportCloudinit" xml:"IsSupportCloudinit"`
	CreationTime            string `xorm:"varchar(100)" json:"creationTime" xml:"createdTime"`
	ProductCode             string `xorm:"varchar(100)" json:"ProductCode" xml:"ProductCode"`
	Progress                string `xorm:"varchar(100)" json:"progress" xml:"progress"`
	Platform                string `xorm:"varchar(100)" json:"platform" xml:"platform"`
	IsSelfShared            string `xorm:"varchar(100)" json:"IsSelfShared" xml:"IsSelfShared"`
	ImageName               string `xorm:"varchar(100)" json:"ImageName" xml:"ImageName"`
	Status                  string `xorm:"varchar(100)" json:"state" xml:"state"`
	ImageOwnerId            int64  `json:"ImageOwnerId" xml:"ImageOwnerId"`
	IsPublic                bool   `json:"IsPublic" xml:"IsPublic"`

	// DB info
	RemoteProtocol string `xorm:"varchar(100)" json:"remoteProtocol"`
	RemotePort     int    `json:"remotePort"`
	RemoteUsername string `xorm:"varchar(100)" json:"remoteUsername"`
	RemotePassword string `xorm:"varchar(100)" json:"remotePassword"`
}

func GetImage

func GetImage(id string) (*Image, error)

func GetImages

func GetImages(owner string) ([]*Image, error)

func GetMaskedImage

func GetMaskedImage(image *Image, errs ...error) (*Image, error)

func GetMaskedImages

func GetMaskedImages(images []*Image, errs ...error) ([]*Image, error)

func GetPaginationImages

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

func (*Image) GetId

func (image *Image) GetId() string

type ImageItem

type ImageItem struct {
	Base64 string `json:"base64"`
	Md5    string `json:"md5"`
}

type ImageMessage

type ImageMessage struct {
	Url string `json:"url"`
}

type K8sClient

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

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 Machine

type Machine struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	Id          string `xorm:"varchar(100)" json:"id"`
	Provider    string `xorm:"varchar(100)" json:"provider"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
	ExpireTime  string `xorm:"varchar(100)" json:"expireTime"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	Region   string `xorm:"varchar(100)" json:"region"`
	Zone     string `xorm:"varchar(100)" json:"zone"`
	Category string `xorm:"varchar(100)" json:"category"`
	Type     string `xorm:"varchar(100)" json:"type"`
	Size     string `xorm:"varchar(100)" json:"size"`
	Tag      string `xorm:"varchar(100)" json:"tag"`
	State    string `xorm:"varchar(100)" json:"state"`

	Image     string `xorm:"varchar(100)" json:"image"`
	Os        string `xorm:"varchar(100)" json:"os"`
	PublicIp  string `xorm:"varchar(100)" json:"publicIp"`
	PrivateIp string `xorm:"varchar(100)" json:"privateIp"`
	CpuSize   string `xorm:"varchar(100)" json:"cpuSize"`
	MemSize   string `xorm:"varchar(100)" json:"memSize"`

	// DB info
	RemoteProtocol string `xorm:"varchar(100)" json:"remoteProtocol"`
	RemotePort     int    `json:"remotePort"`
	RemoteUsername string `xorm:"varchar(100)" json:"remoteUsername"`
	RemotePassword string `xorm:"varchar(100)" json:"remotePassword"`
}

func GetMachine

func GetMachine(id string) (*Machine, error)

func GetMachines

func GetMachines(owner string) ([]*Machine, error)

func GetMaskedMachine

func GetMaskedMachine(machine *Machine, errs ...error) (*Machine, error)

func GetMaskedMachines

func GetMaskedMachines(machines []*Machine, errs ...error) ([]*Machine, error)

func GetPaginationMachines

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

func (*Machine) GetId

func (machine *Machine) GetId() string

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 MsgItem

type MsgItem struct {
	MsgType string     `json:"msgtype"`
	Image   *ImageItem `json:"image,omitempty"`
}

type MsgResponse

type MsgResponse struct {
	MsgType string      `json:"msgtype"`
	Stream  *StreamSend `json:"stream"`
}

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 Node

type Node 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"`
	Description string `xorm:"mediumtext" json:"description"`

	Category string `xorm:"varchar(100)" json:"category"`
	Type     string `xorm:"varchar(100)" json:"type"`
	Tag      string `xorm:"varchar(100)" json:"tag"`

	MachineName string `xorm:"varchar(100)" json:"machineName"`
	Os          string `xorm:"varchar(100)" json:"os"`

	PublicIp  string `xorm:"varchar(100)" json:"publicIp"`
	PrivateIp string `xorm:"varchar(100)" json:"privateIp"`

	Size    string `xorm:"varchar(100)" json:"size"`
	CpuSize string `xorm:"varchar(100)" json:"cpuSize"`
	MemSize string `xorm:"varchar(100)" json:"memSize"`

	RemoteProtocol string `xorm:"varchar(100)" json:"remoteProtocol"`
	RemotePort     int    `json:"remotePort"`
	RemoteUsername string `xorm:"varchar(100)" json:"remoteUsername"`
	RemotePassword string `xorm:"varchar(100)" json:"remotePassword"`

	AutoQuery   bool `json:"autoQuery"`
	IsPermanent bool `json:"isPermanent"`

	Language string `xorm:"varchar(100)" json:"language"`

	EnableRemoteApp bool         `json:"enableRemoteApp"`
	RemoteApps      []*RemoteApp `json:"remoteApps"`
	Services        []*Service   `json:"services"`
	Patches         []*Patch     `json:"patches"`
}

func GetMaskedNode

func GetMaskedNode(node *Node, errs ...error) (*Node, error)

func GetMaskedNodes

func GetMaskedNodes(nodes []*Node, errs ...error) ([]*Node, error)

func GetNode

func GetNode(id string) (*Node, error)

func GetNodes

func GetNodes(owner string) ([]*Node, error)

func GetPaginationNodes

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

type Param

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

type Patch

type Patch struct {
	Name           string `json:"name"`
	Category       string `json:"category"`
	Title          string `json:"title"`
	Url            string `json:"url"`
	Size           string `json:"size"`
	ExpectedStatus string `json:"expectedStatus"`
	Status         string `json:"status"`
	InstallTime    string `json:"installTime"`
	Message        string `json:"message"`
}

type Patient

type Patient 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"`

	Gender  string `xorm:"varchar(100)" json:"gender"`
	Address string `xorm:"varchar(100)" json:"address"`
	Email   string `xorm:"varchar(100)" json:"email"`

	BloodType    string   `xorm:"varchar(100)" json:"bloodType"`
	Allergies    string   `xorm:"varchar(100)" json:"allergies"`
	Owners       []string `xorm:"mediumtext" json:"owners"`
	HospitalName string   `xorm:"varchar(100)" json:"hospitalName"`
}

func FilterPatientsByUser

func FilterPatientsByUser(user *casdoorsdk.User, patients []*Patient) []*Patient

func GetMaskedPatient

func GetMaskedPatient(patient *Patient, errs ...error) (*Patient, error)

func GetMaskedPatients

func GetMaskedPatients(patients []*Patient, errs ...error) ([]*Patient, error)

func GetPaginationPatients

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

func GetPatient

func GetPatient(id string) (*Patient, error)

func GetPatients

func GetPatients(owner string) ([]*Patient, error)

type Pod

type Pod struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	Provider    string `xorm:"varchar(100)" json:"provider"`
	Namespace   string `xorm:"varchar(100)" json:"namespace"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	HostIP      string `xorm:"varchar(100)" json:"hostIP"`
	PodIP       string `xorm:"varchar(100)" json:"podIP"`
	Labels      string `xorm:"varchar(100)" json:"labels"`
	Status      string `xorm:"varchar(100)" json:"status"`
}

func GetMaskedPod

func GetMaskedPod(pod *Pod, errs ...error) (*Pod, error)

func GetMaskedPods

func GetMaskedPods(pods []*Pod, errs ...error) ([]*Pod, error)

func GetPaginationPods

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

func GetPod

func GetPod(id string) (*Pod, error)

func GetPods

func GetPods(owner string) ([]*Pod, error)

func (*Pod) GetId

func (pod *Pod) GetId() string

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"`
	McpTools           []*agent.McpTools `xorm:"text" json:"mcpTools"`
	Text               string            `xorm:"mediumtext" json:"text"`
	ConfigText         string            `xorm:"mediumtext" json:"configText"`
	RawText            string            `xorm:"mediumtext" json:"rawText"` // Raw result from scan (for Scan category providers)

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

	// New fields for unified scan widget (for Scan category providers)
	TargetMode    string `xorm:"varchar(100)" json:"targetMode"`    // "Manual Input" or "Asset"
	Target        string `xorm:"varchar(500)" json:"target"`        // Manual input target (IP address or network range)
	Asset         string `xorm:"varchar(200)" json:"asset"`         // Selected asset for scan
	Runner        string `xorm:"varchar(100)" json:"runner"`        // Hostname about who runs the scan job
	ErrorText     string `xorm:"mediumtext" json:"errorText"`       // Error message for the job execution
	ResultSummary string `xorm:"varchar(500)" json:"resultSummary"` // Short summary of scan results

	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 GetAgentProviderFromContext

func GetAgentProviderFromContext(owner string, name string, lang string) (*Provider, agent.AgentProvider, error)

func GetDefaultAgentProvider

func GetDefaultAgentProvider() (*Provider, error)

func GetDefaultBlockchainProvider

func GetDefaultBlockchainProvider() (*Provider, error)

func GetDefaultEmbeddingProvider

func GetDefaultEmbeddingProvider() (*Provider, error)

func GetDefaultKubernetesProvider

func GetDefaultKubernetesProvider(lang string) (*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 *casdoorsdk.User) *Provider

func GetMaskedProviders

func GetMaskedProviders(providers []*Provider, isMaskEnabled bool, user *casdoorsdk.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) GetAgentProvider

func (p *Provider) GetAgentProvider(lang string) (agent.AgentProvider, 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) GetScanProvider

func (p *Provider) GetScanProvider(lang string) (scan.ScanProvider, 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 RemoteApp

type RemoteApp struct {
	No            int    `json:"no"`
	RemoteAppName string `xorm:"varchar(100)" json:"remoteAppName"`
	RemoteAppDir  string `xorm:"varchar(100)" json:"remoteAppDir"`
	RemoteAppArgs string `xorm:"varchar(100)" json:"remoteAppArgs"`
}

type ResourceMetrics

type ResourceMetrics struct {
	CPUUsage         string  `json:"cpuUsage"`         // CPU usage (e.g., "120m" for 120 millicores)
	CPUPercentage    float64 `json:"cpuPercentage"`    // CPU usage percentage (0-100)
	MemoryUsage      string  `json:"memoryUsage"`      // Memory usage (e.g., "256Mi" for 256 mebibyte)
	MemoryPercentage float64 `json:"memoryPercentage"` // Memory usage percentage (0-100)
	PodCount         int     `json:"podCount"`         // Number of active pods
}

ResourceMetrics represents resource usage metrics

type ResourceRequests

type ResourceRequests struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
}

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 Scan

type Scan 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(200)" json:"displayName"`

	TargetMode    string `xorm:"varchar(100)" json:"targetMode"`
	Target        string `xorm:"varchar(100)" json:"target"`
	Asset         string `xorm:"varchar(100)" json:"asset"`
	Provider      string `xorm:"varchar(100)" json:"provider"`
	State         string `xorm:"varchar(100)" json:"state"`
	Runner        string `xorm:"varchar(100)" json:"runner"`
	ErrorText     string `xorm:"mediumtext" json:"errorText"`
	Command       string `xorm:"varchar(500)" json:"command"`
	RawResult     string `xorm:"mediumtext" json:"rawResult"`
	Result        string `xorm:"mediumtext" json:"result"`
	ResultSummary string `xorm:"varchar(500)" json:"resultSummary"`
}

func GetPaginationScans

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

func GetPendingScans

func GetPendingScans() ([]*Scan, error)

GetPendingScans returns all scans with state "Pending"

func GetScan

func GetScan(id string) (*Scan, error)

func GetScans

func GetScans(owner string) ([]*Scan, error)

func GetScansByAsset

func GetScansByAsset(owner string, assetName string) ([]*Scan, error)

func (*Scan) GetId

func (scan *Scan) GetId() string

type ScanResult

type ScanResult struct {
	RawResult     string `json:"rawResult"`
	Result        string `json:"result"`
	ResultSummary string `json:"resultSummary"`
	Runner        string `json:"runner"`
}

ScanResult represents the result of a scan operation

func ScanAsset

func ScanAsset(provider, scanParam, targetMode, target, asset, command string, saveToScan bool, lang string) (*ScanResult, error)

ScanAsset performs a scan on an asset @param provider: The provider ID (owner/name) for scan provider @param scan: Optional scan ID (owner/name) for saving results to existing scan @param targetMode: "Manual Input" or "Asset" @param target: IP address or network range (for Manual Input mode) @param asset: Asset name for Asset mode @param command: Scan command with optional %s placeholder for target @param saveToScan: Whether to save results to scan object (true for scan edit page, false for provider edit page)

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 Service

type Service struct {
	No             int    `json:"no"`
	Name           string `json:"name"`
	Path           string `json:"path"`
	Port           int    `json:"port"`
	ProcessId      int    `json:"processId"`
	ExpectedStatus string `json:"expectedStatus"`
	Status         string `json:"status"`
	SubStatus      string `json:"subStatus"`
	Message        string `json:"message"`
}

type ServiceDetail

type ServiceDetail struct {
	Name         string        `json:"name"`
	Type         string        `json:"type"`
	ClusterIP    string        `json:"clusterIP"`
	ExternalIP   string        `json:"externalIP"`
	Ports        []ServicePort `json:"ports"`
	InternalHost string        `json:"internalHost"`
	ExternalHost string        `json:"externalHost"`
	CreatedTime  string        `json:"createdTime"`
}

type ServicePort

type ServicePort struct {
	Name     string `json:"name"`
	Port     int32  `json:"port"`
	NodePort int32  `json:"nodePort,omitempty"`
	Protocol string `json:"protocol"`
	URL      string `json:"url,omitempty"`
}

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 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"`
	AgentProvider        string   `xorm:"varchar(100)" json:"agentProvider"`
	ToolProviders        []string `xorm:"mediumtext" json:"toolProviders"`
	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"`
	ThemeColor          string            `xorm:"varchar(100)" json:"themeColor"`
	Avatar              string            `xorm:"varchar(200)" json:"avatar"`
	Title               string            `xorm:"varchar(100)" json:"title"`
	HtmlTitle           string            `xorm:"varchar(100)" json:"htmlTitle"`
	FaviconUrl          string            `xorm:"varchar(200)" json:"faviconUrl"`
	LogoUrl             string            `xorm:"varchar(200)" json:"logoUrl"`
	FooterHtml          string            `xorm:"mediumtext" json:"footerHtml"`
	NavItems            []string          `xorm:"text" json:"navItems"`
	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 StreamRecv

type StreamRecv struct {
	Id string `json:"id"`
}

type StreamResponse

type StreamResponse struct {
	MsgType string      `json:"msgtype"`
	Stream  *StreamSend `json:"stream"`
}

type StreamSend

type StreamSend struct {
	ID      string    `json:"id,omitempty"`
	Finish  bool      `json:"finish"`
	Content string    `json:"content,omitempty"`
	MsgItem []MsgItem `json:"msg_item,omitempty"`
}

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 Template

type Template 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"`
	Description string `xorm:"varchar(255)" json:"description"`
	Version     string `xorm:"varchar(50)" json:"version"`
	Icon        string `xorm:"varchar(255)" json:"icon"`
	Manifest    string `xorm:"mediumtext" json:"manifest"`
	Readme      string `xorm:"mediumtext" json:"readme"`

	EnableBasicConfig  bool                   `xorm:"bool" json:"enableBasicConfig"`
	BasicConfigOptions []templateConfigOption `xorm:"json" json:"basicConfigOptions"`
}

func GetPaginationTemplates

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

func GetTemplate

func GetTemplate(id string) (*Template, error)

func GetTemplates

func GetTemplates(owner string) ([]*Template, error)

func (*Template) Render

func (t *Template) Render(data map[string]interface{}) (string, error)

Render the template with the given data.

type TextMessage

type TextMessage struct {
	Content string `json:"content"`
}

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 GetUsageMetadata

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

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 VpcDetail

type VpcDetail struct {
	VpcId       string
	CidrBlock   string
	VRouterId   string
	IsDefault   bool
	Status      string
	Description string
}

VpcDetail holds detailed information for a VPC

type WecomBotMessage

type WecomBotMessage struct {
	MsgId    string        `json:"msgid"`
	AIBotId  string        `json:"aibotid"`
	ChatId   string        `json:"chatid,omitempty"`
	ChatType string        `json:"chattype"`
	From     *FromUser     `json:"from"`
	MsgType  string        `json:"msgtype"`
	Text     *TextMessage  `json:"text,omitempty"`
	Image    *ImageMessage `json:"image,omitempty"`
	Stream   *StreamRecv   `json:"stream,omitempty"`
}

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