Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
}
}
},
"originGitCommit": "7bbc721308055a6c33033d729c847911cc6ee9a0",
"originGitCommit": "ce2f269781f8e357d369d4e52f5e2f766a20b369",
"sdkVersion": "0.0.0-dev"
}
13 changes: 13 additions & 0 deletions src/api/types/GuidedDocumentSection.ts
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 4 additions & 0 deletions src/api/types/GuidedEphemeralDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>;
/** The generated document as a structured object keyed by section ID. The `sections` array lists every section ID and its heading. */
structuredDocument?: Record<string, unknown> | 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[];
/** Key/value labels attached to this document. */
labels: Corti.GuidedLabel[];
}
1 change: 1 addition & 0 deletions src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
22 changes: 22 additions & 0 deletions src/serialization/types/GuidedDocumentSection.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
3 changes: 3 additions & 0 deletions src/serialization/types/GuidedEphemeralDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand All @@ -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).optional(),
labels: core.serialization.list(GuidedLabel),
});

Expand All @@ -30,6 +32,7 @@ export declare namespace GuidedEphemeralDocument {
interactionId?: (string | null | undefined) | null;
stringDocument: Record<string, string>;
structuredDocument?: (Record<string, unknown> | null | undefined) | null;
sections?: GuidedDocumentSection.Raw[] | null;
labels: GuidedLabel.Raw[];
}
}
1 change: 1 addition & 0 deletions src/serialization/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
20 changes: 20 additions & 0 deletions tests/wire/documents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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",
Expand Down
Loading