Loading...
Loading...
MUST be used whenever building a chat UI with Atlas agents in a Dune app. Do NOT manually write useAtlasChat integration code — this skill handles installation, component structure, and hook wiring. Triggers: useAtlasChat, atlas chat, streaming chat, agent chat, chat interface, chat component, chat UI. For a full chat app, run skills in order: (1) integrate-atlas-chat, (2) create-client-tool (per tool), (3) setup-python-tools (if Python tools needed).
npx skill4agent add cognitedata/dune-skills integrate-atlas-chatpackage.jsonpackageManagersrc/App.tsxpnpm add "github:cognitedata/dune-industrial-components#semver:*" @sinclair/typebox ajv ajv-formatsnpm install "github:cognitedata/dune-industrial-components#semver:*" @sinclair/typebox ajv ajv-formatsyarn add "github:cognitedata/dune-industrial-components#semver:*" @sinclair/typebox ajv ajv-formatsApp.tsxuseAtlasChatChatMessage@cognite/dune-industrial-components/atlas-agent/reactuseDune()@cognite/dunenullclient: isLoading ? null : sdkmsg.isStreamingprogress.startsWith("Executing:")message.toolCallsisStreamingabort()reset()import { useAtlasChat } from "@cognite/dune-industrial-components/atlas-agent/react";
import type { ChatMessage } from "@cognite/dune-industrial-components/atlas-agent/react";
const { messages, send, isStreaming, progress, error, reset, abort } = useAtlasChat({
client: isLoading ? null : sdk, // null-safe — hook waits for a real client
agentExternalId: "...",
tools?: AtlasTool[], // optional client-side tools
});
// messages[n].role — "user" | "assistant"
// messages[n].text — full text (streams chunk-by-chunk via isStreaming)
// messages[n].isStreaming — true while this message is being written
// messages[n].toolCalls — ToolCall[] once response is complete (client + server-side, in call order)
// progress — e.g. "Agent thinking" or "Executing: get_timeseries"
// isStreaming — true for the entire duration of a response// During streaming — show as a distinct "tool call" bubble above the message
{isStreaming && progress?.startsWith("Executing:") && (
<div>⚙ {progress}</div>
)}
// After response — show tool calls on the assistant message
{msg.toolCalls?.map((tc, i) => (
<ToolResult key={i} name={tc.name} output={tc.output} details={tc.details} />
))}runPythonCodesetup-python-tools/setup-python-tools $ARGUMENTSpyodideusePyodideRuntimeuseAtlasChatpythonRuntimePythonToolConfig$ARGUMENTS