From e3e1ecb3c02f8679c6de78e4e21156e3e89a796c Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 13:36:22 +0000 Subject: [PATCH 1/2] SDK regeneration --- .fern/metadata.json | 2 +- src/api/types/GuidedDocumentSection.ts | 13 +++++++++++ src/api/types/GuidedEphemeralDocument.ts | 4 ++++ src/api/types/index.ts | 1 + .../types/GuidedDocumentSection.ts | 22 +++++++++++++++++++ .../types/GuidedEphemeralDocument.ts | 3 +++ src/serialization/types/index.ts | 1 + tests/wire/documents.test.ts | 20 +++++++++++++++++ 8 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/api/types/GuidedDocumentSection.ts create mode 100644 src/serialization/types/GuidedDocumentSection.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index c0021e2b..b3cd08a5 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "7bbc721308055a6c33033d729c847911cc6ee9a0", + "originGitCommit": "a6c53362430affdfc1306de17ae6a8c7616a93b9", "sdkVersion": "0.0.0-dev" } diff --git a/src/api/types/GuidedDocumentSection.ts b/src/api/types/GuidedDocumentSection.ts new file mode 100644 index 00000000..125a6684 --- /dev/null +++ b/src/api/types/GuidedDocumentSection.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * One section of a generated document, in template order. The `heading` is the section heading at generation time, after overrides. The `orderIndex` is the zero-based position in the template version's section list. + */ +export interface GuidedDocumentSection { + /** The section ID. Use this as the key into `stringDocument` and `structuredDocument`. */ + sectionId: string; + /** The section heading at generation time, after overrides. */ + heading: string; + /** The zero-based position of this section in the template version's section list. */ + orderIndex: number; +} diff --git a/src/api/types/GuidedEphemeralDocument.ts b/src/api/types/GuidedEphemeralDocument.ts index f0a96122..0a7b59a9 100644 --- a/src/api/types/GuidedEphemeralDocument.ts +++ b/src/api/types/GuidedEphemeralDocument.ts @@ -13,8 +13,12 @@ export interface GuidedEphemeralDocument { outputLanguage: string; /** The interaction whose context was used to generate this document, if supplied. */ interactionId?: string | null; + /** The generated document as a map of section ID to rendered string output. The `sections` array lists every section ID and its heading. */ stringDocument: Record; + /** The generated document as a structured object keyed by section ID. The `sections` array lists every section ID and its heading. */ structuredDocument?: Record | null; + /** Every section in the template version, in template order, including sections the model left empty. Use `sectionId` as the key into `stringDocument` and `structuredDocument`. The `heading` lets you render the section label without a GET request per section. */ + sections?: Corti.GuidedDocumentSection[] | null; /** Key/value labels attached to this document. */ labels: Corti.GuidedLabel[]; } diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 7ce73b9e..0ed058bd 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -118,6 +118,7 @@ export * from "./GuidedAssemblySectionRef.js"; export * from "./GuidedBoolNode.js"; export * from "./GuidedDocumentContext.js"; export * from "./GuidedDocumentFactMinimal.js"; +export * from "./GuidedDocumentSection.js"; export * from "./GuidedDocumentsCreateEphemeralResponse.js"; export * from "./GuidedDocumentsGenerateBase.js"; export * from "./GuidedDocumentsGenerateByAssembly.js"; diff --git a/src/serialization/types/GuidedDocumentSection.ts b/src/serialization/types/GuidedDocumentSection.ts new file mode 100644 index 00000000..c8856f86 --- /dev/null +++ b/src/serialization/types/GuidedDocumentSection.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const GuidedDocumentSection: core.serialization.ObjectSchema< + serializers.GuidedDocumentSection.Raw, + Corti.GuidedDocumentSection +> = core.serialization.object({ + sectionId: core.serialization.string(), + heading: core.serialization.string(), + orderIndex: core.serialization.number(), +}); + +export declare namespace GuidedDocumentSection { + export interface Raw { + sectionId: string; + heading: string; + orderIndex: number; + } +} diff --git a/src/serialization/types/GuidedEphemeralDocument.ts b/src/serialization/types/GuidedEphemeralDocument.ts index 98fe685f..950c6f62 100644 --- a/src/serialization/types/GuidedEphemeralDocument.ts +++ b/src/serialization/types/GuidedEphemeralDocument.ts @@ -3,6 +3,7 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; +import { GuidedDocumentSection } from "./GuidedDocumentSection.js"; import { GuidedLabel } from "./GuidedLabel.js"; export const GuidedEphemeralDocument: core.serialization.ObjectSchema< @@ -18,6 +19,7 @@ export const GuidedEphemeralDocument: core.serialization.ObjectSchema< structuredDocument: core.serialization .record(core.serialization.string(), core.serialization.unknown()) .optionalNullable(), + sections: core.serialization.list(GuidedDocumentSection).optionalNullable(), labels: core.serialization.list(GuidedLabel), }); @@ -30,6 +32,7 @@ export declare namespace GuidedEphemeralDocument { interactionId?: (string | null | undefined) | null; stringDocument: Record; structuredDocument?: (Record | null | undefined) | null; + sections?: (GuidedDocumentSection.Raw[] | null | undefined) | null; labels: GuidedLabel.Raw[]; } } diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 7ce73b9e..0ed058bd 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -118,6 +118,7 @@ export * from "./GuidedAssemblySectionRef.js"; export * from "./GuidedBoolNode.js"; export * from "./GuidedDocumentContext.js"; export * from "./GuidedDocumentFactMinimal.js"; +export * from "./GuidedDocumentSection.js"; export * from "./GuidedDocumentsCreateEphemeralResponse.js"; export * from "./GuidedDocumentsGenerateBase.js"; export * from "./GuidedDocumentsGenerateByAssembly.js"; diff --git a/tests/wire/documents.test.ts b/tests/wire/documents.test.ts index 70544566..14a2c237 100644 --- a/tests/wire/documents.test.ts +++ b/tests/wire/documents.test.ts @@ -1034,6 +1034,14 @@ describe("DocumentsClient", () => { interactionId: "interactionId", stringDocument: { key: "value" }, structuredDocument: { key: "value" }, + sections: [ + { sectionId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", heading: "Chief Complaint", orderIndex: 0 }, + { + sectionId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8", + heading: "Assessment and Plan", + orderIndex: 1, + }, + ], labels: [{ key: "key", value: "value" }], }, usageInfo: { creditsConsumed: 1.1 }, @@ -1067,6 +1075,18 @@ describe("DocumentsClient", () => { structuredDocument: { key: "value", }, + sections: [ + { + sectionId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", + heading: "Chief Complaint", + orderIndex: 0, + }, + { + sectionId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8", + heading: "Assessment and Plan", + orderIndex: 1, + }, + ], labels: [ { key: "key", From 95e7138a770004f102bec65e1c23f848d2c36b68 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 13:41:14 +0000 Subject: [PATCH 2/2] SDK regeneration --- .fern/metadata.json | 2 +- src/api/types/GuidedEphemeralDocument.ts | 2 +- src/serialization/types/GuidedEphemeralDocument.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index b3cd08a5..0576dc34 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "a6c53362430affdfc1306de17ae6a8c7616a93b9", + "originGitCommit": "ce2f269781f8e357d369d4e52f5e2f766a20b369", "sdkVersion": "0.0.0-dev" } diff --git a/src/api/types/GuidedEphemeralDocument.ts b/src/api/types/GuidedEphemeralDocument.ts index 0a7b59a9..4d07585d 100644 --- a/src/api/types/GuidedEphemeralDocument.ts +++ b/src/api/types/GuidedEphemeralDocument.ts @@ -18,7 +18,7 @@ export interface GuidedEphemeralDocument { /** The generated document as a structured object keyed by section ID. The `sections` array lists every section ID and its heading. */ structuredDocument?: Record | null; /** Every section in the template version, in template order, including sections the model left empty. Use `sectionId` as the key into `stringDocument` and `structuredDocument`. The `heading` lets you render the section label without a GET request per section. */ - sections?: Corti.GuidedDocumentSection[] | null; + sections?: Corti.GuidedDocumentSection[]; /** Key/value labels attached to this document. */ labels: Corti.GuidedLabel[]; } diff --git a/src/serialization/types/GuidedEphemeralDocument.ts b/src/serialization/types/GuidedEphemeralDocument.ts index 950c6f62..2ab0ece0 100644 --- a/src/serialization/types/GuidedEphemeralDocument.ts +++ b/src/serialization/types/GuidedEphemeralDocument.ts @@ -19,7 +19,7 @@ export const GuidedEphemeralDocument: core.serialization.ObjectSchema< structuredDocument: core.serialization .record(core.serialization.string(), core.serialization.unknown()) .optionalNullable(), - sections: core.serialization.list(GuidedDocumentSection).optionalNullable(), + sections: core.serialization.list(GuidedDocumentSection).optional(), labels: core.serialization.list(GuidedLabel), }); @@ -32,7 +32,7 @@ export declare namespace GuidedEphemeralDocument { interactionId?: (string | null | undefined) | null; stringDocument: Record; structuredDocument?: (Record | null | undefined) | null; - sections?: (GuidedDocumentSection.Raw[] | null | undefined) | null; + sections?: GuidedDocumentSection.Raw[] | null; labels: GuidedLabel.Raw[]; } }