diff --git a/src/api/resources/facts/client/requests/FactsUpdateRequest.ts b/src/api/resources/facts/client/requests/FactsUpdateRequest.ts index 2c792157..63196a68 100644 --- a/src/api/resources/facts/client/requests/FactsUpdateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsUpdateRequest.ts @@ -13,7 +13,7 @@ export interface FactsUpdateRequest { text?: string; /** The updated group key for the fact. */ group?: string; - /** The updated origin of the fact. Set to 'USER' to indicate a change by an end-user. */ + /** To track the updated source of the fact. Set to 'user' to indicate a change by an end-user. */ source?: Corti.CommonSourceEnum; /** Set this to true if discarded by an end-user, then filter out from the document generation request. */ isDiscarded?: boolean; diff --git a/src/api/types/DocumentsCreateRequest.ts b/src/api/types/DocumentsCreateRequest.ts index 57ce95be..e61c566b 100644 --- a/src/api/types/DocumentsCreateRequest.ts +++ b/src/api/types/DocumentsCreateRequest.ts @@ -9,5 +9,5 @@ export type DocumentsCreateRequest = * Standard method for document generation: Use template key to generate document based on pre-defined template. */ | Corti.DocumentsCreateRequestWithTemplateKey /** - * Advanced method for document generation: Define sectionKeys in the request to build a template dynamically. See a detailed example [here](/templates/documents-advanced#assemble-a-template-with-extra-instructions). */ + * Advanced method for document generation: Define Sections in the request to build a template dynamically. See a detailed example [here](/templates/documents-advanced#assemble-a-template-with-extra-instructions). */ | Corti.DocumentsCreateRequestWithTemplate; diff --git a/src/api/types/DocumentsSectionOverride.ts b/src/api/types/DocumentsSectionOverride.ts new file mode 100644 index 00000000..85736e5f --- /dev/null +++ b/src/api/types/DocumentsSectionOverride.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DocumentsSectionOverride { + /** The key of the section to be used during document generation. */ + key: string; + /** Override to use as the name for the section during document generation. */ + nameOverride?: string; + /** Override to use for the section-level writing style. */ + writingStyleOverride?: string; + /** Override to use for the section-level format rule. */ + formatRuleOverride?: string; + /** Override to use for the section-level additional instructions. */ + additionalInstructionsOverride?: string; +} diff --git a/src/api/types/DocumentsTemplate.ts b/src/api/types/DocumentsTemplate.ts index 9531b8be..af732607 100644 --- a/src/api/types/DocumentsTemplate.ts +++ b/src/api/types/DocumentsTemplate.ts @@ -4,4 +4,10 @@ import * as Corti from "../index.js"; -export type DocumentsTemplate = Corti.DocumentsTemplateWithSectionKeys; +export type DocumentsTemplate = + /** + * Flexible sections to be used in document generation. */ + | Corti.DocumentsTemplateWithSections + /** + * Section keys to be used in document generation, without overrides. */ + | Corti.DocumentsTemplateWithSectionKeys; diff --git a/src/api/types/DocumentsTemplateWithSections.ts b/src/api/types/DocumentsTemplateWithSections.ts new file mode 100644 index 00000000..33a7505c --- /dev/null +++ b/src/api/types/DocumentsTemplateWithSections.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Corti from "../index.js"; + +export interface DocumentsTemplateWithSections { + sections?: Corti.DocumentsSectionOverride[]; + /** A brief description of the document that can help give the LLM some context. */ + description?: string; + /** Override to use for the template-level additional instructions. */ + additionalInstructionsOverride?: string; +} diff --git a/src/api/types/FactsContext.ts b/src/api/types/FactsContext.ts index 1f348a25..dc3d11bc 100644 --- a/src/api/types/FactsContext.ts +++ b/src/api/types/FactsContext.ts @@ -9,6 +9,6 @@ export interface FactsContext { text: string; /** The group to which the fact belongs. */ group?: string; - /** The source of the fact. 'USER' refers to facts provided by the user, while 'SYSTEM' refers to system-generated facts (e.g., EHR). */ + /** Source 'core' indicates facts generated by the LLM, 'user' for facts added by the user, 'system' for system-derived facts (e.g. EHR). */ source: Corti.CommonSourceEnum; } diff --git a/src/api/types/FactsCreateInput.ts b/src/api/types/FactsCreateInput.ts index 056c11ba..7ab1ebb2 100644 --- a/src/api/types/FactsCreateInput.ts +++ b/src/api/types/FactsCreateInput.ts @@ -9,6 +9,6 @@ export interface FactsCreateInput { text: string; /** The key identifying the group to which the fact belongs. */ group: string; - /** The origin of the fact, such as 'USER' or 'SYSTEM'. */ + /** To track the source of a fact. Set 'user' for an end-user, 'system' for EHR-derived facts. 'core' is used for facts generated by the LLM. */ source?: Corti.CommonSourceEnum; } diff --git a/src/api/types/FactsCreateItem.ts b/src/api/types/FactsCreateItem.ts index c20b3ba0..5f62344a 100644 --- a/src/api/types/FactsCreateItem.ts +++ b/src/api/types/FactsCreateItem.ts @@ -13,7 +13,7 @@ export interface FactsCreateItem { group?: string; /** The unique identifier of the group to which the fact belongs. */ groupId?: Corti.Uuid; - /** The origin of the fact, such as 'USER' or 'SYSTEM'. */ + /** To track the source of a fact. Set 'user' for an end-user, 'system' for EHR-derived facts. 'core' is used for facts generated by the LLM. */ source?: Corti.CommonSourceEnum; /** Indicates whether the fact has been marked as discarded by an end-user. */ isDiscarded?: boolean; diff --git a/src/api/types/FactsListItem.ts b/src/api/types/FactsListItem.ts index 72f01129..1c5bcfcb 100644 --- a/src/api/types/FactsListItem.ts +++ b/src/api/types/FactsListItem.ts @@ -15,7 +15,7 @@ export interface FactsListItem { groupId?: Corti.Uuid; /** Indicates whether the fact has been marked as discarded by an end-user. */ isDiscarded?: boolean; - /** The origin of the fact. */ + /** Source 'core' indicates facts generated by the LLM, 'user' for facts added by the user, 'system' for system-derived facts (e.g. EHR). */ source?: Corti.CommonSourceEnum; /** The timestamp when the fact was created. */ createdAt?: Date; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index a8ae8f54..6899c8d7 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -3,8 +3,10 @@ export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithTranscript.js"; export * from "./DocumentsContextWithString.js"; export * from "./DocumentsSection.js"; +export * from "./DocumentsSectionOverride.js"; export * from "./DocumentsTemplate.js"; export * from "./DocumentsTemplateWithSectionKeys.js"; +export * from "./DocumentsTemplateWithSections.js"; export * from "./InteractionsEncounterCreateRequest.js"; export * from "./InteractionsEncounterUpdateRequest.js"; export * from "./InteractionsEncounterResponse.js"; diff --git a/src/serialization/types/DocumentsSectionOverride.ts b/src/serialization/types/DocumentsSectionOverride.ts new file mode 100644 index 00000000..46d1a7f3 --- /dev/null +++ b/src/serialization/types/DocumentsSectionOverride.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const DocumentsSectionOverride: core.serialization.ObjectSchema< + serializers.DocumentsSectionOverride.Raw, + Corti.DocumentsSectionOverride +> = core.serialization.object({ + key: core.serialization.string(), + nameOverride: core.serialization.string().optional(), + writingStyleOverride: core.serialization.string().optional(), + formatRuleOverride: core.serialization.string().optional(), + additionalInstructionsOverride: core.serialization.string().optional(), +}); + +export declare namespace DocumentsSectionOverride { + export interface Raw { + key: string; + nameOverride?: string | null; + writingStyleOverride?: string | null; + formatRuleOverride?: string | null; + additionalInstructionsOverride?: string | null; + } +} diff --git a/src/serialization/types/DocumentsTemplate.ts b/src/serialization/types/DocumentsTemplate.ts index ec097bcc..ebd6c6ab 100644 --- a/src/serialization/types/DocumentsTemplate.ts +++ b/src/serialization/types/DocumentsTemplate.ts @@ -5,13 +5,12 @@ import * as serializers from "../index.js"; import * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; +import { DocumentsTemplateWithSections } from "./DocumentsTemplateWithSections.js"; import { DocumentsTemplateWithSectionKeys } from "./DocumentsTemplateWithSectionKeys.js"; -export const DocumentsTemplate: core.serialization.ObjectSchema< - serializers.DocumentsTemplate.Raw, - Corti.DocumentsTemplate -> = DocumentsTemplateWithSectionKeys; +export const DocumentsTemplate: core.serialization.Schema = + core.serialization.undiscriminatedUnion([DocumentsTemplateWithSections, DocumentsTemplateWithSectionKeys]); export declare namespace DocumentsTemplate { - export type Raw = DocumentsTemplateWithSectionKeys.Raw; + export type Raw = DocumentsTemplateWithSections.Raw | DocumentsTemplateWithSectionKeys.Raw; } diff --git a/src/serialization/types/DocumentsTemplateWithSections.ts b/src/serialization/types/DocumentsTemplateWithSections.ts new file mode 100644 index 00000000..1cf2393d --- /dev/null +++ b/src/serialization/types/DocumentsTemplateWithSections.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { DocumentsSectionOverride } from "./DocumentsSectionOverride.js"; + +export const DocumentsTemplateWithSections: core.serialization.ObjectSchema< + serializers.DocumentsTemplateWithSections.Raw, + Corti.DocumentsTemplateWithSections +> = core.serialization.object({ + sections: core.serialization.list(DocumentsSectionOverride).optional(), + description: core.serialization.string().optional(), + additionalInstructionsOverride: core.serialization.string().optional(), +}); + +export declare namespace DocumentsTemplateWithSections { + export interface Raw { + sections?: DocumentsSectionOverride.Raw[] | null; + description?: string | null; + additionalInstructionsOverride?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index a8ae8f54..6899c8d7 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -3,8 +3,10 @@ export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithTranscript.js"; export * from "./DocumentsContextWithString.js"; export * from "./DocumentsSection.js"; +export * from "./DocumentsSectionOverride.js"; export * from "./DocumentsTemplate.js"; export * from "./DocumentsTemplateWithSectionKeys.js"; +export * from "./DocumentsTemplateWithSections.js"; export * from "./InteractionsEncounterCreateRequest.js"; export * from "./InteractionsEncounterUpdateRequest.js"; export * from "./InteractionsEncounterResponse.js"; diff --git a/yarn.lock b/yarn.lock index ba965023..cfa89a30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1071,9 +1071,9 @@ balanced-match@^1.0.0: integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== baseline-browser-mapping@^2.9.0: - version "2.9.8" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.8.tgz#04fb5c10ff9c7a1b04ac08cfdfc3b10942a8ac72" - integrity sha512-Y1fOuNDowLfgKOypdc9SPABfoWXuZHBOyCS4cD52IeZBhr4Md6CLLs6atcxVrzRmQ06E7hSlm5bHHApPKR/byA== + version "2.9.11" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz#53724708c8db5f97206517ecfe362dbe5181deea" + integrity sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ== brace-expansion@^1.1.7: version "1.1.12" @@ -1144,9 +1144,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001759: - version "1.0.30001760" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001760.tgz#bdd1960fafedf8d5f04ff16e81460506ff9b798f" - integrity sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw== + version "1.0.30001761" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001761.tgz#4ca4c6e3792b24e8e2214baa568fc0e43de28191" + integrity sha512-JF9ptu1vP2coz98+5051jZ4PwQgd2ni8A+gYSN7EA7dPKIMf0pDlSUxhdmVOaV3/fYK5uWBkgSXJaRLr4+3A6g== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1300,9 +1300,9 @@ decimal.js@^10.4.2: integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg== dedent@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.0.tgz#c1f9445335f0175a96587be245a282ff451446ca" - integrity sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ== + version "1.7.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.1.tgz#364661eea3d73f3faba7089214420ec2f8f13e15" + integrity sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg== deepmerge@^4.2.2: version "4.3.1" @@ -3090,9 +3090,9 @@ webpack-sources@^3.3.3: integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== webpack@^5.97.1: - version "5.104.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.104.0.tgz#2b919a4f2526cdc42731142ae295019264fcfb76" - integrity sha512-5DeICTX8BVgNp6afSPYXAFjskIgWGlygQH58bcozPOXgo2r/6xx39Y1+cULZ3gTxUYQP88jmwLj2anu4Xaq84g== + version "5.104.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.104.1.tgz#94bd41eb5dbf06e93be165ba8be41b8260d4fb1a" + integrity sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8"