models

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIModelInstallation

type AIModelInstallation struct {
	Model
	Provider               string `json:"provider" gorm:"column:provider;size:127;index;not null"`
	TenantID               string `json:"tenant_id" gorm:"column:tenant_id;type:uuid;index;not null"`
	PluginUniqueIdentifier string `json:"plugin_unique_identifier" gorm:"index;size:255"`
	PluginID               string `json:"plugin_id" gorm:"index;size:255"`
}

type AgentStrategyInstallation

type AgentStrategyInstallation struct {
	Model
	TenantID               string `json:"tenant_id" gorm:"column:tenant_id;type:uuid;index;not null"`
	Provider               string `json:"provider" gorm:"column:provider;size:127;index;not null"`
	PluginUniqueIdentifier string `json:"plugin_unique_identifier" gorm:"index;size:255"`
	PluginID               string `json:"plugin_id" gorm:"index;size:255"`
}

type Endpoint

type Endpoint struct {
	Model
	Name        string                                       `json:"name" gorm:"size:127;column:name;default:'default'"`
	HookID      string                                       `json:"hook_id" gorm:"unique;size:127;column:hook_id"`
	TenantID    string                                       `json:"tenant_id" gorm:"index;size:64;column:tenant_id"`
	UserID      string                                       `json:"user_id" gorm:"index;size:64;column:user_id"`
	PluginID    string                                       `json:"plugin_id" gorm:"index;size:64;column:plugin_id"`
	ExpiredAt   time.Time                                    `json:"expired_at" gorm:"column:expired_at"`
	Enabled     bool                                         `json:"enabled" gorm:"column:enabled"`
	Settings    map[string]any                               `json:"settings" gorm:"column:settings;serializer:json"`
	Declaration *plugin_entities.EndpointProviderDeclaration `json:"declaration" gorm:"-"` // not stored in db
}

HookID is a pointer to plugin id and tenant id, using it to identify the endpoint plugin

type InstallTask

type InstallTask struct {
	Model
	Status           InstallTaskStatus         `json:"status" gorm:"not null"`
	TenantID         string                    `json:"tenant_id" gorm:"type:uuid;not null"`
	TotalPlugins     int                       `json:"total_plugins" gorm:"not null"`
	CompletedPlugins int                       `json:"completed_plugins" gorm:"not null"`
	Plugins          []InstallTaskPluginStatus `json:"plugins" gorm:"serializer:json"`
}

type InstallTaskPluginStatus

type InstallTaskPluginStatus struct {
	PluginUniqueIdentifier plugin_entities.PluginUniqueIdentifier `json:"plugin_unique_identifier"`
	Labels                 plugin_entities.I18nObject             `json:"labels"`
	Icon                   string                                 `json:"icon"`
	PluginID               string                                 `json:"plugin_id"`
	Status                 InstallTaskStatus                      `json:"status"`
	Message                string                                 `json:"message"`
}

type InstallTaskStatus

type InstallTaskStatus string
const (
	InstallTaskStatusPending InstallTaskStatus = "pending"
	InstallTaskStatusRunning InstallTaskStatus = "running"
	InstallTaskStatusSuccess InstallTaskStatus = "success"
	InstallTaskStatusFailed  InstallTaskStatus = "failed"
)

type Model

type Model struct {
	ID        string    `gorm:"column:id;primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Plugin

type Plugin struct {
	Model
	// PluginUniqueIdentifier is a unique identifier for the plugin, it contains version and checksum
	PluginUniqueIdentifier string `json:"plugin_unique_identifier" gorm:"index;size:255"`
	// PluginID is the id of the plugin, only plugin name is considered
	PluginID          string                             `json:"id" gorm:"index;size:255"`
	Refers            int                                `json:"refers" gorm:"default:0"`
	InstallType       plugin_entities.PluginRuntimeType  `json:"install_type" gorm:"size:127;index"`
	ManifestType      manifest_entities.DifyManifestType `json:"manifest_type" gorm:"size:127"`
	RemoteDeclaration plugin_entities.PluginDeclaration  `json:"remote_declaration" gorm:"serializer:json;type:text;size:65535"` // enabled when plugin is remote
}

type PluginDeclaration

type PluginDeclaration struct {
	Model
	PluginUniqueIdentifier string                            `json:"plugin_unique_identifier" gorm:"size:255;unique"`
	PluginID               string                            `json:"plugin_id" gorm:"size:255;index"`
	Declaration            plugin_entities.PluginDeclaration `json:"declaration" gorm:"serializer:json;type:text;size:65535"`
}

type PluginInstallation

type PluginInstallation struct {
	Model
	TenantID               string         `json:"tenant_id" gorm:"index;type:uuid;"`
	PluginID               string         `json:"plugin_id" gorm:"index;size:255"`
	PluginUniqueIdentifier string         `json:"plugin_unique_identifier" gorm:"index;size:255"`
	RuntimeType            string         `json:"runtime_type" gorm:"size:127"`
	EndpointsSetups        int            `json:"endpoints_setups"`
	EndpointsActive        int            `json:"endpoints_active"`
	Source                 string         `json:"source" gorm:"column:source;size:63"`
	Meta                   map[string]any `json:"meta" gorm:"column:meta;serializer:json"`
}

type PluginInstallationStatus

type PluginInstallationStatus string

type ServerlessRuntime

type ServerlessRuntime struct {
	Model
	PluginUniqueIdentifier string                `json:"plugin_unique_identifier" gorm:"size:255;unique"`
	FunctionURL            string                `json:"function_url" gorm:"size:255"`
	FunctionName           string                `json:"function_name" gorm:"size:127"`
	Type                   ServerlessRuntimeType `json:"type" gorm:"size:127"`
	Checksum               string                `json:"checksum" gorm:"size:127;index"`
}

type ServerlessRuntimeType

type ServerlessRuntimeType string
const (
	SERVERLESS_RUNTIME_TYPE_SERVERLESS ServerlessRuntimeType = "serverless"
)

type TenantStorage

type TenantStorage struct {
	Model
	TenantID string `gorm:"column:tenant_id;type:varchar(255);not null;index"`
	PluginID string `gorm:"column:plugin_id;type:varchar(255);not null;index"`
	Size     int64  `gorm:"column:size;type:bigint;not null"`
}

type ToolInstallation

type ToolInstallation struct {
	Model
	TenantID               string `json:"tenant_id" gorm:"column:tenant_id;type:uuid;index;not null"`
	Provider               string `json:"provider" gorm:"column:provider;size:127;index;not null"`
	PluginUniqueIdentifier string `json:"plugin_unique_identifier" gorm:"index;size:255"`
	PluginID               string `json:"plugin_id" gorm:"index;size:255"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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