factory

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package factory wires concrete dependencies for the agent-pi binary.

Index

Constants

View Source
const AgentTypeService = "service"

AgentTypeService is the AGENT_TYPE value the executor stamps for a Config whose spec.type is service. The executor owns this value — it comes from AgentTypeService in agent-task-executor/k8s/apis/agent.benjamin-borbe.de/v1 — and this side only reads it. The coupling is silent when it breaks: a mismatch means sessions simply stop persisting, with nothing logged.

View Source
const ServiceName = "agent-pi"

ServiceName is the canonical service name for the agent-pi binary.

Variables

This section is empty.

Functions

func CreateAgent

func CreateAgent(
	runner pilib.Runner,
	envContext map[string]string,
) *agentlib.Agent

CreateAgent assembles the 3-phase pi agent from a pre-constructed Runner.

func CreateAgentProvider

func CreateAgentProvider(
	runner pilib.Runner,
	envContext map[string]string,
) agentlib.AgentProvider

CreateAgentProvider wires the per-task-type dispatch table from a pre-constructed Runner so callers control Runner lifecycle.

func CreateFileResultDeliverer

func CreateFileResultDeliverer(filePath string) agentlib.ResultDeliverer

CreateFileResultDeliverer creates a ResultDeliverer that writes the agent's output back to a markdown file.

func CreateKafkaResultDeliverer

func CreateKafkaResultDeliverer(
	syncProducer libkafka.SyncProducer,
	topicPrefix base.TopicPrefix,
	taskID agentlib.TaskIdentifier,
	originalContent string,
	currentDateTime libtime.CurrentDateTimeGetter,
) agentlib.ResultDeliverer

CreateKafkaResultDeliverer creates a ResultDeliverer that publishes task updates to Kafka.

func CreatePiRunner

func CreatePiRunner(
	agentDir string,
	allowedTools string,
	model string,
	env map[string]string,
	sessionID string,
) pilib.Runner

CreatePiRunner constructs a Pi Runner pre-configured with tools, model, and env.

sessionID is the agent's session identity: empty for a task-routed agent, set for a long-running identity agent. It is deliberately the *single* knob for both halves of continuity rather than a separate persist flag — persistence without an identity writes a transcript that nothing ever reads, which is exactly the defect that made a service agent save every conversation and remember none of them. Passing an id turns persistence on and pins the run to it; passing "" leaves the agent ephemeral, so a task-routed run still leaves nothing behind on the shared volume.

See PiRunnerConfig.SessionID for why this is --session-id rather than --continue.

func CreatePiSessionFactory added in v0.5.1

func CreatePiSessionFactory(
	agentDir string,
	allowedTools string,
	model string,
	env map[string]string,
) agentlib.SessionFactory

CreatePiSessionFactory builds the shared service's per-session factory over the pi runner. The session id selects the conversation: pi.NewSessionFactory derives PersistSession and SessionID from it, so this repository does not repeat that derivation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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