Documentation
¶
Overview ¶
Copyright 2023 - Present, Pengfei Ni
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 - Present, Pengfei Ni ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 - Present, Pengfei Ni ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 - Present, Pengfei Ni ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 - Present, Pengfei Ni ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 - Present, Pengfei Ni ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func GetMCPTools(configFile string, verbose bool) (map[string]Tool, map[string]client.MCPClient, error)
- func GetToolPrompt() string
- func GoogleSearch(query string) (string, error)
- func InitTools(mcpConfigFile string, disableKubectl, verbose bool) (map[string]client.MCPClient, error)
- func Kubectl(command string) (string, error)
- func PythonREPL(script string) (string, error)
- func Trivy(image string) (string, error)
- type GoogleSearchTool
- type KubectlTool
- type MCPConfig
- type MCPServer
- type MCPTool
- type PythonREPLTool
- type Tool
- type TrivyTool
Constants ¶
This section is empty.
Variables ¶
var CopilotTools = map[string]Tool{ "trivy": TrivyTool{}, "kubectl": KubectlTool{}, }
CopilotTools is a map of tool names to tools.
Functions ¶
func GetMCPTools ¶ added in v0.6.10
func GetMCPTools(configFile string, verbose bool) (map[string]Tool, map[string]client.MCPClient, error)
GetMCPTools returns the MCP tools.
func GetToolPrompt ¶ added in v0.6.10
func GetToolPrompt() string
GetToolPrompt returns the tool prompt.
func GoogleSearch ¶
GoogleSearch returns the results of a Google search for the given query.
func InitTools ¶ added in v0.6.10
func InitTools(mcpConfigFile string, disableKubectl, verbose bool) (map[string]client.MCPClient, error)
InitTools initializes the tools.
func PythonREPL ¶
PythonREPL runs the given Python script and returns the output.
Types ¶
type GoogleSearchTool ¶ added in v0.6.10
type GoogleSearchTool struct{}
GoogleSearchTool performs web searches using the Google Search API.
func (GoogleSearchTool) Description ¶ added in v0.6.10
func (g GoogleSearchTool) Description() string
Description returns the description of the tool.
func (GoogleSearchTool) InputSchema ¶ added in v0.6.10
func (g GoogleSearchTool) InputSchema() string
InputSchema returns the input schema for the tool.
type KubectlTool ¶ added in v0.6.10
type KubectlTool struct{}
KubectlTool executes kubectl commands against a Kubernetes cluster.
func (KubectlTool) Description ¶ added in v0.6.10
func (k KubectlTool) Description() string
Description returns the description of the tool.
func (KubectlTool) InputSchema ¶ added in v0.6.10
func (k KubectlTool) InputSchema() string
InputSchema returns the input schema for the tool.
type MCPServer ¶ added in v0.6.10
type MCPServer struct { Type string `json:"type,omitempty"` Command string `json:"command,omitempty"` Args []string `json:"args,omitempty"` URL string `json:"url,omitempty"` Env map[string]string `json:"env,omitempty"` Headers map[string]string `json:"headers,omitempty"` Timeout int `json:"timeout,omitempty"` }
MCPServer is the configuration for a single MCP server.
type MCPTool ¶ added in v0.6.10
type MCPTool struct {
// contains filtered or unexported fields
}
MCPTool is a tool that uses the MCP protocol.
func (MCPTool) Description ¶ added in v0.6.10
Description returns the description of the tool.
func (MCPTool) InputSchema ¶ added in v0.6.10
InputSchema returns the input schema for the tool.
type PythonREPLTool ¶ added in v0.6.10
type PythonREPLTool struct{}
PythonREPLTool executes Python code in a REPL environment.
func (PythonREPLTool) Description ¶ added in v0.6.10
func (p PythonREPLTool) Description() string
Description returns the description of the tool.
func (PythonREPLTool) InputSchema ¶ added in v0.6.10
func (p PythonREPLTool) InputSchema() string
InputSchema returns the input schema for the tool.
type Tool ¶
type Tool interface { Description() string InputSchema() string ToolFunc(input string) (string, error) }
Tool is an interface that defines the methods for a tool.
type TrivyTool ¶ added in v0.6.10
type TrivyTool struct{}
TrivyTool scans container images for vulnerabilities using Trivy.
func (TrivyTool) Description ¶ added in v0.6.10
Description returns the description of the tool.
func (TrivyTool) InputSchema ¶ added in v0.6.10
InputSchema returns the input schema for the tool.