mock

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mock provides configurable mock implementations of interfaces for use in tests across the go-llm module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTool

type MockTool struct {
	tool.Base
	Name_        string
	Description_ string
	InputSchema_ *jsonschema.Schema
	Meta_        llm.ToolMeta
	Result_      any
	RunFn        func(ctx context.Context, input json.RawMessage) (any, error)
}

MockTool is a configurable implementation of llm.Tool for use in tests. Set Name_, Description_, and Result_ before registering it on a server. RunFn, if set, overrides Result_ and is called with the raw JSON input.

func (*MockTool) Description

func (m *MockTool) Description() string

func (*MockTool) InputSchema

func (m *MockTool) InputSchema() *jsonschema.Schema

func (*MockTool) Meta

func (m *MockTool) Meta() llm.ToolMeta

func (*MockTool) Name

func (m *MockTool) Name() string

func (*MockTool) Run

func (m *MockTool) Run(ctx context.Context, input json.RawMessage) (any, error)

Jump to

Keyboard shortcuts

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