Claude Integration Documentation
Overview
The Claude Integration provides powerful capabilities for interacting with the Anthropic Claude API. This includes functions for chat completions, generating AI summaries for dashboard tiles, and continuing conversations based on previous interactions. This integration empowers users to leverage sophisticated language models for analytics, summarization, and conversational interfaces.
Settings
The settings for the Claude Integration are crucial for configuring its functionalities. Below are the detailed descriptions of each available setting.
1. model
- Input Type: String
- Description: This setting specifies the model ID to use for API calls. The default model is
claude-sonnet-4-5. Changing this setting allows users to select different versions of the Claude model, which may influence the quality and style of responses generated. If an outdated model ID is provided, the system will map it to the current equivalent. - Default Value:
claude-sonnet-4-5
2. apiKey
- Input Type: String
- Description: This setting is used for authentication when making requests to the Anthropic API. Users must provide an API key issued by Anthropic to allow secure communication with the service. Without this key, no API calls can be made, leading to authentication errors.
- Default Value: None (must be explicitly set)
3. maxTokens
- Input Type: Numeric
- Description: This setting determines the maximum number of tokens the API will return for a response during chat completion or tile summary generation. Increasing this value allows for longer responses, while lowering it restricts the output.
- Default Value: 500 for
chatCompletionand 600 forgenerateTileSummary
4. temperature
- Input Type: Numeric
- Description: This setting controls the randomness of responses generated by the model. The value can range from 0 to 1. A lower temperature (e.g., 0.2) results in more deterministic outputs (consistent responses), while a higher temperature (e.g., 0.8) encourages more creative and diverse outputs.
- Default Value: 0.7
5. system
- Input Type: String (optional)
- Description: An optional setting that allows users to provide a system prompt before the chat messages. This can help guide the AI’s responses based on the context provided. If a system message is included, it must be separated from user messages for proper parsing.
- Default Value: None (optional)
How It Works
The Claude Integration interacts with the Anthropic API through clearly defined methods:
-
Getting the Model: The
getModel()method retrieves the desired model, automatically mapping outdated versions to their current equivalents. -
Setting the Model: The
setModel(model)method allows users to specify the preferred model for API calls. -
Authorization: The
authorize(requestInit)method is responsible for preparing the request headers, ensuring that the API key is included for authentication. -
Chat Completions and Streaming: The
chatCompletion()andstreamChatCompletion()methods facilitate both immediate and stream-based conversations, where users can provide messages and receive responses from the Claude model. -
Tile Summary Generation: The
generateTileSummary()method constructs prompts based on a dashboard tile's metadata and data, generating summaries using the model. -
Continuing Conversations: The
chatWithContext()method provides a way to have extended conversations, maintaining context through the conversation history.
Data Expectations
The Claude Integration expects the following types of data:
- Messages: An array of message objects where each object has a role (e.g., 'user', 'system') and content (string). This is essential for chat-related methods.
- Tile Metadata: Parameters such as
tileTitle,tileType,tileData, andtileConfigare necessary for generating summaries. - User Contextual Information: Any additional context or questions that guide the AI's responses.
Use Cases & Examples
Use Case 1: Automated Customer Support
Companies can use the Claude Integration to automate customer service inquiries. By feeding the integration with customer questions and capturing responses, businesses can create a streamlined support experience while reducing personnel costs.
Use Case 2: Analytics Insight Generation
Data analysts can use this integration to automatically generate insights from complex datasets. For instance, if analysts have a dashboard with sales data, they can use the integration to summarize trends and anomalies.
Example Configuration for Use Case 2:
To configure Claude for generating insights from a sales analytics dashboard, the following configuration can be set up:
{
"tileTitle": "Monthly Sales Overview",
"tileType": "bar",
"tileData": [
{ "month": "January", "sales": 1000 },
{ "month": "February", "sales": 1200 },
{ "month": "March", "sales": 1500 }
],
"tileConfig": {},
"context": "Q1 2023.",
"userQuestion": "What trends do we see in the sales data?",
"dataFilterInfo": "Includes only products with sales above $500."
}The integration can analyze this data and respond with a concise summary of sales trends, key performance indicators, and relevant recommendations.
Billing Impacts
Integrating with the Claude API may incur costs based on usage, such as the number of tokens processed during requests. Users should monitor the token usage closely to manage their billing effectively, particularly in high-traffic applications. Standard pricing for the Anthropic API can vary and should be reviewed on the Anthropic pricing page for accuracy.