feat(ai): Implement unified AI API with Anthropic provider

- Define clean API with complete() method and callbacks for streaming
- Add comprehensive type system for messages, tools, and usage
- Implement AnthropicAI provider with full feature support:
  - Thinking/reasoning with signatures
  - Tool calling with parallel execution
  - Streaming via callbacks (onText, onThinking)
  - Proper error handling and stop reasons
  - Cache tracking for input/output tokens
- Add working test/example demonstrating tool execution flow
- Support for system prompts, temperature, max tokens
- Proper message role types: user, assistant, toolResult
This commit is contained in:
Mario Zechner 2025-08-17 23:30:20 +02:00
parent f064ea0e14
commit e5aedfed29
7 changed files with 597 additions and 1 deletions

1
package-lock.json generated
View file

@ -1604,6 +1604,7 @@
"dependencies": {
"@anthropic-ai/sdk": "0.60.0",
"@google/genai": "1.14.0",
"chalk": "^5.5.0",
"openai": "5.12.2"
},
"devDependencies": {},