Circle V2 API Docs
    Preparing search index...

    Type Alias RunCaseReviewChatMessage

    In-process port of circlehealthai-web/app/api/case-review/[caseId]/chat/route.ts.

    The HTTP boundary, Supabase auth, and case-id -> patient-id lookup are all stripped — those become concerns of the trpc handler that calls this function (which already has the authenticated user and PatientId in scope). The langchain/Pinecone glue is preserved verbatim from v1:

    • Load session and pdf vector stores unconditionally.
    • Load extracted and emr stores under try/catch (these are optional).
    • Construct a ChatOpenAI instance and hand it to processCaseChat.
    • Shape the result as { id, role: 'assistant', content, citations } to match what v1's POST handler returned.

    Chat is synchronous — no Jobbable, no queue. The trpc mutation awaits this call directly.

    type RunCaseReviewChatMessage = {
        content: string;
        id: string;
        role: "user" | "assistant";
    }
    Index

    Properties

    Properties

    content: string
    id: string
    role: "user" | "assistant"