Documentation
¶
Overview ¶
Package notebook implements all Jupyter notebook tools: file management (create, read, write, edit) and kernel execution (execute, run, kernel).
Index ¶
- Constants
- type CellSpec
- type CreateTool
- func (t *CreateTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *CreateTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *CreateTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *CreateTool) Definition() tool.Definition
- func (t *CreateTool) Description(_ context.Context) (string, error)
- func (t *CreateTool) FormatResult(data any) string
- func (t *CreateTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *CreateTool) IsEnabled() bool
- func (t *CreateTool) IsReadOnly(_ map[string]any) bool
- func (t *CreateTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type EditMode
- type EditOp
- type EditTool
- func (t *EditTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *EditTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *EditTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *EditTool) Definition() tool.Definition
- func (t *EditTool) Description(_ context.Context) (string, error)
- func (t *EditTool) FormatResult(data any) string
- func (t *EditTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *EditTool) IsEnabled() bool
- func (t *EditTool) IsReadOnly(_ map[string]any) bool
- func (t *EditTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type ExecuteTool
- func (t *ExecuteTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *ExecuteTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *ExecuteTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *ExecuteTool) Definition() tool.Definition
- func (t *ExecuteTool) Description(_ context.Context) (string, error)
- func (t *ExecuteTool) FormatResult(data any) string
- func (t *ExecuteTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *ExecuteTool) IsEnabled() bool
- func (t *ExecuteTool) IsReadOnly(_ map[string]any) bool
- func (t *ExecuteTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type KernelTool
- func (t *KernelTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *KernelTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *KernelTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *KernelTool) Definition() tool.Definition
- func (t *KernelTool) Description(_ context.Context) (string, error)
- func (t *KernelTool) FormatResult(data any) string
- func (t *KernelTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *KernelTool) IsEnabled() bool
- func (t *KernelTool) IsReadOnly(_ map[string]any) bool
- func (t *KernelTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type ReadTool
- func (t *ReadTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *ReadTool) Call(_ context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *ReadTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *ReadTool) Definition() tool.Definition
- func (t *ReadTool) Description(_ context.Context) (string, error)
- func (t *ReadTool) FormatResult(data any) string
- func (t *ReadTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *ReadTool) IsEnabled() bool
- func (t *ReadTool) IsReadOnly(_ map[string]any) bool
- func (t *ReadTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type RunTool
- func (t *RunTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *RunTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *RunTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *RunTool) Definition() tool.Definition
- func (t *RunTool) Description(_ context.Context) (string, error)
- func (t *RunTool) FormatResult(data any) string
- func (t *RunTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *RunTool) IsEnabled() bool
- func (t *RunTool) IsReadOnly(_ map[string]any) bool
- func (t *RunTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type WriteTool
- func (t *WriteTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *WriteTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *WriteTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *WriteTool) Definition() tool.Definition
- func (t *WriteTool) Description(_ context.Context) (string, error)
- func (t *WriteTool) FormatResult(data any) string
- func (t *WriteTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *WriteTool) IsEnabled() bool
- func (t *WriteTool) IsReadOnly(_ map[string]any) bool
- func (t *WriteTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
Constants ¶
View Source
const ( CreateToolName = "notebook_create" CreateDisplayName = "Create Notebook" CreateDescription = `` /* 484-byte string literal not displayed */ )
View Source
const ( EditToolName = "notebook_edit" EditDisplayName = "Edit Notebook" EditDescription = `` /* 877-byte string literal not displayed */ )
View Source
const ( ExecuteToolName = "notebook_execute" ExecuteDisplayName = "Execute Notebook" ExecuteDescription = `` /* 755-byte string literal not displayed */ )
View Source
const ( KernelToolName = "notebook_kernel" KernelDisplayName = "Manage Kernels" KernelDescription = `` /* 655-byte string literal not displayed */ )
View Source
const ( ReadToolName = "notebook_read" ReadDisplayName = "Read Notebook" ReadDescription = `` /* 442-byte string literal not displayed */ )
View Source
const ( RunToolName = "notebook_run" RunDisplayName = "Run Code in Kernel" RunDescription = `` /* 582-byte string literal not displayed */ )
View Source
const ( WriteToolName = "notebook_write" WriteDisplayName = "Write Notebook" WriteDescription = `` /* 498-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CellSpec ¶
type CellSpec struct {
CellType string `json:"cell_type"` // "code" or "markdown"
Source string `json:"source"`
}
CellSpec describes a single cell for create/write/edit operations.
type CreateTool ¶
type CreateTool struct{}
CreateTool implements notebook_create.
func NewCreateTool ¶
func NewCreateTool() *CreateTool
func (*CreateTool) BackfillInput ¶
func (*CreateTool) Call ¶
func (t *CreateTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*CreateTool) CheckPermissions ¶
func (t *CreateTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*CreateTool) Definition ¶
func (t *CreateTool) Definition() tool.Definition
func (*CreateTool) Description ¶
func (t *CreateTool) Description(_ context.Context) (string, error)
func (*CreateTool) FormatResult ¶
func (t *CreateTool) FormatResult(data any) string
func (*CreateTool) IsConcurrencySafe ¶
func (t *CreateTool) IsConcurrencySafe(_ map[string]any) bool
func (*CreateTool) IsEnabled ¶
func (t *CreateTool) IsEnabled() bool
func (*CreateTool) IsReadOnly ¶
func (t *CreateTool) IsReadOnly(_ map[string]any) bool
func (*CreateTool) ValidateInput ¶
type EditTool ¶
type EditTool struct{}
EditTool implements notebook_edit.
func NewEditTool ¶
func NewEditTool() *EditTool
func (*EditTool) BackfillInput ¶
func (*EditTool) Call ¶
func (t *EditTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*EditTool) CheckPermissions ¶
func (t *EditTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*EditTool) Definition ¶
func (t *EditTool) Definition() tool.Definition
func (*EditTool) FormatResult ¶
type ExecuteTool ¶
type ExecuteTool struct{}
ExecuteTool implements notebook_execute.
func NewExecuteTool ¶
func NewExecuteTool() *ExecuteTool
func (*ExecuteTool) BackfillInput ¶
func (*ExecuteTool) Call ¶
func (t *ExecuteTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*ExecuteTool) CheckPermissions ¶
func (t *ExecuteTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*ExecuteTool) Definition ¶
func (t *ExecuteTool) Definition() tool.Definition
func (*ExecuteTool) Description ¶
func (t *ExecuteTool) Description(_ context.Context) (string, error)
func (*ExecuteTool) FormatResult ¶
func (t *ExecuteTool) FormatResult(data any) string
func (*ExecuteTool) IsConcurrencySafe ¶
func (t *ExecuteTool) IsConcurrencySafe(_ map[string]any) bool
func (*ExecuteTool) IsEnabled ¶
func (t *ExecuteTool) IsEnabled() bool
func (*ExecuteTool) IsReadOnly ¶
func (t *ExecuteTool) IsReadOnly(_ map[string]any) bool
func (*ExecuteTool) ValidateInput ¶
type KernelTool ¶
type KernelTool struct{}
KernelTool implements notebook_kernel.
func NewKernelTool ¶
func NewKernelTool() *KernelTool
func (*KernelTool) BackfillInput ¶
func (*KernelTool) Call ¶
func (t *KernelTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*KernelTool) CheckPermissions ¶
func (t *KernelTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*KernelTool) Definition ¶
func (t *KernelTool) Definition() tool.Definition
func (*KernelTool) Description ¶
func (t *KernelTool) Description(_ context.Context) (string, error)
func (*KernelTool) FormatResult ¶
func (t *KernelTool) FormatResult(data any) string
func (*KernelTool) IsConcurrencySafe ¶
func (t *KernelTool) IsConcurrencySafe(_ map[string]any) bool
func (*KernelTool) IsEnabled ¶
func (t *KernelTool) IsEnabled() bool
func (*KernelTool) IsReadOnly ¶
func (t *KernelTool) IsReadOnly(_ map[string]any) bool
func (*KernelTool) ValidateInput ¶
type ReadTool ¶
type ReadTool struct{}
ReadTool implements notebook_read.
func NewReadTool ¶
func NewReadTool() *ReadTool
func (*ReadTool) BackfillInput ¶
func (*ReadTool) Call ¶
func (t *ReadTool) Call(_ context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
func (*ReadTool) CheckPermissions ¶
func (t *ReadTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*ReadTool) Definition ¶
func (t *ReadTool) Definition() tool.Definition
func (*ReadTool) FormatResult ¶
type RunTool ¶
type RunTool struct{}
RunTool implements notebook_run.
func NewRunTool ¶
func NewRunTool() *RunTool
func (*RunTool) BackfillInput ¶
func (*RunTool) Call ¶
func (t *RunTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*RunTool) CheckPermissions ¶
func (t *RunTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*RunTool) Definition ¶
func (t *RunTool) Definition() tool.Definition
func (*RunTool) FormatResult ¶
type WriteTool ¶
type WriteTool struct{}
WriteTool implements notebook_write.
func NewWriteTool ¶
func NewWriteTool() *WriteTool
func (*WriteTool) BackfillInput ¶
func (*WriteTool) Call ¶
func (t *WriteTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
func (*WriteTool) CheckPermissions ¶
func (t *WriteTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*WriteTool) Definition ¶
func (t *WriteTool) Definition() tool.Definition
func (*WriteTool) FormatResult ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.