models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ID         string    `json:"id"`
	Type       string    `json:"type"`
	Token      string    `json:"token"`
	LastUsedAt *UnixTime `json:"last_used_at"`
	CreatedAt  UnixTime  `json:"created_at"`
}

APIKey API密钥

type APIKeyListResponse

type APIKeyListResponse struct {
	Data []APIKey `json:"data"`
}

APIKeyListResponse API密钥列表响应

type AccessMode

type AccessMode string

AccessMode 访问模式

const (
	AccessModePublic  AccessMode = "public"
	AccessModePrivate AccessMode = "private"
)

type AgentThought

type AgentThought struct {
	ID              string                 `json:"id"`
	MessageID       string                 `json:"message_id"`
	Position        int                    `json:"position"`
	Thought         string                 `json:"thought"`
	Tool            string                 `json:"tool"`
	ToolInput       map[string]interface{} `json:"tool_input"`
	ToolOutput      string                 `json:"tool_output"`
	CreatedAt       UnixTime               `json:"created_at"`
	MessageFiles    []MessageFile          `json:"message_files"`
	ToolProcessData map[string]interface{} `json:"tool_process_data"`
}

AgentThought Agent思考过程

type AppExportResponse

type AppExportResponse struct {
	Data string `json:"data"`
}

AppExportResponse 应用导出响应

type AppInfo

type AppInfo struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
	Mode        AppMode  `json:"mode"`
	AuthorName  string   `json:"author_name"`
}

AppInfo 应用基本信息

type AppMeta

type AppMeta struct {
	ToolIcons map[string]string `json:"tool_icons"`
}

AppMeta 应用元数据

type AppMode

type AppMode string

AppMode 应用模式

const (
	AppModeCompletion   AppMode = "completion"
	AppModeChat         AppMode = "chat"
	AppModeAgentChat    AppMode = "agent-chat"
	AppModeAdvancedChat AppMode = "advanced-chat"
	AppModeWorkflow     AppMode = "workflow"
)

type AppParameters

type AppParameters struct {
	OpeningStatement              string                 `json:"opening_statement,omitempty"`
	SuggestedQuestions            []interface{}          `json:"suggested_questions,omitempty"`
	SuggestedQuestionsAfterAnswer map[string]interface{} `json:"suggested_questions_after_answer,omitempty"`
	SpeechToText                  map[string]interface{} `json:"speech_to_text,omitempty"`
	TextToSpeech                  map[string]interface{} `json:"text_to_speech,omitempty"`
	RetrieverResource             map[string]interface{} `json:"retriever_resource,omitempty"`
	AnnotationReply               map[string]interface{} `json:"annotation_reply,omitempty"`
	MoreLikeThis                  map[string]interface{} `json:"more_like_this,omitempty"`
	UserInputForm                 []interface{}          `json:"user_input_form"`
	SensitiveWordAvoidance        map[string]interface{} `json:"sensitive_word_avoidance,omitempty"`
	FileUpload                    map[string]interface{} `json:"file_upload,omitempty"`
	SystemParameters              *SystemParameters      `json:"system_parameters,omitempty"`
}

AppParameters 应用参数

type AppSite

type AppSite struct {
	AccessToken            string `json:"access_token"`
	Code                   string `json:"code"`
	Title                  string `json:"title"`
	Icon                   string `json:"icon"`
	IconBackground         string `json:"icon_background"`
	Description            string `json:"description"`
	DefaultLanguage        string `json:"default_language"`
	ChatColorTheme         string `json:"chat_color_theme"`
	ChatColorThemeInverted bool   `json:"chat_color_theme_inverted"`
	CustomDisclaimer       string `json:"custom_disclaimer"`
	CustomizeTokenStrategy string `json:"customize_token_strategy"`
	PromptPublic           bool   `json:"prompt_public"`
	Copyright              string `json:"copyright"`
	PrivacyPolicy          string `json:"privacy_policy"`
	ShowWorkflowSteps      bool   `json:"show_workflow_steps"`
}

AppSite 应用站点信息

type AppTag

type AppTag struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

AppTag 应用标签

type AppTraceConfig

type AppTraceConfig struct {
	Enabled         bool   `json:"enabled"`
	TracingProvider string `json:"tracing_provider"`
}

AppTraceConfig 应用追踪配置

type ConsoleApp

type ConsoleApp struct {
	ID             string     `json:"id"`
	Name           string     `json:"name"`
	Description    string     `json:"description"`
	Mode           AppMode    `json:"mode"`
	IconType       string     `json:"icon_type,omitempty"`
	Icon           string     `json:"icon,omitempty"`
	IconBackground string     `json:"icon_background,omitempty"`
	EnableSite     bool       `json:"enable_site"`
	EnableAPI      bool       `json:"enable_api"`
	CreatedAt      UnixTime   `json:"created_at"`
	UpdatedAt      UnixTime   `json:"updated_at"`
	TenantID       string     `json:"tenant_id"`
	Site           *AppSite   `json:"site,omitempty"`
	APIBaseURL     string     `json:"api_base_url,omitempty"`
	Tags           []AppTag   `json:"tags"`
	AccessMode     AccessMode `json:"access_mode,omitempty"`
}

ConsoleApp Console应用信息

type ConsoleAppDetail

