Skip to content

Interface: DraftFunctionRequest

@kortexya/reasoninglayer


@kortexya/reasoninglayer / DraftFunctionRequest

Defined in: src/types/functions.ts:321

Request an AI draft of a function from a natural-language description.

Supports a multi-turn clarification loop. On the first call, provide only description. If the response status is "needs_clarification", call again with the returned sessionId plus an answers map keyed by question id. To refine an existing draft, pass it as currentDraft — the model treats it as the base to revise.

The endpoint never writes to the knowledge base; it returns a validated draft for review.

optional answers?: object | null

Defined in: src/types/functions.ts:323

Answers to clarification questions, keyed by question id (2nd call).


optional currentDraft?: RegisterFunctionRequest | null

Defined in: src/types/functions.ts:325

A prior draft to revise (refine loop) — the model treats it as the base.


description: string

Defined in: src/types/functions.ts:327

What the function should do, in plain language.


optional sessionId?: string | null

Defined in: src/types/functions.ts:329

Session ID for multi-turn clarification (client-echoed; the server is stateless).