Skip to content
Open
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
12 changes: 6 additions & 6 deletions src/api/resources/facts/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export class Facts {
* @example
* await client.facts.batchUpdate("f47ac10b-58cc-4372-a567-0e02b2c3d479", {
* facts: [{
* factId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
* factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08"
* }]
* })
*/
Expand Down Expand Up @@ -442,18 +442,18 @@ export class Facts {
* Updates an existing fact associated with a specific interaction.
*
* @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
* @param {Corti.Uuid} factId - The unique identifier of the fact to update. Must be a valid UUID.
* @param {string} factId - The unique identifier of the fact to update. Must be a valid UUID.
* @param {Corti.FactsUpdateRequest} request
* @param {Facts.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Corti.GatewayTimeoutError}
*
* @example
* await client.facts.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479")
* await client.facts.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08")
*/
public update(
id: Corti.Uuid,
factId: Corti.Uuid,
factId: string,
request: Corti.FactsUpdateRequest = {},
requestOptions?: Facts.RequestOptions,
): core.HttpResponsePromise<Corti.FactsUpdateResponse> {
Expand All @@ -462,15 +462,15 @@ export class Facts {

private async __update(
id: Corti.Uuid,
factId: Corti.Uuid,
factId: string,
request: Corti.FactsUpdateRequest = {},
requestOptions?: Facts.RequestOptions,
): Promise<core.WithRawResponse<Corti.FactsUpdateResponse>> {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)).base,
`interactions/${encodeURIComponent(serializers.Uuid.jsonOrThrow(id, { omitUndefined: true }))}/facts/${encodeURIComponent(serializers.Uuid.jsonOrThrow(factId, { omitUndefined: true }))}`,
`interactions/${encodeURIComponent(serializers.Uuid.jsonOrThrow(id, { omitUndefined: true }))}/facts/${encodeURIComponent(factId)}`,
),
method: "PATCH",
headers: mergeHeaders(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as Corti from "../../../../index.js";
* @example
* {
* facts: [{
* factId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
* factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08"
* }]
* }
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/DocumentsCreateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
16 changes: 16 additions & 0 deletions src/api/types/DocumentsSectionOverride.ts
Original file line number Diff line number Diff line change
@@ -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;
}
8 changes: 7 additions & 1 deletion src/api/types/DocumentsTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
13 changes: 13 additions & 0 deletions src/api/types/DocumentsTemplateWithSections.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.
*/

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;
}
4 changes: 1 addition & 3 deletions src/api/types/FactsBatchUpdateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Corti from "../index.js";

export interface FactsBatchUpdateInput {
/** The unique identifier of the fact to be updated. */
factId: Corti.Uuid;
factId: string;
/** Set this to true for facts discarded by an end-user, then filter those out from the document generation request. */
isDiscarded?: boolean;
/** The updated text content of the fact. */
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/FactsBatchUpdateItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as Corti from "../index.js";

export interface FactsBatchUpdateItem {
/** The unique identifier of the updated fact. */
id: Corti.Uuid;
id: string;
/** The updated text content of the fact. */
text: string;
/** The updated group key to which the fact belongs. */
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/FactsContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/api/types/FactsCreateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/api/types/FactsCreateItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import * as Corti from "../index.js";

export interface FactsCreateItem {
/** The unique identifier of the newly created fact. */
id?: Corti.Uuid;
id?: string;
/** The textual content of the created fact. */
text?: string;
/** The group key categorizing the fact. */
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;
Expand Down
4 changes: 2 additions & 2 deletions src/api/types/FactsListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as Corti from "../index.js";

export interface FactsListItem {
/** The unique identifier of the fact. */
id?: Corti.Uuid;
id?: string;
/** The text content of the fact. */
text?: string;
/** The key identifying the group to which the fact belongs. */
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/FactsUpdateResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as Corti from "../index.js";

export interface FactsUpdateResponse {
/** The unique identifier of the fact. */
id: Corti.Uuid;
id: string;
/** The updated text content of the fact. */
text: string;
/** The updated group key to which the fact belongs. */
Expand Down
2 changes: 2 additions & 0 deletions src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
28 changes: 28 additions & 0 deletions src/serialization/types/DocumentsSectionOverride.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
9 changes: 4 additions & 5 deletions src/serialization/types/DocumentsTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<serializers.DocumentsTemplate.Raw, Corti.DocumentsTemplate> =
core.serialization.undiscriminatedUnion([DocumentsTemplateWithSections, DocumentsTemplateWithSectionKeys]);

export declare namespace DocumentsTemplate {
export type Raw = DocumentsTemplateWithSectionKeys.Raw;
export type Raw = DocumentsTemplateWithSections.Raw | DocumentsTemplateWithSectionKeys.Raw;
}
25 changes: 25 additions & 0 deletions src/serialization/types/DocumentsTemplateWithSections.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
5 changes: 2 additions & 3 deletions src/serialization/types/FactsBatchUpdateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
import * as serializers from "../index.js";
import * as Corti from "../../api/index.js";
import * as core from "../../core/index.js";
import { Uuid } from "./Uuid.js";

export const FactsBatchUpdateInput: core.serialization.ObjectSchema<
serializers.FactsBatchUpdateInput.Raw,
Corti.FactsBatchUpdateInput
> = core.serialization.object({
factId: Uuid,
factId: core.serialization.string(),
isDiscarded: core.serialization.boolean().optional(),
text: core.serialization.string().optional(),
group: core.serialization.string().optional(),
});

export declare namespace FactsBatchUpdateInput {
export interface Raw {
factId: Uuid.Raw;
factId: string;
isDiscarded?: boolean | null;
text?: string | null;
group?: string | null;
Expand Down
4 changes: 2 additions & 2 deletions src/serialization/types/FactsBatchUpdateItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const FactsBatchUpdateItem: core.serialization.ObjectSchema<
serializers.FactsBatchUpdateItem.Raw,
Corti.FactsBatchUpdateItem
> = core.serialization.object({
id: Uuid,
id: core.serialization.string(),
text: core.serialization.string(),
group: core.serialization.string(),
groupId: Uuid,
Expand All @@ -24,7 +24,7 @@ export const FactsBatchUpdateItem: core.serialization.ObjectSchema<

export declare namespace FactsBatchUpdateItem {
export interface Raw {
id: Uuid.Raw;
id: string;
text: string;
group: string;
groupId: Uuid.Raw;
Expand Down
4 changes: 2 additions & 2 deletions src/serialization/types/FactsCreateItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CommonSourceEnum } from "./CommonSourceEnum.js";

export const FactsCreateItem: core.serialization.ObjectSchema<serializers.FactsCreateItem.Raw, Corti.FactsCreateItem> =
core.serialization.object({
id: Uuid.optional(),
id: core.serialization.string().optional(),
text: core.serialization.string().optional(),
group: core.serialization.string().optional(),
groupId: Uuid.optional(),
Expand All @@ -21,7 +21,7 @@ export const FactsCreateItem: core.serialization.ObjectSchema<serializers.FactsC

export declare namespace FactsCreateItem {
export interface Raw {
id?: Uuid.Raw | null;
id?: string | null;
text?: string | null;
group?: string | null;
groupId?: Uuid.Raw | null;
Expand Down
4 changes: 2 additions & 2 deletions src/serialization/types/FactsListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FactsEvidence } from "./FactsEvidence.js";

export const FactsListItem: core.serialization.ObjectSchema<serializers.FactsListItem.Raw, Corti.FactsListItem> =
core.serialization.object({
id: Uuid.optional(),
id: core.serialization.string().optional(),
text: core.serialization.string().optional(),
group: core.serialization.string().optional(),
groupId: Uuid.optional(),
Expand All @@ -24,7 +24,7 @@ export const FactsListItem: core.serialization.ObjectSchema<serializers.FactsLis

export declare namespace FactsListItem {
export interface Raw {
id?: Uuid.Raw | null;
id?: string | null;
text?: string | null;
group?: string | null;
groupId?: Uuid.Raw | null;
Expand Down
4 changes: 2 additions & 2 deletions src/serialization/types/FactsUpdateResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const FactsUpdateResponse: core.serialization.ObjectSchema<
serializers.FactsUpdateResponse.Raw,
Corti.FactsUpdateResponse
> = core.serialization.object({
id: Uuid,
id: core.serialization.string(),
text: core.serialization.string(),
group: core.serialization.string(),
groupId: Uuid,
Expand All @@ -24,7 +24,7 @@ export const FactsUpdateResponse: core.serialization.ObjectSchema<

export declare namespace FactsUpdateResponse {
export interface Raw {
id: Uuid.Raw;
id: string;
text: string;
group: string;
groupId: Uuid.Raw;
Expand Down
2 changes: 2 additions & 0 deletions src/serialization/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading
Loading