Anthropic Connector
Integrate Anthropic's Claude models into your Logic Bee hooks.
Setup
// logic-bee.config.ts
export default {
connectors: {
anthropic: {
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-sonnet-4-20250514',
},
},
};
Usage
@LogicHook({
event: 'summarize-document',
collection: 'ai',
})
export class SummarizeDocumentHook {
async run(context) {
const { text } = context.body;
const response = await context.connectors.anthropic.complete({
prompt: `Summarize the following document:\n\n${text}`,
maxTokens: 500,
});
return { summary: response.text };
}
}
Configuration Options
| Option | Type | Description |
|---|---|---|
apiKey | string | Your Anthropic API key |
model | string | Model to use (default: claude-sonnet-4-20250514) |
maxTokens | number | Default max tokens for completions |
temperature | number | Sampling temperature (0–1) |