tools

package
v0.2.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HuggingFaceModel

type HuggingFaceModel struct {
	ID          string    `json:"_id"`
	ModelID     string    `json:"modelId"`
	Name        string    `json:"id"`
	Description string    `json:"description,omitempty"`
	URL         string    `json:"url,omitempty"`
	Downloads   int       `json:"downloads"`
	Likes       int       `json:"likes"`
	Private     bool      `json:"private"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"lastModified,omitempty"`
	Tags        []string  `json:"tags"`
	Task        string    `json:"pipeline_tag"`
	LibraryName string    `json:"library_name"`
}

type Option

type Option func(*Tool)

Option represents an option for configuring the tool

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL sets the base URL for the Hugging Face API

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the HTTP client for the tool

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

Tool implements a Hugging Face model search tool

func New

func New(options ...Option) *Tool

New creates a new Hugging Face model search tool

func (*Tool) Description

func (t *Tool) Description() string

Description returns a description of what the tool does

func (*Tool) DisplayName added in v0.0.53

func (t *Tool) DisplayName() string

DisplayName implements interfaces.ToolWithDisplayName.DisplayName

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool interface

func (*Tool) Internal added in v0.0.53

func (t *Tool) Internal() bool

Internal implements interfaces.InternalTool.Internal

func (*Tool) Name

func (t *Tool) Name() string

Name returns the name of the tool

func (*Tool) Parameters

func (t *Tool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the parameters that the tool accepts

func (*Tool) Run

func (t *Tool) Run(ctx context.Context, input string) (string, error)

Run executes the tool with the given input

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL