Documentation
¶
Index ¶
- func ToolCallsToJSONString(tools []openai.ChatCompletionMessageToolCall) (string, error)
- type Agent
- func (agent *Agent) ChatCompletion() (string, error)
- func (agent *Agent) ChatCompletionStream(callBack func(self *Agent, content string, err error) error) (string, error)
- func (agent *Agent) ExecuteMCPToolCalls() ([]string, error)
- func (agent *Agent) ExecuteToolCalls(toolsImpl map[string]func(any) (any, error)) ([]string, error)
- func (agent *Agent) ToolsCompletion() ([]openai.ChatCompletionMessageToolCall, error)
- type AgentOption
- func WithDMRClient(ctx context.Context, baseURL string) AgentOption
- func WithMCPClient(command STDIOCommandOption) AgentOption
- func WithMCPTools(tools []string) AgentOption
- func WithParams(params openai.ChatCompletionNewParams) AgentOption
- func WithTools(tools []openai.ChatCompletionToolParam) AgentOption
- type STDIOCommandOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToolCallsToJSONString ¶
func ToolCallsToJSONString(tools []openai.ChatCompletionMessageToolCall) (string, error)
Types ¶
type Agent ¶
type Agent struct {
Params openai.ChatCompletionNewParams
Tools []openai.ChatCompletionToolParam
ToolCalls []openai.ChatCompletionMessageToolCall
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(options ...AgentOption) (*Agent, error)
func (*Agent) ChatCompletion ¶
func (*Agent) ChatCompletionStream ¶
func (*Agent) ExecuteMCPToolCalls ¶
func (*Agent) ExecuteToolCalls ¶
func (*Agent) ToolsCompletion ¶
func (agent *Agent) ToolsCompletion() ([]openai.ChatCompletionMessageToolCall, error)
type AgentOption ¶
type AgentOption func(*Agent)
func WithDMRClient ¶
func WithDMRClient(ctx context.Context, baseURL string) AgentOption
func WithMCPClient ¶
func WithMCPClient(command STDIOCommandOption) AgentOption
func WithMCPTools ¶
func WithMCPTools(tools []string) AgentOption
func WithParams ¶
func WithParams(params openai.ChatCompletionNewParams) AgentOption
func WithTools ¶
func WithTools(tools []openai.ChatCompletionToolParam) AgentOption
type STDIOCommandOption ¶
type STDIOCommandOption []string
func WithDockerMCPToolkit ¶
func WithDockerMCPToolkit() STDIOCommandOption
func WithSocatMCPToolkit ¶
func WithSocatMCPToolkit() STDIOCommandOption
Click to show internal directories.
Click to hide internal directories.