type ConsoleAppDetail struct {
	ID                  string        `json:"id"`
	Name                string        `json:"name"`
	Description         string        `json:"description"`
	Mode                string        `json:"mode"`
	IconType            string        `json:"icon_type"`
	Icon                string        `json:"icon"`
	IconBackground      string        `json:"icon_background"`
	IconURL             *string       `json:"icon_url"`
	EnableSite          bool          `json:"enable_site"`
	EnableAPI           bool          `json:"enable_api"`
	ModelConfig         interface{}   `json:"model_config"`
	Workflow            *WorkflowInfo `json:"workflow"`
	Site                *SiteInfo     `json:"site"`
	APIBaseURL          string        `json:"api_base_url"`
	UseIconAsAnswerIcon bool          `json:"use_icon_as_answer_icon"`
	CreatedBy           string        `json:"created_by"`
	CreatedAt           UnixTime      `json:"created_at"`
	UpdatedBy           *string       `json:"updated_by"`
	UpdatedAt           UnixTime      `json:"updated_at"`
	DeletedTools        []interface{} `json:"deleted_tools"`
	AccessMode          *string       `json:"access_mode"`
}

ConsoleAppDetail 控制台应用详情

type ConsoleAppListResponse

type ConsoleAppListResponse struct {
	Data    []ConsoleApp `json:"data"`
	HasMore bool         `json:"has_more"`
	Limit   int          `json:"limit"`
	Total   int          `json:"total"`
	Page    int          `json:"page"`
}

ConsoleAppListResponse Console应用列表响应

type Conversation

type Conversation struct {
	ID           string                 `json:"id"`
	Name         string                 `json:"name"`
	Inputs       map[string]interface{} `json:"inputs"`
	Introduction string                 `json:"introduction"`
	CreatedAt    UnixTime               `json:"created_at"`
	UpdatedAt    UnixTime               `json:"updated_at"`
}

Conversation 对话结构

type ConversationListResponse

type ConversationListResponse struct {
	InfiniteScrollPagination
	Data []Conversation `json:"data"`
}

ConversationListResponse 对话列表响应

type ConversationOperationResponse

type ConversationOperationResponse struct {
	Result string `json:"result"`
}

ConversationOperationResponse 对话操作响应

type ConversationRenameRequest

type ConversationRenameRequest struct {
	Name         *string `json:"name,omitempty"`
	AutoGenerate bool    `json:"auto_generate,omitempty"`
}

ConversationRenameRequest 对话重命名请求

type CopyAppRequest

type CopyAppRequest struct {
	Name           string `json:"name,omitempty"`
	Description    string `json:"description,omitempty"`
	IconType       string `json:"icon_type,omitempty"`
	Icon           string `json:"icon,omitempty"`
	IconBackground string `json:"icon_background,omitempty"`
}

CopyAppRequest 复制应用请求

type CreateAppRequest

type CreateAppRequest struct {
	Name           string  `json:"name"`
	Description    string  `json:"description,omitempty"`
	Mode           AppMode `json:"mode"`
	IconType       string  `json:"icon_type,omitempty"`
	Icon           string  `json:"icon,omitempty"`
	IconBackground string  `json:"icon_background,omitempty"`
}

CreateAppRequest 创建应用请求

type CreateDatasetForAPIRequest

type CreateDatasetForAPIRequest struct {
	Name                   string                 `json:"name"`
	Description            string                 `json:"description,omitempty"`
	IndexingTechnique      string                 `json:"indexing_technique,omitempty"`
	Permission             string                 `json:"permission,omitempty"`
	ExternalKnowledgeAPI   map[string]interface{} `json:"external_knowledge_api,omitempty"`
	ExternalKnowledgeID    string                 `json:"external_knowledge_id,omitempty"`
	ExternalRetrievalModel map[string]interface{} `json:"external_retrieval_model,omitempty"`
}

CreateDatasetForAPIRequest Service API创建数据集请求

type CreateDatasetRequest

type CreateDatasetRequest struct {
	Name                   string                 `json:"name"`
	Description            string                 `json:"description,omitempty"`
	Permission             string                 `json:"permission,omitempty"`
	IndexingTechnique      string                 `json:"indexing_technique,omitempty"`
	EmbeddingModel         string                 `json:"embedding_model,omitempty"`
	EmbeddingModelProvider string                 `json:"embedding_model_provider,omitempty"`
	RetrievalModel         map[string]interface{} `json:"retrieval_model,omitempty"`
}

CreateDatasetRequest 创建数据集请求

type CreateDocumentByFileRequest

type CreateDocumentByFileRequest struct {
	Name              string `json:"name"`
	Description       string `json:"description,omitempty"`
	DocForm           string `json:"doc_form,omitempty"`
	DocLanguage       string `json:"doc_language,omitempty"`
	IndexingTechnique string `json:"indexing_technique,omitempty"`
}

CreateDocumentByFileRequest 通过文件创建文档请求

type CreateDocumentByTextRequest

type CreateDocumentByTextRequest struct {
	Name              string `json:"name"`
	Description       string `json:"description,omitempty"`
	Content           string `json:"content"`
	DocForm           string `json:"doc_form,omitempty"`
	DocLanguage       string `json:"doc_language,omitempty"`
	IndexingTechnique string `json:"indexing_technique,omitempty"`
}

CreateDocumentByTextRequest 通过文本创建文档请求

type CreateMetadataRequest

type CreateMetadataRequest struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

CreateMetadataRequest 创建元数据请求

type CreateSegmentsRequest

type CreateSegmentsRequest struct {
	Segments []SegmentData `json:"segments"`
}

CreateSegmentsRequest 创建分段请求

type Dataset

