Documentation
¶
Index ¶
- Constants
- Variables
- func LoadKnowledgeBaseTool(knowledge *knowledgebase.KnowledgeBase) (tool.Tool, error)
- func LoadLongMemoryTool() (tool.Tool, error)
- func NewImageGenerateTool(config *ImageGenerateConfig) (tool.Tool, error)
- func NewLLMShieldPlugins() (*plugin.Plugin, error)
- func NewMcpRouter() tool.Toolset
- func NewRunCodeSandboxTool() (tool.Tool, error)
- func NewVideoGenerateTool(config *VideoGenerateConfig) (tool.Tool, error)
- type Args
- type Decision
- type DecisionDetail
- type GenerateImagesRequest
- type GenerateVideosRequest
- type ImageGenerateConfig
- type ImageGenerateToolChanelMessage
- type ImageGenerateToolRequest
- type ImageGenerateToolResult
- type ImageResult
- type KnowledgeBaseResult
- type LLMShieldClient
- type LLMShieldData
- type LLMShieldResult
- type Matches
- type PermitInfo
- type QueryKnowledgeReq
- type ReplaceDetail
- type ResponseMetadata
- type Result
- type RiskInfo
- type Risks
- type RunCodeArgs
- type VideoGenerateConfig
- type VideoGenerateResult
- type VideoGenerateToolChanelMessage
- type VideoGenerateToolRequest
- type VideoResult
Constants ¶
View Source
const ( ImageGenerateSuccessStatus = "success" ImageGenerateErrorStatus = "error" )
View Source
const ( DefaultScheme = "https" DefaultTimeout = 600 )
View Source
const ( VideoGenerateSuccessStatus = "success" VideoGenerateErrorStatus = "error" )
Variables ¶
View Source
var ( ErrInvalidAppID = errors.New("LLM Shield App ID is not configured. Please configure it via environment TOOL_LLM_SHIELD_APP_ID") ErrInvalidApiKey = errors.New("LLM Shield auth invalid, Please configure it via environment TOOL_LLM_SHIELD_API_KEY or VOLCENGINE_ACCESS_KEY and VOLCENGINE_SECRET_KEY") )
View Source
var CategoryMap = map[string]string{
"101": "Model Misuse",
"103": "Sensitive Information",
"104": "Prompt Injection",
"106": "General Topic Control",
"107": "Computational Resource Consumption",
}
View Source
var ErrInvalidToolID = errors.New("agentkit tool id is invalid")
Functions ¶
func LoadKnowledgeBaseTool ¶
func LoadKnowledgeBaseTool(knowledge *knowledgebase.KnowledgeBase) (tool.Tool, error)
LoadKnowledgeBaseTool Loads the knowledgebase tools from a backend. Args: query: The query to load the knowledgebase for. Returns: A list of knowledge base results.
func LoadLongMemoryTool ¶
func NewImageGenerateTool ¶
func NewImageGenerateTool(config *ImageGenerateConfig) (tool.Tool, error)
func NewLLMShieldPlugins ¶ added in v0.0.5
func NewMcpRouter ¶ added in v0.0.3
func NewRunCodeSandboxTool ¶ added in v0.0.2
func NewVideoGenerateTool ¶
func NewVideoGenerateTool(config *VideoGenerateConfig) (tool.Tool, error)
Types ¶
type Args ¶
type Args struct {
Query string `json:"query" jsonschema:"The query to search for in the memory."`
}
type Decision ¶ added in v0.0.5
type Decision struct {
DecisionType int `json:"DecisionType"`
DecisionDetail *DecisionDetail `json:"DecisionDetail"`
HitStrategyIDs []string `json:"HitStrategyIDs"`
}
type DecisionDetail ¶ added in v0.0.5
type DecisionDetail struct {
BlockDetail map[string]interface{} `json:"BlockDetail"`
ReplaceDetail *ReplaceDetail `json:"ReplaceDetail"`
}
type GenerateImagesRequest ¶
type GenerateImagesRequest struct {
TaskType string `json:"task_type"`
Prompt string `json:"prompt"`
Size string `json:"size,omitempty"`
ResponseFormat string `json:"response_format,omitempty"`
Watermark *bool `json:"watermark,omitempty"`
Image interface{} `json:"image,omitempty"`
SequentialImageGeneration string `json:"sequential_image_generation,omitempty"`
MaxImages int `json:"max_images,omitempty"`
}
type GenerateVideosRequest ¶
type ImageGenerateConfig ¶
type ImageGenerateToolChanelMessage ¶
type ImageGenerateToolChanelMessage struct {
Status string
ErrorMessage string
Result *ImageResult
}
type ImageGenerateToolRequest ¶
type ImageGenerateToolRequest struct {
Tasks []GenerateImagesRequest `json:"tasks"`
}
type ImageGenerateToolResult ¶
type ImageGenerateToolResult struct {
SuccessList []*ImageResult `json:"success_list,omitempty"`
ErrorList []*ImageResult `json:"error_list,omitempty"`
Status string
}
type ImageResult ¶
type KnowledgeBaseResult ¶
type KnowledgeBaseResult struct {
Result []ktypes.KnowledgeEntry `json:"result,omitempty"`
}
type LLMShieldClient ¶ added in v0.0.5
func NewLLMShieldClient ¶ added in v0.0.5
func NewLLMShieldClient(timeout int) (*LLMShieldClient, error)
type LLMShieldData ¶ added in v0.0.5
type LLMShieldResult ¶ added in v0.0.5
type LLMShieldResult struct {
ResponseMetadata *ResponseMetadata `json:"ResponseMetadata"`
Result *LLMShieldData `json:"Result"`
}
type PermitInfo ¶ added in v0.0.5
type PermitInfo struct {
Permits interface{} `json:"Permits"`
}
type QueryKnowledgeReq ¶
type QueryKnowledgeReq struct {
Query string `json:"query" jsonschema:"The query for loading the knowledge base for this tools"`
}
type ReplaceDetail ¶ added in v0.0.5
type ReplaceDetail struct {
Replacement interface{} `json:"Replacement"`
}
type ResponseMetadata ¶ added in v0.0.5
type RunCodeArgs ¶ added in v0.0.2
type RunCodeArgs struct {
Code string `json:"code" jsonschema:"The code to run."`
Language string `json:"language" jsonschema:"The programming language of the code. Language must be one of the supported languages: python3."`
Timeout uint `json:"timeout" jsonschema:"The timeout in seconds for the code execution. Defaults to 30."`
}
type VideoGenerateConfig ¶
type VideoGenerateResult ¶
type VideoGenerateResult struct {
SuccessList []*VideoResult `json:"success_list,omitempty"`
ErrorList []*VideoResult `json:"error_list,omitempty"`
Status string
}
type VideoGenerateToolChanelMessage ¶
type VideoGenerateToolChanelMessage struct {
Status string
ErrorMessage string
Result *VideoResult
}
type VideoGenerateToolRequest ¶
type VideoGenerateToolRequest struct {
Params []GenerateVideosRequest `json:"params"`
BatchSize int `json:"batch_size,omitempty"`
}
type VideoResult ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.