bot

package
v0.0.0-...-3f69db4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStrategy = `` /* 422-byte string literal not displayed */

Variables

This section is empty.

Functions

func BuildMCPConfig

func BuildMCPConfig(yatzBinaryPath string) string

func BuildPrompt

func BuildPrompt(addr, name, strategy string) string

func BuildSystemPrompt

func BuildSystemPrompt(strategy string) string

Types

type Bot

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

func New

func New(addr, name, strategy, model string) *Bot

func (*Bot) Run

func (b *Bot) Run() error

type LLMStrategy

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

LLMStrategy implements engine.Strategy using the Claude API.

func NewLLMStrategy

func NewLLMStrategy(apiKey, model string, persona *Persona) *LLMStrategy

NewLLMStrategy creates a new LLM-based strategy. If apiKey is empty, the SDK reads ANTHROPIC_API_KEY from the environment.

func (*LLMStrategy) DecideAction

func (s *LLMStrategy) DecideAction(dice [5]int, rollCount int, scorecard engine.Scorecard, available []engine.Category) engine.TurnAction

func (*LLMStrategy) Name

func (s *LLMStrategy) Name() string

type Persona

type Persona struct {
	Name        string
	Personality string
	Strategy    string
	Catchphrase string
	Raw         string
}

Persona represents a loaded character persona from a markdown file.

func LoadPersona

func LoadPersona(path string) (*Persona, error)

LoadPersona reads and parses a persona markdown file. Format:

# Character Name
## 性格
...
## 戦略
...
## 口癖
...

Jump to

Keyboard shortcuts

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