llm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDecisionPrompt

func BuildDecisionPrompt(agentName, role string, personality map[string]interface{}, state map[string]interface{}) string

BuildDecisionPrompt creates a prompt for the LLM

Types

type Client

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

Client handles communication with Ollama

func New

func New(cfg Config) (*Client, error)

New creates a new Ollama client

func (*Client) Decide

func (c *Client) Decide(ctx context.Context, prompt string) (*DecisionResponse, error)

Decide prompts the LLM for an action decision

func (*Client) HasPromptManager

func (c *Client) HasPromptManager() bool

HasPromptManager returns whether the prompt manager is initialized

func (*Client) RenderPrompt

func (c *Client) RenderPrompt(promptType string, role string, ctx *prompts.TemplateContext) (string, error)

RenderPrompt renders a prompt template with the given context

func (*Client) TestConnection

func (c *Client) TestConnection(ctx context.Context) error

TestConnection tests if Ollama is reachable

type Config

type Config struct {
	BaseURL       string
	Model         string
	Timeout       time.Duration
	PromptsDir    string
	PromptsConfig string
}

Config holds LLM client configuration

type DecisionRequest

type DecisionRequest struct {
	AgentName    string
	Personality  string
	CurrentState string
	Knowledge    string
	Experiences  string
}

DecisionRequest represents a request for an agent decision

type DecisionResponse

type DecisionResponse struct {
	Action     string  `json:"action"`
	Target     string  `json:"target,omitempty"`
	Reasoning  string  `json:"reasoning"`
	Confidence float64 `json:"confidence"`
}

DecisionResponse represents the LLM's decision

Jump to

Keyboard shortcuts

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