Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct Anthropic API Integration #98

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open

Conversation

emshvac
Copy link

@emshvac emshvac commented Nov 19, 2024

This PR implements direct integration with the Anthropic API, providing enhanced functionality and performance improvements to the Claude Coder extension.

Warnings
Some tools only work with Kodu and you will experience some funkiness when it tries to use these tools. Please report these and we will correct them.

Key Changes
Added direct Anthropic API integration for improved reliability and performance
Implemented UI components and state management for API configuration
Added support for Claude 3.5 Sonnet (20241022) model
Integrated with existing TaskExecutor infrastructure for consistent execution flow
Fixed token metrics capture from message_start events
Improved abort functionality handling

Technical Details
Simplified implementation by leveraging existing infrastructure
Refactored code to maintain consistency with current architecture
Enhanced state management for API configuration
Added token usage tracking improvements
Testing
The implementation has been tested with various models and configurations, ensuring proper functionality of:

API integration
Token metrics tracking
Abort operations
Model selection
UI state management

ajnart and others added 30 commits November 7, 2024 14:44
remove code

remove code
The horiztonal scroll bar does not show
- Add direct Anthropic API handler with proper message conversion
- Add secure storage for Anthropic API key
- Add state management for direct API toggle
- Fix tool message handling to prevent infinite loops
- Implement proper error handling for unsupported features
- Add UI components for API key input and toggle
- Add state management in ExtensionStateContext
- Update API configuration types
- Add settings state hooks for direct API
- Update API manager for direct integration
- Remove complex state management (let TaskExecutor handle it)
- Simplify abort handling to just use AbortController
- Remove duplicate error handling
- Remove stream timeout management
- Clean up code to just implement ApiHandler interface
- Remove complex state management (use TaskExecutor)
- Remove retry logic (use api-handler.ts)
- Remove UI state handling (use api-handler.ts)
- Just handle Anthropic API interaction
- Follow KoduHandler's simple abort pattern

The abort->resume delay is expected due to TaskExecutor's state cleanup.
@matannahmani
Copy link
Contributor

looking to merge it today!

@mosleyit
Copy link

Found bugs:

Starts a new stream each time causing input tokens to spike
Cache hits are not being recorded

@younes-io
Copy link

is this feature abandoned?

@mosleyit
Copy link

mosleyit commented Jan 16, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants