runctx

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package runctx builds the context pack for one turn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsRawSpec

func ContainsRawSpec(s string) bool

func OperationLine

func OperationLine(cat *catalog.Catalog, op catalog.Operation, note string) string

Types

type Builder

type Builder struct {
	MaxBytes int
	// Tasks are index lines for flows that have a question. Build adds a line when the user text matches its name, question, or answer.
	Tasks []string
}

func NewBuilder

func NewBuilder(maxBytes int) *Builder

func (*Builder) Build

func (b *Builder) Build(cat *catalog.Catalog, turns []Turn, described *catalog.Operation, sem notes, pending *policy.PendingConfirmation) Pack

Build does not embed the raw OpenAPI document.

type Pack

type Pack struct {
	Rules                string                      `json:"Rules"`
	Index                string                      `json:"Index"`
	Turns                []Turn                      `json:"Turns"`
	DescribedOperationID string                      `json:"DescribedOperationID"`
	DescribedDetail      string                      `json:"DescribedDetail"`
	Related              []string                    `json:"Related"`
	PendingConfirmation  *policy.PendingConfirmation `json:"PendingConfirmation"`
	Bytes                int                         `json:"Bytes"`
	Truncated            bool                        `json:"Truncated"`
}

func (Pack) Serialize

func (p Pack) Serialize() string

Serialize returns a human-readable pack for tests and debugging.

type Turn

type Turn struct {
	Role    string `json:"Role"`
	Content string `json:"Content"`
}

Jump to

Keyboard shortcuts

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