type Dataset struct {
	ID                     string                 `json:"id"`
	Name                   string                 `json:"name"`
	Description            string                 `json:"description"`
	Permission             string                 `json:"permission"`
	DataSourceType         string                 `json:"data_source_type"`
	IndexingTechnique      string                 `json:"indexing_technique"`
	CreatedBy              string                 `json:"created_by"`
	CreatedAt              UnixTime               `json:"created_at"`
	UpdatedAt              UnixTime               `json:"updated_at"`
	DocumentCount          int                    `json:"document_count"`
	WordCount              int                    `json:"word_count"`
	AppCount               int                    `json:"app_count"`
	EmbeddingModel         string                 `json:"embedding_model"`
	EmbeddingModelProvider string                 `json:"embedding_model_provider"`
	EmbeddingAvailable     bool                   `json:"embedding_available"`
	RetrievalModelDict     map[string]interface{} `json:"retrieval_model_dict"`
	Tags                   []string               `json:"tags"`
	PartialMemberList      []PartialMember        `json:"partial_member_list"`
}

Dataset 数据集

type DatasetDocument

type DatasetDocument struct {
	ID                 string                 `json:"id"`
	Position           int                    `json:"position"`
	DataSourceType     string                 `json:"data_source_type"`
	DataSourceInfo     map[string]interface{} `json:"data_source_info"`
	DatasetProcessRule map[string]interface{} `json:"dataset_process_rule"`
	Name               string                 `json:"name"`
	CreatedFrom        string                 `json:"created_from"`
	CreatedBy          string                 `json:"created_by"`
	CreatedAt          UnixTime               `json:"created_at"`
	Tokens             int                    `json:"tokens"`
	IndexingStatus     string                 `json:"indexing_status"`
	Error              string                 `json:"error,omitempty"`
	Enabled            bool                   `json:"enabled"`
	DisabledAt         *UnixTime              `json:"disabled_at"`
	DisabledBy         string                 `json:"disabled_by,omitempty"`
	Archived           bool                   `json:"archived"`
	DisplayStatus      string                 `json:"display_status"`
	WordCount          int                    `json:"word_count"`
	HitCount           int                    `json:"hit_count"`
}

DatasetDocument 数据集文档

type DatasetForAPI

type DatasetForAPI struct {
	ID                     string                 `json:"id"`
	Name                   string                 `json:"name"`
	Description            string                 `json:"description"`
	Permission             string                 `json:"permission"`
	DataSourceType         string                 `json:"data_source_type"`
	IndexingTechnique      string                 `json:"indexing_technique"`
	AppCount               int                    `json:"app_count"`
	DocumentCount          int                    `json:"document_count"`
	WordCount              int                    `json:"word_count"`
	CreatedBy              string                 `json:"created_by"`
	CreatedAt              UnixTime               `json:"created_at"`
	UpdatedAt              UnixTime               `json:"updated_at"`
	EmbeddingModel         string                 `json:"embedding_model,omitempty"`
	EmbeddingModelProvider string                 `json:"embedding_model_provider,omitempty"`
	EmbeddingAvailable     bool                   `json:"embedding_available"`
	RetrievalModelDict     map[string]interface{} `json:"retrieval_model_dict,omitempty"`
	Tags                   []string               `json:"tags"`
}

DatasetForAPI Service API数据集结构

type DatasetListForAPIResponse

type DatasetListForAPIResponse struct {
	Data    []DatasetForAPI `json:"data"`
	HasMore bool            `json:"has_more"`
	Limit   int             `json:"limit"`
	Total   int             `json:"total"`
	Page    int             `json:"page"`
}

DatasetListForAPIResponse Service API数据集列表响应

type DatasetListResponse

type DatasetListResponse struct {
	Data    []Dataset `json:"data"`
	HasMore bool      `json:"has_more"`
	Limit   int       `json:"limit"`
	Total   int       `json:"total"`
	Page    int       `json:"page"`
}

DatasetListResponse 数据集列表响应

type Document

type Document struct {
	ID             string   `json:"id"`
	Name           string   `json:"name"`
	DatasetID      string   `json:"dataset_id"`
	DocumentType   string   `json:"document_type"`
	DataSourceType string   `json:"data_source_type"`
	CreatedBy      string   `json:"created_by"`
	CreatedAt      UnixTime `json:"created_at"`
	UpdatedBy      *string  `json:"updated_by"`
	UpdatedAt      UnixTime `json:"updated_at"`
}

Document 文档结构

type DocumentForAPI

type DocumentForAPI struct {
	ID                    string    `json:"id"`
	Name                  string    `json:"name"`
	Description           string    `json:"description"`
	DataSourceType        string    `json:"data_source_type"`
	DocForm               string    `json:"doc_form"`
	DocLanguage           string    `json:"doc_language"`
	IndexingTechnique     string    `json:"indexing_technique"`
	CreatedBy             string    `json:"created_by"`
	CreatedAt             UnixTime  `json:"created_at"`
	UpdatedAt             UnixTime  `json:"updated_at"`
	SegmentCount          int       `json:"segment_count"`
	WordCount             int       `json:"word_count"`
	Status                string    `json:"status"`
	ErrorMessage          string    `json:"error_message,omitempty"`
	HitCount              int       `json:"hit_count"`
	DisplayStatus         string    `json:"display_status"`
	IndexingStatus        string    `json:"indexing_status"`
	CompletedAt           *UnixTime `json:"completed_at,omitempty"`
	ErrorCount            int       `json:"error_count"`
	CompletedSegmentCount int       `json:"completed_segment_count"`
	IsEmpty               bool      `json:"is_empty"`
	IsPaused              bool      `json:"is_paused"`
	IsArchived            bool      `json:"is_archived"`
	IsDeleted             bool      `json:"is_deleted"`
}

DocumentForAPI API文档

type DocumentListResponse

