-
Notifications
You must be signed in to change notification settings - Fork 3k
Nate/bedrock-oai-adapter #5936
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
base: main
Are you sure you want to change the base?
Nate/bedrock-oai-adapter #5936
Conversation
Your cubic subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use cubic. |
✅ Deploy Preview for continuedev canceled.
|
type: "tool_use" as const, | ||
id: toolCall.id, | ||
name: toolCall.function?.name, | ||
input: JSON.parse(toolCall.function?.arguments || "{}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsafe JSON parsing: The code directly parses potentially malformed JSON without error handling. If toolCall.function.arguments contains invalid JSON, this will throw an unhandled runtime error. Should wrap in try-catch and handle parsing failures gracefully.
React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
env: z.object({ | ||
region: z.string().optional(), | ||
profile: z.string().optional(), | ||
modelArn: z.string().optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modelArn field is marked as optional but it is required for AWS Bedrock to know which foundation model to use. Making this optional will lead to runtime errors when the field is not provided. The schema should make this field required by removing .optional().
React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
😱 Found 2 issues. Time to roll up your sleeves! 😱 |
Description
Bedrock OpenAI adapter for use in proxy. Purposefully re-implemented existing Bedrock.ts as that should eventually just use the openai-adapters implementation
Checklist
Tests
Some test were added outside the usual oai-adapters tests, but this was also tested locally with the usual test suite in main.test.ts. Won't be running in CI though