Skip to content

Interface: DraftFunctionRequest

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Functions / DraftFunctionRequest

Interface: DraftFunctionRequest

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

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

Remarks

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.

Properties

answers?

optional answers: object | null

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

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


currentDraft?

optional currentDraft: FunctionDraftDto | null

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

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


description

description: string

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

What the function should do, in plain language.


sessionId?

optional sessionId: string | null

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

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