Skip to content

Type Alias: GenerateOntologyResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / GenerateOntologyResponse

GenerateOntologyResponse = { questions: OntologyClarificationQuestionDto[]; sessionId: string; status: "needs_clarification"; understood: object; } | { existingSortsCount: number; generationTimeMs: number; scenario: object; status: "complete"; } | { notes?: string | null; patch: object; stage: string; status: "patch"; }

Defined in: src/types/ontology.ts:94

Response for ontology generation.

{ questions: OntologyClarificationQuestionDto[]; sessionId: string; status: "needs_clarification"; understood: object; }

questions: OntologyClarificationQuestionDto[]

Clarification questions the user must answer.

sessionId: string

Session ID to use in follow-up requests.

status: "needs_clarification"

Discriminator: clarification is needed.

understood: object

What the LLM already understood from the prompt.


{ existingSortsCount: number; generationTimeMs: number; scenario: object; status: "complete"; }

existingSortsCount: number

Number of existing sorts found in the knowledge base.

generationTimeMs: number

Time taken for generation in milliseconds.

scenario: object

The generated scenario definition.

status: "complete"

Discriminator: generation is complete.


{ notes?: string | null; patch: object; stage: string; status: "patch"; }

optional notes?: string | null

The model’s notes on the patch, when it left any.

patch: object

The scenario keys this stage contributes, to merge into the draft.

stage: string

The stage the patch belongs to (echoes GenerateOntologyRequest.stage).

status: "patch"

Discriminator: a staged patch (the request carried stage).

Discriminated union by status field:

  • "needs_clarification" – the LLM needs more information before generating.
  • "complete" – the ontology has been generated successfully.
  • "patch" – a staged request’s patch for one stage.