type DocumentListResponse struct {
	Data    []DatasetDocument `json:"data"`
	HasMore bool              `json:"has_more"`
	Limit   int               `json:"limit"`
	Total   int               `json:"total"`
	Page    int               `json:"page"`
}

DocumentListResponse 文档列表响应

type DocumentMetadata

type DocumentMetadata struct {
	ID         string   `json:"id"`
	DocumentID string   `json:"document_id"`
	DatasetID  string   `json:"dataset_id"`
	Key        string   `json:"key"`
	Value      string   `json:"value"`
	CreatedBy  string   `json:"created_by"`
	CreatedAt  UnixTime `json:"created_at"`
	UpdatedBy  *string  `json:"updated_by"`
	UpdatedAt  UnixTime `json:"updated_at"`
}

DocumentMetadata 文档元数据

type DocumentSegment

type DocumentSegment struct {
	ID          string    `json:"id"`
	Position    int       `json:"position"`
	DocumentID  string    `json:"document_id"`
	Content     string    `json:"content"`
	Answer      string    `json:"answer,omitempty"`
	WordCount   int       `json:"word_count"`
	Tokens      int       `json:"tokens"`
	Keywords    []string  `json:"keywords"`
	Index       int       `json:"index"`
	HitCount    int       `json:"hit_count"`
	Enabled     bool      `json:"enabled"`
	DisabledAt  *UnixTime `json:"disabled_at"`
	DisabledBy  string    `json:"disabled_by,omitempty"`
	Status      string    `json:"status"`
	CreatedBy   string    `json:"created_by"`
	CreatedAt   UnixTime  `json:"created_at"`
	IndexingAt  *UnixTime `json:"indexing_at"`
	CompletedAt *UnixTime `json:"completed_at"`
	Error       string    `json:"error,omitempty"`
	StoppedAt   *UnixTime `json:"stopped_at"`
}

DocumentSegment 文档片段

type DraftWorkflowRequest

type DraftWorkflowRequest struct {
	Graph    map[string]interface{} `json:"graph"`
	Features map[string]interface{} `json:"features"`
	Hash     string                 `json:"hash,omitempty"`
}

DraftWorkflowRequest 草稿工作流请求

type FileTypeConfig

type FileTypeConfig struct {
	Enabled    bool     `json:"enabled"`
	Number     int      `json:"number_limits,omitempty"`
	Extensions []string `json:"extensions,omitempty"`
	FileSize   int      `json:"file_size_limit,omitempty"`
}

FileTypeConfig 文件类型配置

type FileUpload

type FileUpload struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Size      int64    `json:"size"`
	Extension string   `json:"extension"`
	MimeType  string   `json:"mime_type"`
	CreatedBy string   `json:"created_by"`
	CreatedAt UnixTime `json:"created_at"`
	URL       string   `json:"url,omitempty"`
}

FileUpload 文件上传结构

type FileUploadConfig

type FileUploadConfig map[string]interface{}

FileUploadConfig 文件上传配置 (保持灵活性)

type GenerateResponse

type GenerateResponse struct {
	Event          string                 `json:"event,omitempty"`
	MessageID      string                 `json:"message_id,omitempty"`
	ConversationID string                 `json:"conversation_id,omitempty"`
	Mode           string                 `json:"mode,omitempty"`
	Answer         string                 `json:"answer,omitempty"`
	Metadata       map[string]interface{} `json:"metadata,omitempty"`
	CreatedAt      int64                  `json:"created_at,omitempty"`
	TaskID         string                 `json:"task_id,omitempty"`
	ID             string                 `json:"id,omitempty"`

	// 流式响应字段
	Delta string `json:"delta,omitempty"`

	// 错误字段
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
	Status  int    `json:"status,omitempty"`
}

GenerateResponse 生成响应(用于completion和chat)

type HitTestRecord

type HitTestRecord struct {
	Index      int       `json:"index"`
	Position   int       `json:"position"`
	Source     string    `json:"source"`
	Score      float64   `json:"score"`
	Title      string    `json:"title"`
	Content    string    `json:"content"`
	TSNEVector []float64 `json:"tsne_position,omitempty"`
}

HitTestRecord 命中测试记录

type HitTestingRequest

type HitTestingRequest struct {
	Query                  string                 `json:"query"`
	RetrievalModel         map[string]interface{} `json:"retrieval_model,omitempty"`
	ExternalRetrievalModel map[string]interface{} `json:"external_retrieval_model,omitempty"`
}

HitTestingRequest 命中测试请求

type HitTestingResponse

type HitTestingResponse struct {
	Query   string          `json:"query"`
	Records []HitTestRecord `json:"records"`
}

HitTestingResponse 命中测试响应

type HitTestingResult

type HitTestingResult struct {
	SegmentID   string  `json:"segment_id"`
	DocumentID  string  `json:"document_id"`
	Content     string  `json:"content"`
	Answer      string  `json:"answer"`
	Score       float64 `json:"score"`
	DatasetID   string  `json:"dataset_id"`
	DatasetName string  `json:"dataset_name"`
}

HitTestingResult 命中测试结果

type InfiniteScrollPagination

type InfiniteScrollPagination struct {
	Limit   int  `json:"limit"`
	HasMore bool `json:"has_more"`
}

InfiniteScrollPagination 无限滚动分页

type LoginRequest

type LoginRequest struct {
	Email       string `json:"email"`
	Password    string `json:"password"`
	RememberMe  bool   `json:"remember_me,omitempty"`
	InviteToken string `json:"invite_token,omitempty"`
	Language    string `json:"language,omitempty"`
}

