▾
import { createChatModel } from "@arcgis/ai-components/orchestrator/models/chatModel.js";Creates chat models configured for the ArcGIS AI Utility Service.
Type definitions
ChatModelTier
Language models available to users signed in to ArcGIS Online organizations with AI agents enabled. These are used by SDK agents and may be used for language processing in custom agents.
default— The default model tier, suitable for most general-purpose use cases. At v5.2, this tier uses thegpt-6-solmodel.advanced— A model tier for tasks that benefit from more advanced capabilities. At v5.2, this tier uses thegpt-6-astramodel.fast— A model tier for tasks such as classification and summarization, where faster responses are preferred. At v5.2, this tier uses thegpt-6-lunamodel.
The models in each tier will change from version to version as model providers release new models and retire old ones. Because the retirement and availability of models is determined by model providers, apps built using earlier versions of the JS SDK may unwittingly break within standard support lifecycles. Therefore, you should upgrade agentic applications to the latest versions of the JS SDK as often as possible to keep up with rapid evolutions in the underlying technology.
Note, the same prompt may produce different results when different models are used. Therefore, you should re-evaluate prompts, agent descriptions, and tool descriptions and make appropriate adjustments when changing the model tier for an agent or when you upgrade to a later version of the JS SDK.
- Type
- "advanced" | "default" | "fast"
CreateChatModelOptions
Options for creating an ArcGIS chat model.
modelTier
- Type
- ChatModelTier | undefined
The model tier to use for the chat model. See ChatModelTier for tier capabilities, current model mappings, and model-change considerations.
config
- Type
- RunnableConfig | undefined
Optional LangChain RunnableConfig.
The factory uses configurable.thread_id for conversation metadata when supported by the service, and signal
to cancel the request.
Functions
createChatModel
Creates a chat model for the ArcGIS AI Utility Service. The modelTier option selects the service model tier and
defaults to default.
- Signature
-
createChatModel (opts?: CreateChatModelOptions): Promise<ChatOpenAI>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| opts | Model tier and optional LangChain configuration for conversation metadata and request cancellation. | |
- Returns
- Promise
The configured chat model.