Documentation
¶
Index ¶
- Constants
- Variables
- func IsValidAlignment(alignment string) bool
- func IsValidColor(color string) bool
- type Input
- type Output
- type Tool
- func (t *Tool) BackfillInput(ctx context.Context, input map[string]any) map[string]any
- func (t *Tool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *Tool) CheckPermissions(ctx context.Context, input map[string]any, ctx2 tool.ToolUseContext) types.PermissionResult
- func (t *Tool) Definition() tool.Definition
- func (t *Tool) Description(ctx context.Context) (string, error)
- func (t *Tool) FormatResult(result any) string
- func (t *Tool) IsConcurrencySafe(input map[string]any) bool
- func (t *Tool) IsEnabled() bool
- func (t *Tool) IsReadOnly(input map[string]any) bool
- func (t *Tool) ValidateInput(ctx context.Context, input map[string]any) (map[string]any, error)
Constants ¶
View Source
const ( ToolName = "docx" SearchHint = "create or modify Word documents" DisplayName = "Docx" )
View Source
const Description = `` /* 2563-byte string literal not displayed */
Variables ¶
View Source
var ValidAlignments = []string{"left", "center", "right", "justify"}
View Source
var ValidColors = []string{
"black", "white", "red", "blue", "green", "yellow",
"purple", "orange", "pink", "gray", "cyan", "magenta",
}
Functions ¶
func IsValidAlignment ¶
func IsValidColor ¶
Types ¶
type Input ¶
type Input struct {
DocumentPath string `json:"document_path,omitempty"`
Action string `json:"action,omitempty"`
Content string `json:"content,omitempty"`
Bold bool `json:"bold,omitempty"`
Italic bool `json:"italic,omitempty"`
Underline bool `json:"underline,omitempty"`
Color string `json:"color,omitempty"`
FontSize int `json:"font_size,omitempty"`
FontFamily string `json:"font_family,omitempty"`
Alignment string `json:"alignment,omitempty"`
TableData string `json:"table_data,omitempty"`
ImagePath string `json:"image_path,omitempty"`
ImageWidth int `json:"image_width,omitempty"`
ImageHeight int `json:"image_height,omitempty"`
Title string `json:"title,omitempty"`
Author string `json:"author,omitempty"`
}
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
func NewDocxTool ¶
func (*Tool) BackfillInput ¶
func (*Tool) Call ¶
func (t *Tool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*Tool) CheckPermissions ¶
func (t *Tool) CheckPermissions(ctx context.Context, input map[string]any, ctx2 tool.ToolUseContext) types.PermissionResult
func (*Tool) Definition ¶
func (t *Tool) Definition() tool.Definition
func (*Tool) FormatResult ¶
Click to show internal directories.
Click to hide internal directories.