IllaSDK is the main SDK client. Use it when you want one object to manage chat sessions, tool-result loops, and async action polling.
Typical usage
When to use IllaSDK
Use IllaSDK if your integration needs:
- a high-level chat client
- chat ID management
- helper methods for returning tool results
- polling utilities for long-running actions
Chat, CoreApiProvider, and ContextManager directly.
Constructor
config and context/cache customization in options.
config
string
required
API key used as
x-api-key for Core API requests.string
Optional Core API base URL override.
number
HTTP timeout in milliseconds.
Record<string, string>
Extra headers merged into requests.
HttpClientFactory
Optional Axios client factory.
CoreApiProviderRoutes
Optional route overrides (
chat, actionStatus).options
Provide either:
cache+ optionalcontextManagerOptions, orcontextManager(custom implementation)
Property
chatIds: string[]
List of active chat IDs managed by the instance.
Core workflow
Most integrations useIllaSDK in this order:
sendMessage(...)to start or continue a chat- inspect
response.data.pendingTools - execute the returned tools in your app
sendToolResults(...)to continue the loop- use polling helpers if the action completes asynchronously
Core methods
sendMessage
{ userContext }, you can include signerWallet
for smart-account flows where a separate EOA signs transactions/messages.
This is the main entry point for non-streaming chat requests.
sendMessageStreaming
sendToolResult
sendToolResults
SdkEmptyToolsResultsError if toolResults is empty.
The returned SendMessageResult can include:
- Final assistant text (
response.data.text) - Additional
pendingTools(for multi-step tool loops)
sendToolResults for the common case. It reduces request overhead and keeps the tool loop explicit.