Circle V2 API Docs
    Preparing search index...

    Function createChartReviewChatModel

    • Constructs the ChatOpenAI instance that powers a chart-review run.

      The values mirror v1's circlehealthai-web/app/api/chart-review/run-v2/route.ts verbatim (gpt-4.1, temperature 0.1, no streaming, 3 retries). maxTokens is sourced from the resolved ChartReviewSettings so LD overrides flow through.

      Lives here (rather than in the trpc handler) so the @langchain/openai dependency stays confined to @repo/legacy.

      promptCacheKey routes same-prefix traffic to one machine so the automatic prompt cache is realized at volume. Pass it only from single-purpose call sites: the shared run-wide instance serves several prompts, and one key across different prefixes just dilutes the routing.

      Parameters

      • settings: {
            enableCalendarAwareness?: boolean;
            enableEpisodePatientBlock?: boolean;
            enableExpandedStatuses?: boolean;
            enableIntentAwarePlanning?: boolean;
            enableMetadataAwareGate?: boolean;
            enablePerQuestionInstructions?: boolean;
            enableQueryHydration?: boolean;
            enableReviewCriteriaInDocumentSelection?: boolean;
            enableRunConstantPrefix?: boolean;
            enableStatusReconciliation?: boolean;
            enableSubClaimFanOut?: boolean;
            enableSummaryTableShortcut?: boolean;
            enableThinRetrievalBailout?: boolean;
            enableTimeFilteringInChartReview?: boolean;
            enableUnlockedRetrieval?: boolean;
            enableV3PassFailRunner?: boolean;
            maxTokens: number;
        }
        • OptionalenableCalendarAwareness?: boolean
        • OptionalenableEpisodePatientBlock?: boolean
        • OptionalenableExpandedStatuses?: boolean
        • OptionalenableIntentAwarePlanning?: boolean
        • OptionalenableMetadataAwareGate?: boolean
        • OptionalenablePerQuestionInstructions?: boolean
        • OptionalenableQueryHydration?: boolean
        • OptionalenableReviewCriteriaInDocumentSelection?: boolean
        • OptionalenableRunConstantPrefix?: boolean

          Only read when enableV3PassFailRunner is on — it configures the v3 runner, not v2.

        • OptionalenableStatusReconciliation?: boolean
        • OptionalenableSubClaimFanOut?: boolean

          Only read when enableV3PassFailRunner is on — it configures the v3 runner, not v2.

        • OptionalenableSummaryTableShortcut?: boolean
        • OptionalenableThinRetrievalBailout?: boolean
        • OptionalenableTimeFilteringInChartReview?: boolean
        • OptionalenableUnlockedRetrieval?: boolean
        • OptionalenableV3PassFailRunner?: boolean
        • maxTokens: number
      • Optionalopts: { promptCacheKey?: string }

      Returns ChatOpenAI