GEPA.Seed (GEPA v0.3.0)

Copy Markdown View Source

Helpers for upstream-compatible LLM seed candidate generation.

This mirrors the Python seed_candidate=None path: when the user gives an objective but no initial candidate, a reflection LM is asked to produce a starting artifact. The generated text is extracted from the first fenced block when present and stored under a caller-supplied candidate key.

Summary

Functions

Build the seed-generation prompt sent to the reflection LM.

Extract content from a fenced code block, preserving raw text fallback.

Ask an LM to generate a seed candidate map.

Functions

build_prompt(opts)

@spec build_prompt(keyword() | map()) :: String.t()

Build the seed-generation prompt sent to the reflection LM.

extract_fenced_text(text)

@spec extract_fenced_text(term()) :: String.t()

Extract content from a fenced code block, preserving raw text fallback.

generate(lm, opts)

@spec generate(term(), keyword() | map()) :: {:ok, map()} | {:error, term()}

Ask an LM to generate a seed candidate map.