Circle V2 API Docs
    Preparing search index...

    Function expandQuestionWithLLM

    • Decompose a question into ordered steps for the answering agent ("think in steps"). The steps drive BOTH document retrieval and — for pass/fail, verbatim — the answer agent's task, so the decomposition shapes the final answer, not just recall.

      When dateIntent is supplied (intent-aware planning) an advisory temporal-intent hint is appended so the planner anchors steps to the right time shape; it is omitted entirely for non-temporal (none) intents, leaving the prompt byte-identical to the no-intent path. Concrete date windows are NOT resolved here — that stays downstream in the answer stage.

      Parameters

      • options: {
            additionalInstructions?: string | null;
            dateIntent?:
                | { kind: "rolling_days"; n: number }
                | {
                    cadence?: "per_day";
                    kind: "calendar_week";
                    subset?: "full" | "mon_fri" | "weekend";
                    which: "last" | "current" | "most_recent_completed";
                }
                | {
                    kind: "specific_weekday";
                    weekday: | "sunday"
                    | "monday"
                    | "tuesday"
                    | "wednesday"
                    | "thursday"
                    | "friday"
                    | "saturday";
                    which: "most_recent";
                }
                | {
                    event: "session"
                    | "admission"
                    | "discharge"
                    | "assessment"
                    | "other";
                    everyNDays?: number;
                    kind: "since_event";
                    withinHours?: number;
                }
                | { kind: "none" }
                | { kind: "unresolvable" };
            model: ChatOpenAI;
            question: string;
            questionType: "summary" | "pass_fail";
            reviewCriteriaInstructions?: string | null;
        }
        • OptionaladditionalInstructions?: string | null
        • OptionaldateIntent?:
              | { kind: "rolling_days"; n: number }
              | {
                  cadence?: "per_day";
                  kind: "calendar_week";
                  subset?: "full" | "mon_fri" | "weekend";
                  which: "last" | "current" | "most_recent_completed";
              }
              | {
                  kind: "specific_weekday";
                  weekday: | "sunday"
                  | "monday"
                  | "tuesday"
                  | "wednesday"
                  | "thursday"
                  | "friday"
                  | "saturday";
                  which: "most_recent";
              }
              | {
                  event: "session"
                  | "admission"
                  | "discharge"
                  | "assessment"
                  | "other";
                  everyNDays?: number;
                  kind: "since_event";
                  withinHours?: number;
              }
              | { kind: "none" }
              | { kind: "unresolvable" }

          Advisory date-intent hint for the planner (intent-aware planning); renders nothing when omitted or none.

        • model: ChatOpenAI
        • question: string
        • questionType: "summary" | "pass_fail"
        • OptionalreviewCriteriaInstructions?: string | null

      Returns Promise<string>