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

feat(cli): Use Anthropic via Amazon Bedrock #268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taylor-hudson
Copy link

@taylor-hudson taylor-hudson commented Jan 11, 2025

Add AWS Bedrock Support

Adds support for using AWS Bedrock as an alternative to the direct Anthropic API.

Configuration

Direct Anthropic API (Default)

shortest.config.ts

export default {
  anthropicKey: process.env.ANTHROPIC_API_KEY 
} satisfies ShortestConfig;

AWS Bedrock

export default {
  useBedrock: true,
  awsAccessKey: "your-aws-access-key", // or AWS_ACCESS_KEY_ID
  awsSecretKey: "your-aws-secret-key", // or AWS_SECRET_ACCESS_KEY  
  awsRegion: "us-east-1" // or AWS_REGION
}

Existing implementations using direct Anthropic API will continue to work without changes.

Copy link

vercel bot commented Jan 11, 2025

@taylor-hudson is attempting to deploy a commit to the Antiwork Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -9,22 +10,36 @@ import { SYSTEM_PROMPT } from "./prompts";
import { AITools } from "./tools";

export class AIClient {
private client: Anthropic;
private client: Anthropic | AnthropicBedrock;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing, Taylor!

One thing here: do Anthropic and AnthropicBedrock share different interfaces? If so, it will be nice to create abstract class around them to make our code more scalable when we decide add more AI clients?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good idea. i wrote this commit originally for my personal fork but saw someone else wanted it as well.

if i have the time, ill implement this. thanks for the feedback!

Copy link
Contributor

@gladyshcodes gladyshcodes Jan 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. we could actually merge this pr as is if it works as expected, and then you could open another pr with that impl if you have time

@rmarescu rmarescu changed the title optionally use aws-bedrock feat(cli): Use Anthropic via Amazon Bedrock Jan 16, 2025
@rmarescu
Copy link
Member

@taylor-hudson could you please sign the CLA so we can get this into review?

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.

4 participants