LoginRequest 登录请求

type LoginResponse

type LoginResponse struct {
	Result string      `json:"result"`
	Data   interface{} `json:"data,omitempty"`
	Code   string      `json:"code,omitempty"`
}

LoginResponse 登录响应

type Message

type Message struct {
	ID                 string                 `json:"id"`
	ConversationID     string                 `json:"conversation_id"`
	ParentMessageID    string                 `json:"parent_message_id,omitempty"`
	Inputs             map[string]interface{} `json:"inputs"`
	Query              string                 `json:"query"`
	Answer             string                 `json:"answer"`
	MessageFiles       []MessageFile          `json:"message_files"`
	Feedback           *MessageFeedback       `json:"feedback"`
	RetrieverResources []RetrieverResource    `json:"retriever_resources"`
	CreatedAt          UnixTime               `json:"created_at"`
	AgentThoughts      []AgentThought         `json:"agent_thoughts"`
	Metadata           map[string]interface{} `json:"metadata"`
	Status             string                 `json:"status"`
	Error              string                 `json:"error,omitempty"`
}

Message 消息结构

type MessageFeedback

type MessageFeedback struct {
	Rating  string `json:"rating"`
	Content string `json:"content,omitempty"`
}

MessageFeedback 消息反馈

type MessageFeedbackRequest

type MessageFeedbackRequest struct {
	Rating  *string `json:"rating,omitempty"` // "like", "dislike"
	Content *string `json:"content,omitempty"`
}

MessageFeedbackRequest 消息反馈请求

type MessageFile

