Skip to content

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 7, 2025

Revert Vercel AI SDK adoption and implement clean abstraction for LLM providers

This PR implements issue #144 by removing the Vercel AI SDK and creating a clean abstraction for LLM providers.

Changes

  1. Removed dependencies on Vercel AI SDK (ai and @ai-sdk/* packages)

  2. Created a new LLM abstraction layer in packages/agent/src/core/llm/ with:

    • A message type system supporting system, user, assistant, and tool messages
    • A generic generateText() function that works with any provider
    • A provider interface that can be implemented for different LLM services
    • A provider factory system for creating provider instances
  3. Implemented the Anthropic provider using the Anthropic SDK directly

  4. Updated the toolAgentCore.ts and related files to use the new abstraction

  5. Added support for the same functionality without relying on the Vercel AI SDK

Benefits

  • More reliable LLM integration by using provider SDKs directly
  • Cleaner abstraction between the application and specific LLM providers
  • Easier to add support for other models in the future
  • Better type safety with TypeScript interfaces for all components

Testing

The changes have been built and type-checked to ensure compatibility with the existing codebase.

Follow-up Tasks

As mentioned in the issue, these items will be addressed in separate PRs:

  • Token caching
  • Support for OpenAI, Ollama, and Grok/XAI

@bhouston bhouston merged commit b6b49e6 into main Mar 7, 2025
0 of 2 checks passed
Copy link

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version mycoder-agent-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version mycoder-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bhouston bhouston deleted the issue-144-revert-vercel-ai-sdk branch March 12, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant