Circle V2 API Docs
    Preparing search index...

    Function createChatModel

    • The single construction site for a ChatOpenAI from a resolved prompt model config. The runtime path (agents, prompts) and the hub push path both build through here, so what runs and what is published to the hub cannot disagree about a model's levers.

      Gateway routing, ls_* stamping and promptCacheKey live in ../gateway, shared with the V2 sites in @repo/legacy; the retry and timeout bounds below are this path's own.

      Note: caching only engages when the resolved model takes langchain's native structured-output path; a model that falls back to the tool-strategy loses caching. We surface that via the cache_read usage metric on traces rather than an allowlist here.

      Parameters

      Returns ChatOpenAI