type MessageFile struct {
	ID        string `json:"id"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	BelongsTo string `json:"belongs_to"`
}

MessageFile 消息文件

type MessageListResponse

type MessageListResponse struct {
	InfiniteScrollPagination
	Data []Message `json:"data"`
}

MessageListResponse 消息列表响应

type MetadataForAPI

type MetadataForAPI struct {
	ID        string   `json:"id"`
	DatasetID string   `json:"dataset_id"`
	Key       string   `json:"key"`
	Value     string   `json:"value"`
	CreatedAt UnixTime `json:"created_at"`
	UpdatedAt UnixTime `json:"updated_at"`
}

MetadataForAPI API元数据

type MetadataListResponse

type MetadataListResponse struct {
	Data    []MetadataForAPI `json:"data"`
	HasMore bool             `json:"has_more"`
	Limit   int              `json:"limit"`
	Total   int              `json:"total"`
	Page    int              `json:"page"`
}

MetadataListResponse 元数据列表响应

type NumberConfig

type NumberConfig struct {
	Label       string  `json:"label"`
	Variable    string  `json:"variable"`
	Required    bool    `json:"required"`
	Default     float64 `json:"default"`
	Description string  `json:"description,omitempty"`
	Min         float64 `json:"min,omitempty"`
	Max         float64 `json:"max,omitempty"`
}

NumberConfig 数字配置

type OperationResponse

type OperationResponse struct {
	Result string `json:"result"`
}

OperationResponse 通用操作响应

type PaginationResponse

type PaginationResponse struct {
	Page    int  `json:"page"`
	Limit   int  `json:"limit"`
	Total   int  `json:"total"`
	HasMore bool `json:"has_more"`
}

PaginationResponse 分页响应基础结构

type ParagraphConfig

type ParagraphConfig struct {
	Label       string `json:"label"`
	Variable    string `json:"variable"`
	Required    bool   `json:"required"`
	Default     string `json:"default"`
	Description string `json:"description,omitempty"`
}

ParagraphConfig 段落配置

type PartialMember

type PartialMember struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Email      string   `json:"email"`
	LastActive UnixTime `json:"last_active_at"`
}

PartialMember 部分成员

type PluginDebuggingKeyResponse

type PluginDebuggingKeyResponse struct {
	Key  string `json:"key"`
	Host string `json:"host"`
	Port string `json:"port"`
}

PluginDebuggingKeyResponse 用于接收调试密钥接口返回值

type PluginDynamicOption

type PluginDynamicOption map[string]any

type PluginFetchDynamicSelectOptionsResponse

type PluginFetchDynamicSelectOptionsResponse struct {
	Options []PluginDynamicOption `json:"options"`
}

PluginFetchDynamicSelectOptionsResponse 用于接收动态选项接口返回值 TODO: PluginDynamicOption 需根据实际字段细化

type PluginFetchInstallTaskResponse

type PluginFetchInstallTaskResponse struct {
	Task PluginInstallTask `json:"task"`
}

PluginFetchInstallTaskResponse 用于接收单个插件安装任务接口返回值 TODO: PluginInstallTask 需根据实际字段细化

type PluginFetchInstallTasksResponse

type PluginFetchInstallTasksResponse struct {
	Tasks []PluginInstallTask `json:"tasks"`
}

PluginFetchInstallTasksResponse 用于接收插件安装任务列表接口返回值 TODO: PluginInstallTask 需根据实际字段细化

type PluginFetchManifestResponse

type PluginFetchManifestResponse struct {
	Manifest PluginManifest `json:"manifest"`
}

PluginFetchManifestResponse 用于接收插件 manifest 接口返回值 TODO: PluginManifest 需根据实际字段细化

type PluginFetchPermissionResponse

type PluginFetchPermissionResponse struct {
	InstallPermission string `json:"install_permission"`
	DebugPermission   string `json:"debug_permission"`
}

PluginFetchPermissionResponse 用于接收插件权限接口返回值

type PluginInstallResponse

type PluginInstallResponse struct {
	AllInstalled bool   `json:"all_installed"`
	TaskID       string `json:"task_id"`
}

PluginInstallResponse 用于接收插件安装相关接口返回值 TODO: 根据实际返回字段细化

type PluginInstallTask

type PluginInstallTask map[string]any

type PluginInstallationItem

type PluginInstallationItem map[string]any

PluginInstallationItem 需根据实际字段定义,暂用 map 占位 TODO: 根据实际字段细化

type PluginItem

type PluginItem struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	Icon          string `json:"icon"`
	LatestVersion string `json:"latest_version"`
	Status        string `json:"status"`
	CreatedAt     string `json:"created_at"`
	UpdatedAt     string `json:"updated_at"`
}

PluginItem 需根据实际插件字段定义,暂用 map 占位 TODO: 根据实际字段细化

type PluginListInstallationsFromIdsResponse

type PluginListInstallationsFromIdsResponse struct {
	Plugins []PluginInstallationItem `json:"plugins"`
}

PluginListInstallationsFromIdsResponse 用于接收根据ID获取插件安装信息接口返回值

type PluginListLatestVersionsResponse

type PluginListLatestVersionsResponse struct {
	Versions []PluginVersionItem `json:"versions"`
}

PluginListLatestVersionsResponse 用于接收插件最新版本列表接口返回值

type PluginListResponse

type PluginListResponse struct {
	Plugins []PluginItem `json:"plugins"`
	Total   int          `json:"total"`
}

PluginListResponse 用于接收插件列表接口返回值

type PluginManifest

type PluginManifest map[string]any

type PluginSimpleSuccessResponse

type PluginSimpleSuccessResponse struct {
	Success bool `json:"success"`
}

PluginSimpleSuccessResponse 用于接收仅返回 success 字段的接口

type PluginUploadResponse

type PluginUploadResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
}

PluginUploadResponse 用于接收插件上传相关接口返回值 TODO: 根据实际返回字段细化

type PluginVersionItem

type PluginVersionItem map[string]any

PluginVersionItem 需根据实际字段定义,暂用 map 占位 TODO: 根据实际字段细化

type ResponseMode

type ResponseMode string

ResponseMode 响应模式

const (
	ResponseModeBlocking  ResponseMode = "blocking"
	ResponseModeStreaming ResponseMode = "streaming"
)

type ResultResponse

type ResultResponse struct {
	Result string `json:"result"`
}

ResultResponse 结果响应

type RetrieverResource

type RetrieverResource struct {
	Position       int     `json:"position"`
	DatasetID      string  `json:"dataset_id"`
	DatasetName    string  `json:"dataset_name"`
	DocumentID     string  `json:"document_id"`
	DocumentName   string  `json:"document_name"`
	DataSourceType string  `json:"data_source_type"`
	SegmentID      string  `json:"segment_id"`
	Score          float64 `json:"score"`
	Content        string  `json:"content"`
}

RetrieverResource 检索资源

type SegmentData

type SegmentData struct {
	Content string `json:"content"`
	Answer  string `json:"answer,omitempty"`
}

SegmentData 分段数据

type SegmentForAPI

type SegmentForAPI struct {
	ID             string    `json:"id"`
	DocumentID     string    `json:"document_id"`
	DocumentName   string    `json:"document_name"`
	DatasetID      string    `json:"dataset_id"`
	DatasetName    string    `json:"dataset_name"`
	Content        string    `json:"content"`
	Answer         string    `json:"answer"`
	WordCount      int       `json:"word_count"`
	CharCount      int       `json:"char_count"`
	Position       int       `json:"position"`
	IsEmpty        bool      `json:"is_empty"`
	HitCount       int       `json:"hit_count"`
	IndexingStatus string    `json:"indexing_status"`
	CompletedAt    *UnixTime `json:"completed_at,omitempty"`
	ErrorMessage   string    `json:"error_message,omitempty"`
	CreatedAt      UnixTime  `json:"created_at"`
	UpdatedAt      UnixTime  `json:"updated_at"`
}

SegmentForAPI API分段

type SegmentListResponse

type SegmentListResponse struct {
	Data    []DocumentSegment `json:"data"`
	HasMore bool              `json:"has_more"`
	Limit   int               `json:"limit"`
	Total   int               `json:"total"`
	Page    int               `json:"page"`
}

SegmentListResponse 片段列表响应

type SelectConfig

type SelectConfig struct {
	Label       string               `json:"label"`
	Variable    string               `json:"variable"`
	Required    bool                 `json:"required"`
	Default     string               `json:"default"`
	Description string               `json:"description,omitempty"`
	Options     []SelectOptionConfig `json:"options"`
}

SelectConfig 选择配置

type SelectOptionConfig

type SelectOptionConfig struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

SelectOptionConfig 选择选项配置

type SetupRequest

type SetupRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Name     string `json:"name"`
}

SetupRequest 安装请求

type SetupStatus

type SetupStatus string
const (
	SetupStatusFinished   SetupStatus = "finished"
	SetupStatusNotStarted SetupStatus = "not_started"
)

type SimpleConversation

type SimpleConversation struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

SimpleConversation 简单对话信息

type SiteInfo

type SiteInfo struct {
	AccessToken            string   `json:"access_token"`
	Code                   string   `json:"code"`
	Title                  string   `json:"title"`
	IconType               string   `json:"icon_type"`
	Icon                   string   `json:"icon"`
	IconBackground         string   `json:"icon_background"`
	IconURL                *string  `json:"icon_url"`
	Description            *string  `json:"description"`
	DefaultLanguage        string   `json:"default_language"`
	ChatColorTheme         *string  `json:"chat_color_theme"`
	ChatColorThemeInverted bool     `json:"chat_color_theme_inverted"`
	CustomizeDomain        *string  `json:"customize_domain"`
	Copyright              *string  `json:"copyright"`
	PrivacyPolicy          *string  `json:"privacy_policy"`
	CustomDisclaimer       string   `json:"custom_disclaimer"`
	CustomizeTokenStrategy string   `json:"customize_token_strategy"`
	PromptPublic           bool     `json:"prompt_public"`
	AppBaseURL             string   `json:"app_base_url"`
	ShowWorkflowSteps      bool     `json:"show_workflow_steps"`
	UseIconAsAnswerIcon    bool     `json:"use_icon_as_answer_icon"`
	CreatedBy              string   `json:"created_by"`
	CreatedAt              UnixTime `json:"created_at"`
	UpdatedBy              string   `json:"updated_by"`
	UpdatedAt              UnixTime `json:"updated_at"`
}

SiteInfo 站点信息

type StatusResponse

type StatusResponse struct {
	Step    SetupStatus `json:"step"`
	SetupAt *string     `json:"setup_at"`
}

StatusResponse 状态响应

type SuggestedQuestionsResponse

type SuggestedQuestionsResponse struct {
	Data []string `json:"data"`
}

SuggestedQuestionsResponse 建议问题响应

type SystemParameters

type SystemParameters struct {
	ImageFileSizeLimit      int `json:"image_file_size_limit,omitempty"`
	VideoFileSizeLimit      int `json:"video_file_size_limit,omitempty"`
	AudioFileSizeLimit      int `json:"audio_file_size_limit,omitempty"`
	FileSizeLimit           int `json:"file_size_limit,omitempty"`
	WorkflowFileUploadLimit int `json:"workflow_file_upload_limit,omitempty"`
}

SystemParameters 系统参数

type Tag

type Tag struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Type      string   `json:"type"`
	CreatedBy string   `json:"created_by"`
	CreatedAt UnixTime `json:"created_at"`
}

Tag 标签

type TagListResponse

type TagListResponse struct {
	Data []Tag `json:"data"`
}

TagListResponse 标签列表响应

type TextInputConfig

type TextInputConfig struct {
	Label       string `json:"label"`
	Variable    string `json:"variable"`
	Required    bool   `json:"required"`
	Default     string `json:"default"`
	Description string `json:"description,omitempty"`
	MaxLength   int    `json:"max_length,omitempty"`
}

TextInputConfig 文本输入配置

type UnixTime

type UnixTime struct {
	time.Time
}

UnixTime 自定义时间类型,用于处理Dify API返回的Unix时间戳

func (UnixTime) MarshalJSON

func (ut UnixTime) MarshalJSON() ([]byte, error)

MarshalJSON 序列化为Unix时间戳

func (*UnixTime) UnmarshalJSON

func (ut *UnixTime) UnmarshalJSON(data []byte) error

UnmarshalJSON 从Unix时间戳反序列化

type UpdateAppAPIStatusRequest

type UpdateAppAPIStatusRequest struct {
	EnableAPI bool `json:"enable_api"`
}

UpdateAppAPIStatusRequest 更新应用API状态请求

type UpdateAppIconRequest

type UpdateAppIconRequest struct {
	Icon           string `json:"icon,omitempty"`
	IconBackground string `json:"icon_background,omitempty"`
}

UpdateAppIconRequest 更新应用图标请求

type UpdateAppNameRequest

type UpdateAppNameRequest struct {
	Name string `json:"name"`
}

UpdateAppNameRequest 更新应用名称请求

type UpdateAppRequest

type UpdateAppRequest struct {
	Name                string `json:"name"`
	Description         string `json:"description,omitempty"`
	IconType            string `json:"icon_type,omitempty"`
	Icon                string `json:"icon,omitempty"`
	IconBackground      string `json:"icon_background,omitempty"`
	UseIconAsAnswerIcon bool   `json:"use_icon_as_answer_icon,omitempty"`
}

UpdateAppRequest 更新应用请求

type UpdateAppSiteStatusRequest

type UpdateAppSiteStatusRequest struct {
	EnableSite bool `json:"enable_site"`
}

UpdateAppSiteStatusRequest 更新应用站点状态请求

type UpdateAppTraceRequest

type UpdateAppTraceRequest struct {
	Enabled         bool   `json:"enabled"`
	TracingProvider string `json:"tracing_provider"`
}

UpdateAppTraceRequest 更新应用追踪请求

type UpdateDatasetRequest

type UpdateDatasetRequest struct {
	Name           string                 `json:"name,omitempty"`
	Description    string                 `json:"description,omitempty"`
	Permission     string                 `json:"permission,omitempty"`
	RetrievalModel map[string]interface{} `json:"retrieval_model,omitempty"`
}

UpdateDatasetRequest 更新数据集请求

type UpdateDocumentByFileRequest

type UpdateDocumentByFileRequest struct {
	Name              string `json:"name,omitempty"`
	Description       string `json:"description,omitempty"`
	DocForm           string `json:"doc_form,omitempty"`
	DocLanguage       string `json:"doc_language,omitempty"`
	IndexingTechnique string `json:"indexing_technique,omitempty"`
}

UpdateDocumentByFileRequest 通过文件更新文档请求

type UpdateDocumentByTextRequest

type UpdateDocumentByTextRequest struct {
	Name              string `json:"name,omitempty"`
	Description       string `json:"description,omitempty"`
	Content           string `json:"content"`
	DocForm           string `json:"doc_form,omitempty"`
	DocLanguage       string `json:"doc_language,omitempty"`
	IndexingTechnique string `json:"indexing_technique,omitempty"`
}

UpdateDocumentByTextRequest 通过文本更新文档请求

type UpdateMetadataRequest

type UpdateMetadataRequest struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

UpdateMetadataRequest 更新元数据请求

type UpdateSegmentRequest

type UpdateSegmentRequest struct {
	Content string `json:"content"`
	Answer  string `json:"answer,omitempty"`
}

UpdateSegmentRequest 更新分段请求

type UserInputFormItem

type UserInputFormItem map[string]interface{}

UserInputFormItem 用户输入表单项 (原始格式,保持灵活性)

type Version

type Version struct {
	Version       string `json:"version"`
	ReleaseDate   string `json:"release_date"`
	ReleaseNotes  string `json:"release_notes"`
	CanAutoUpdate bool   `json:"can_auto_update"`
	Features      struct {
		CanReplaceLogo            bool `json:"can_replace_logo"`
		ModelLoadBalancingEnabled bool `json:"model_load_balancing_enabled"`
	} `json:"features"`
}

Version Dify版本信息

type WebAppAccessMode

type WebAppAccessMode struct {
	AccessMode AccessMode `json:"accessMode"`
}

WebAppAccessMode Web应用访问模式响应

type WebAppPermission

type WebAppPermission struct {
	Result bool `json:"result"`
}

WebAppPermission Web应用权限响应

type Workflow

type Workflow struct {
	ID          string                 `json:"id"`
	AppID       string                 `json:"app_id"`
	Type        string                 `json:"type"`
	Version     string                 `json:"version"`
	Graph       map[string]interface{} `json:"graph"`
	Features    map[string]interface{} `json:"features"`
	CreatedBy   string                 `json:"created_by"`
	CreatedAt   UnixTime               `json:"created_at"`
	UpdatedBy   string                 `json:"updated_by"`
	UpdatedAt   UnixTime               `json:"updated_at"`
	Environment string                 `json:"environment"`
}

Workflow 工作流

type WorkflowImportRequest

type WorkflowImportRequest struct {
	Data string `json:"data"`
	Name string `json:"name,omitempty"`
}

WorkflowImportRequest 工作流导入请求

type WorkflowInfo

type WorkflowInfo struct {
	ID        string   `json:"id"`
	CreatedBy string   `json:"created_by"`
	CreatedAt UnixTime `json:"created_at"`
	UpdatedBy *string  `json:"updated_by"`
	UpdatedAt UnixTime `json:"updated_at"`
}

WorkflowInfo 工作流信息

type WorkflowNodeExecution

type WorkflowNodeExecution struct {
	ID                string                 `json:"id"`
	Index             int                    `json:"index"`
	NodeID            string                 `json:"node_id"`
	NodeType          string                 `json:"node_type"`
	Title             string                 `json:"title"`
	Inputs            map[string]interface{} `json:"inputs"`
	ProcessData       map[string]interface{} `json:"process_data"`
	Outputs           map[string]interface{} `json:"outputs"`
	Status            string                 `json:"status"`
	Error             string                 `json:"error,omitempty"`
	ElapsedTime       float64                `json:"elapsed_time"`
	ExecutionMetadata map[string]interface{} `json:"execution_metadata"`
	CreatedAt         UnixTime               `json:"created_at"`
	FinishedAt        *UnixTime              `json:"finished_at"`
}

WorkflowNodeExecution 工作流节点执行

type WorkflowPublishRequest

type WorkflowPublishRequest struct {
	Description string `json:"description,omitempty"`
}

WorkflowPublishRequest 工作流发布请求

type WorkflowRun

type WorkflowRun struct {
	ID             string                  `json:"id"`
	WorkflowID     string                  `json:"workflow_id"`
	TriggerUser    string                  `json:"trigger_user"`
	Status         string                  `json:"status"`
	Inputs         map[string]interface{}  `json:"inputs"`
	Outputs        map[string]interface{}  `json:"outputs"`
	Error          string                  `json:"error,omitempty"`
	ElapsedTime    float64                 `json:"elapsed_time"`
	TotalTokens    int                     `json:"total_tokens"`
	TotalSteps     int                     `json:"total_steps"`
	CreatedAt      UnixTime                `json:"created_at"`
	FinishedAt     *UnixTime               `json:"finished_at"`
	NodeExecutions []WorkflowNodeExecution `json:"node_executions"`
}

WorkflowRun 工作流运行记录

type WorkflowRunListResponse

type WorkflowRunListResponse struct {
	Data    []WorkflowRun `json:"data"`
	HasMore bool          `json:"has_more"`
	Limit   int           `json:"limit"`
	Total   int           `json:"total"`
	Page    int           `json:"page"`
}

WorkflowRunListResponse 工作流运行列表响应

type WorkflowRunRequest

type WorkflowRunRequest struct {
	Inputs map[string]interface{}   `json:"inputs"`
	Files  []map[string]interface{} `json:"files,omitempty"`
}

WorkflowRunRequest 工作流运行请求

type WorkflowRunResponse

type WorkflowRunResponse struct {
	WorkflowRunID string                 `json:"workflow_run_id"`
	TaskID        string                 `json:"task_id"`
	Data          map[string]interface{} `json:"data"`
	Event         string                 `json:"event"`
	CreatedAt     UnixTime               `json:"created_at"`
}

WorkflowRunResponse 工作流运行响应

type WorkflowStopResponse

type WorkflowStopResponse struct {
	Result string `json:"result"`
}

WorkflowStopResponse 工作流停止响应

Jump to

Keyboard shortcuts

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