Ajout de SEARXNG pour les recherches web
This commit is contained in:
1 parent
87eeb41364
commit
345129c7bf
30 files changed
+919
-166
No files matched your search
@@ -66,11 +66,19 @@ type ChatParams struct {
|
||||
OnChunk StreamCallback
|
||||
}
|
||||
|
||||
type Tool interface {
|
||||
type ToolParam struct {
|
||||
JsonName string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Description string `json:"description"`
|
||||
Mandatory bool `json:"mandatory"`
|
||||
}
|
||||
|
||||
type ITool interface {
|
||||
Name() string
|
||||
Description() string
|
||||
Params() []ToolParam
|
||||
Definition(ctx context.Context) *ToolDefinition
|
||||
Execute(ctx context.Context, input []byte) ([]byte, error)
|
||||
Execute(ctx context.Context, input []byte, configuration string) ([]byte, error)
|
||||
}
|
||||
|
||||
type ToolDefinition struct {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type Tool struct {
|
||||
ID string `db:"id" json:"id"`
|
||||
TeamID string `db:"team_id" json:"teamId"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Enabled bool `db:"enabled" json:"enabled"`
|
||||
Configuration string `db:"configuration" json:"configuration"`
|
||||
DateCreated time.Time `db:"_date_created" json:"_date_created"`
|
||||
DateUpdated *time.Time `db:"_date_updated" json:"_date_updated"`
|
||||
VersionId string `db:"_version" json:"_version"`
|
||||
}
|
||||
|
||||
type ToolRepository interface {
|
||||
ListTools(userID string, teamID string) ([]*Tool, error)
|
||||
GetToolByName(userID string, teamID string, name string) (*Tool, error)
|
||||
GetToolByID(userID string, teamID string, id string) (*Tool, error)
|
||||
CreateTool(userID string, agent *Tool) (*Tool, error)
|
||||
UpdateTool(userID string, agent *Tool) (*Tool, error)
|
||||
DeleteTool(userID string, teamID string, name string) error
|
||||
}
|
||||
Reference in new issue
Block a user