Type Alias: DraftFunctionResponse
@kortexya/reasoninglayer / DraftFunctionResponse
Type Alias: DraftFunctionResponse
Section titled “Type Alias: DraftFunctionResponse”DraftFunctionResponse = {
questions:AuthoringClarificationQuestionDto[];sessionId:string;status:"needs_clarification";understood:object; } | {draft:FunctionDraftDto;explanation?:string|null;generationTimeMs:number;status:"complete";warnings:string[]; }
Defined in: src/types/functions.ts:342
Response for an AI function draft.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ questions: AuthoringClarificationQuestionDto[]; sessionId: string; status: "needs_clarification"; understood: object; }
questions
Section titled “questions”questions:
AuthoringClarificationQuestionDto[]
Clarification questions the user must answer.
sessionId
Section titled “sessionId”sessionId:
string
Session ID to echo back in the follow-up request.
status
Section titled “status”status:
"needs_clarification"
Discriminator: clarification is needed.
understood
Section titled “understood”understood:
object
What the model already understood from the description.
Type Literal
Section titled “Type Literal”{ draft: FunctionDraftDto; explanation?: string | null; generationTimeMs: number; status: "complete"; warnings: string[]; }
draft:
FunctionDraftDto
The draft — a RegisterFunctionRequest, which registerFunction takes as is.
explanation?
Section titled “explanation?”
optionalexplanation?:string|null
Plain-language summary of what the drafted function does.
generationTimeMs
Section titled “generationTimeMs”generationTimeMs:
number
Wall-clock generation time in milliseconds.
status
Section titled “status”status:
"complete"
Discriminator: the draft is ready.
warnings
Section titled “warnings”warnings:
string[]
Non-fatal issues the user should see (e.g., unknown function references).
Remarks
Section titled “Remarks”Discriminated union by status:
"needs_clarification"— the model needs more information; answerquestionsand call again withsessionId."complete"—draftholds a validated FunctionDraftDto, which is a RegisterFunctionRequest: pass it straight toregisterFunction.