llmapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package llmapi defines LLM and tool-calling interfaces so that implementers (e.g. openai) and consumers (e.g. mcp) can depend on it without import cycles with the full services package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMService

type LLMService interface {
	Chat(ctx context.Context, messages []map[string]any, onToken func(*frames.LLMTextFrame)) error
}

LLMService provides chat completion; may stream text frames.

type LLMServiceWithTools

type LLMServiceWithTools interface {
	LLMService
	RegisterTool(schema schemas.FunctionSchema, handler ToolHandler)
	ToolsSchema() *schemas.ToolsSchema
}

LLMServiceWithTools is an LLM service that supports registering tools (e.g. from MCP).

type ToolHandler

type ToolHandler func(ctx context.Context, toolName string, arguments map[string]any) (string, error)

ToolHandler is called when the LLM requests a tool call. Returns the result string or error.

Jump to

Keyboard shortcuts

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