Forge documentation
Library referenceGo

github.com/l1fe-labs/forge-go/generate

Go generate package.

Go generate package.

Package contract

FieldValue
Languagego
Source versionmodule source snapshot
Manifestforge-go/go.mod
Source files2
EvidenceSource reference; registry publication and runtime conformance are separate checks

Import boundary

import "github.com/l1fe-labs/forge-go/generate"

Use a source checkout or your verified private registry. Manifest coordinates identify the package; they do not establish that a public registry release exists.

Source reference

Download package reference JSON. Each original source file and generated declaration artifact has its own SHA-256 digest. Function bodies and constant values are omitted from downloads. These are source declaration inventories, not compiler-resolved rustdoc, TypeDoc, DocC, or Dokka output. Private modules can contain public declarations that are not reachable through the package boundary; consult the entry point before importing.

generate.go

Read declaration text · 16 declaration entries

type GenerateTextResult struct

func (r *GenerateTextResult) Text() string

func (r *GenerateTextResult) FinishReason() core.FinishReason

func (r *GenerateTextResult) Usage() core.Usage

func (r *GenerateTextResult) Message() core.ModelMessage

func (r *GenerateTextResult) HasToolCalls() bool

func GenerateText(ctx context.Context, model core.LanguageModel, messages []core.ModelMessage, options core.GenerateOptions) (*GenerateTextResult, error)

func GenerateTextWithTools(ctx context.Context, model core.LanguageModel, messages []core.ModelMessage, tools []core.ToolDefinition, options core.GenerateOptions) (*GenerateTextResult, error)

type TextStreamResult struct

func (r *TextStreamResult) FullText() string

func (r *TextStreamResult) Chunks() []string

func (r *TextStreamResult) FinishReason() core.FinishReason

func (r *TextStreamResult) Usage() *core.Usage

func (r *TextStreamResult) IsComplete() bool

func (r *TextStreamResult) Err() error

func StreamText(ctx context.Context, model core.LanguageModel, messages []core.ModelMessage, options core.GenerateOptions) (<-chan core.StreamChunk, *TextStreamResult, error)

object.go

Read declaration text · 10 declaration entries

type ObjectResult[T any] struct

func GenerateObject[T any](ctx context.Context, model core.LanguageModel, messages []core.ModelMessage, schema *core.JsonSchema, options core.GenerateOptions) (*ObjectResult[T], error)

func StreamObject[T any](ctx context.Context, model core.LanguageModel, messages []core.ModelMessage, schema *core.JsonSchema, options core.GenerateOptions) (<-chan core.StreamChunk, *ObjectStreamResult[T], error)

type ObjectStreamResult[T any] struct

func (r *ObjectStreamResult[T]) Object() *T

func (r *ObjectStreamResult[T]) RawJSON() string

func (r *ObjectStreamResult[T]) FinishReason() core.FinishReason

func (r *ObjectStreamResult[T]) Usage() *core.Usage

func (r *ObjectStreamResult[T]) IsComplete() bool

func (r *ObjectStreamResult[T]) Err() error

Continue

On this page