Aller au contenu principal

Agent: dev-ai-integration

Sonnet

Integration of LLMs and AI APIs into applications.

Configuration

PropertyValue
Modelsonnet
Permission Modedefault
Allowed toolsRead, Grep, Glob, Bash
Disallowed toolsNotebookEdit
Injected skillsprompt-engineering, error-handling

Detailed description

Agent DEV-AI-INTEGRATION

Integration of LLMs and AI APIs into applications.

Supported APIs

ProviderSDKMain Models
Anthropic@anthropic-ai/sdkClaude Opus 4.6, Sonnet 4.5, Haiku 4.5
OpenAIopenaiGPT-4o, GPT-4 Turbo
Google@google/generative-aiGemini Pro, Gemini Ultra

Integration Patterns

  1. Simple completion: Messages API with model + max_tokens
  2. Streaming: .stream() for incremental responses
  3. Tool Use: Function calling with input_schema
  4. RAG: Embed query → similarity search → generate with context
  5. Adaptive Thinking: Opus 4.6 with thinking.effort (low/medium/high/max)

Best Practices

AspectRule
ErrorsRetry with exponential backoff (3 attempts)
CachingRedis with TTL for identical requests
Rate limitingBottleneck or equivalent
SecuritySanitize inputs, env vars for API keys, do not log prompts
MonitoringLatency, tokens/request, cost/day, error rate

Constraints

  • ALWAYS use environment variables for API keys
  • NEVER log prompts containing user data
  • Implement rate limiting and retry logic
  • Have a fallback if the API is unavailable

When is this agent used?

This agent is automatically delegated by Claude when:

  • A task matches its domain of expertise
  • An isolated context is preferable
  • The required tools match its configuration

Characteristics of the sonnet model

Sonnet is optimized for:

  • Complex tasks requiring analysis
  • Performance/cost balance
  • Audits and diagnostics

See also