STATEK
API Reference
Examples and Documents

Examples and Documents

Examples and documents provide controlled reference material for agent jobs. Loader helpers parse files; agent-facing tools list and show accessible entries.

SymbolImport pathPurposeStability
Examplestatek.executors.exampleParsed example dataCore helper
Documentstatek.documentParsed document dataCore helper
Topicstatek.documentGroup of documents by topicCore helper
parse_example, load_examples, format_example, extract_examplestatek.executors.exampleExample helpersCore helper
parse_document, load_documents, find_topic, find_documentstatek.documentDocument helpersCore helper
list_of_examples, show_examplestatek.agents.agentAgent-facing example toolsCore system tools
list_of_documents, show_documentstatek.agents.agentAgent-facing document toolsCore system tools

Example

@dataclass
class Example:
    example_metadata: dict
    warmup_items: list[str]
    example_items: list[str]
MemberReturnsDescription
difficulty`TaskDifficultyNone`

Example helpers

FunctionSignatureReturnsErrors
extract_exampleextract_example(job: Job, name: str)ExamplePropagates job/model access errors.
format_exampleformat_example(example, chat_style, xml_tags=None, include_warmup=True, include_metadata=False)strNone documented.
parse_exampleparse_example(example_md: str)ExampleValueError for invalid content before the first code block.
load_examplesload_examples(path: str)list[Example]ValueError if any .md file cannot be parsed.
from statek.executors.example import load_examples
 
examples = load_examples("./examples")
first = examples[0]
print(first.example_metadata.get("name"))

Document and Topic

@dataclass
class Document:
    document_metadata: dict
    body: list[str]
 
@dataclass
class Topic:
    ord_no: int
    topic: str
    documents: list[Document]
MemberReturnsDescription
Document.match_audience(agent_name)boolChecks audience metadata; missing audience means all agents.
Topic.count(agent_name)intCounts documents accessible to an agent.

Document helpers

FunctionSignatureReturnsErrors
parse_documentparse_document(document: str)DocumentValueError if required headers are missing.
load_documentsload_documents(path: str)list[Topic]ValueError if a document file cannot be parsed.
find_topicfind_topic(key, agent_name, all_topics)`TopicNone`
find_documentfind_document(key, agent_name, topic)`DocumentNone`
# ord_no: 0
# topic: Billing
# title: Refund policy
 
Refunds must be reviewed by support before approval.

Agent-facing tools

FunctionSignatureDescription
list_of_exampleslist_of_examples(start_index=0, max_count=10, **kwargs)Lists configured examples for the current agent role.
show_exampleshow_example(example_id, **kwargs)Prints one configured example.
list_of_documentslist_of_documents(topic=None, start_index=0, max_count=10, **kwargs)Lists topics or documents accessible to the current agent role.
show_documentshow_document(key, topic=None, start_from=0, max_lines=40, **kwargs)Prints a selected document or document slice.

Related APIs: Examples, Documents, Agents.