feat(go-agent): Ported retrieval node, added Keenable web search tool (#16396)

Ported retrieval node, added Keenable web search tool
- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Zhichang Yu
2026-06-26 22:55:49 +08:00
committed by GitHub
parent 9d18f33296
commit 70546ea406
91 changed files with 5920 additions and 3817 deletions

View File

@@ -55,36 +55,36 @@ func (FileCommitItem) TableName() string {
// TreeNode represents a file node in the commit tree state snapshot.
type TreeNode struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // "file" or "folder"
Hash string `json:"hash,omitempty"`
Location string `json:"location,omitempty"`
Size int64 `json:"size,omitempty"`
Status string `json:"status"` // "1" = active, "0" = deleted
Children []*TreeNode `json:"children,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // "file" or "folder"
Hash string `json:"hash,omitempty"`
Location string `json:"location,omitempty"`
Size int64 `json:"size,omitempty"`
Status string `json:"status"` // "1" = active, "0" = deleted
Children []*TreeNode `json:"children,omitempty"`
}
// FileChange represents a file change in a commit request.
type FileChange struct {
FileID string `json:"file_id"`
FileName string `json:"file_name"`
FileID string `json:"file_id"`
FileName string `json:"file_name"`
Operation string `json:"operation"` // "add", "modify", "delete", "rename"
Content string `json:"content,omitempty"`
OldName string `json:"old_name,omitempty"`
NewName string `json:"new_name,omitempty"`
Content string `json:"content,omitempty"`
OldName string `json:"old_name,omitempty"`
NewName string `json:"new_name,omitempty"`
}
// CommitResponse is the API response for a commit.
type CommitResponse struct {
ID string `json:"id"`
FolderID string `json:"folder_id"`
ParentID *string `json:"parent_id,omitempty"`
Message string `json:"message"`
AuthorID string `json:"author_id"`
FileCount int `json:"file_count"`
TreeState *string `json:"tree_state,omitempty"`
CreateTime *int64 `json:"create_time,omitempty"`
ID string `json:"id"`
FolderID string `json:"folder_id"`
ParentID *string `json:"parent_id,omitempty"`
Message string `json:"message"`
AuthorID string `json:"author_id"`
FileCount int `json:"file_count"`
TreeState *string `json:"tree_state,omitempty"`
CreateTime *int64 `json:"create_time,omitempty"`
}
// DiffEntry represents a single diff entry between two commits.
@@ -100,9 +100,9 @@ type DiffEntry struct {
// VersionEntry represents a single version in a file's version history.
type VersionEntry struct {
CommitID string `json:"commit_id"`
Operation string `json:"operation"`
Hash string `json:"hash"`
CreateTime *int64 `json:"create_time,omitempty"`
Message string `json:"message"`
CommitID string `json:"commit_id"`
Operation string `json:"operation"`
Hash string `json:"hash"`
CreateTime *int64 `json:"create_time,omitempty"`
Message string `json:"message"`
}

View File

@@ -364,4 +364,3 @@ func (a *AvianModel) ListTasks(apiConfig *APIConfig) ([]ListTaskStatus, error) {
func (a *AvianModel) ShowTask(taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", a.Name())
}

View File

@@ -44,18 +44,18 @@ func DefaultFieldConfig() FieldConfig {
// SkillSearchConfig represents the search configuration for skills
type SkillSearchConfig struct {
ID string `gorm:"column:id;primaryKey;size:32" json:"id"`
TenantID string `gorm:"column:tenant_id;size:32;not null;index" json:"tenant_id"`
SpaceID string `gorm:"column:space_id;size:128;not null;default:'default';index" json:"space_id"`
EmbdID string `gorm:"column:embd_id;size:128;not null" json:"embd_id"`
Status string `gorm:"column:status;size:1;default:1" json:"status"`
VectorSimilarityWeight float64 `gorm:"column:vector_similarity_weight;default:0.3" json:"vector_similarity_weight"`
SimilarityThreshold float64 `gorm:"column:similarity_threshold;default:0.2" json:"similarity_threshold"`
FieldConfig JSONMap `gorm:"column:field_config;type:json" json:"field_config"`
RerankID *string `gorm:"column:rerank_id;size:128" json:"rerank_id,omitempty"`
TenantRerankID *int64 `gorm:"column:tenant_rerank_id" json:"tenant_rerank_id,omitempty"`
TopK int64 `gorm:"column:top_k;default:10" json:"top_k"`
IndexVersion string `gorm:"column:index_version;size:32;default:'1.0.0'" json:"index_version"`
ID string `gorm:"column:id;primaryKey;size:32" json:"id"`
TenantID string `gorm:"column:tenant_id;size:32;not null;index" json:"tenant_id"`
SpaceID string `gorm:"column:space_id;size:128;not null;default:'default';index" json:"space_id"`
EmbdID string `gorm:"column:embd_id;size:128;not null" json:"embd_id"`
Status string `gorm:"column:status;size:1;default:1" json:"status"`
VectorSimilarityWeight float64 `gorm:"column:vector_similarity_weight;default:0.3" json:"vector_similarity_weight"`
SimilarityThreshold float64 `gorm:"column:similarity_threshold;default:0.2" json:"similarity_threshold"`
FieldConfig JSONMap `gorm:"column:field_config;type:json" json:"field_config"`
RerankID *string `gorm:"column:rerank_id;size:128" json:"rerank_id,omitempty"`
TenantRerankID *int64 `gorm:"column:tenant_rerank_id" json:"tenant_rerank_id,omitempty"`
TopK int64 `gorm:"column:top_k;default:10" json:"top_k"`
IndexVersion string `gorm:"column:index_version;size:32;default:'1.0.0'" json:"index_version"`
BaseModel
}
@@ -69,7 +69,7 @@ func (s *SkillSearchConfig) ToMap() map[string]interface{} {
result := map[string]interface{}{
"id": s.ID,
"tenant_id": s.TenantID,
"space_id": s.SpaceID,
"space_id": s.SpaceID,
"embd_id": s.EmbdID,
"vector_similarity_weight": s.VectorSimilarityWeight,
"similarity_threshold": s.SimilarityThreshold,

View File

@@ -27,15 +27,15 @@ const (
// SkillSpace represents a skills space (library) that contains skills
type SkillSpace struct {
ID string `gorm:"column:id;primaryKey;size:32" json:"id"`
TenantID string `gorm:"column:tenant_id;size:32;not null;index" json:"tenant_id"`
Name string `gorm:"column:name;size:128;not null" json:"name"`
FolderID string `gorm:"column:folder_id;size:32;not null" json:"folder_id"`
Description string `gorm:"column:description;type:text" json:"description"`
EmbdID string `gorm:"column:embd_id;size:128" json:"embd_id"`
RerankID string `gorm:"column:rerank_id;size:128" json:"rerank_id"`
TopK int `gorm:"column:top_k;default:10" json:"top_k"`
Status string `gorm:"column:status;size:1;default:1" json:"status"`
ID string `gorm:"column:id;primaryKey;size:32" json:"id"`
TenantID string `gorm:"column:tenant_id;size:32;not null;index" json:"tenant_id"`
Name string `gorm:"column:name;size:128;not null" json:"name"`
FolderID string `gorm:"column:folder_id;size:32;not null" json:"folder_id"`
Description string `gorm:"column:description;type:text" json:"description"`
EmbdID string `gorm:"column:embd_id;size:128" json:"embd_id"`
RerankID string `gorm:"column:rerank_id;size:128" json:"rerank_id"`
TopK int `gorm:"column:top_k;default:10" json:"top_k"`
Status string `gorm:"column:status;size:1;default:1" json:"status"`
BaseModel
}
@@ -61,12 +61,12 @@ func (s *SkillSpace) StatusDescription() string {
// ToMap converts SkillSpace to a map for JSON response
func (s *SkillSpace) ToMap() map[string]interface{} {
result := map[string]interface{}{
"id": s.ID,
"tenant_id": s.TenantID,
"name": s.Name,
"folder_id": s.FolderID,
"top_k": s.TopK,
"status": s.StatusDescription(),
"id": s.ID,
"tenant_id": s.TenantID,
"name": s.Name,
"folder_id": s.FolderID,
"top_k": s.TopK,
"status": s.StatusDescription(),
}
if s.Description != "" {