The TomTomMap instance to control
Agent configuration options
A ToolLoopAgent with state access and cleanup
import { createMapAgent } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
import { openai } from '@ai-sdk/openai';
import { DirectChatTransport } from 'ai/react';
const agent = createMapAgent(map, { model: openai('gpt-4o') });
// Works directly with DirectChatTransport — no .agent property needed
const { messages, sendMessage } = useChat({
transport: new DirectChatTransport({ agent }),
});
Creates a conversational agent toolkit that gives an LLM control over a TomTom map.
Returns a ToolLoopAgent instance (compatible with DirectChatTransport) with
stateanddestroyattached. Classification runs transparently insideprepareStep— no wrapper type needed.