Skip to content

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Nate/bedrock-oai-adapter #5936

wants to merge 2 commits into from

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Jun 2, 2025

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

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

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

Copy link

cubic-dev-ai bot commented Jun 2, 2025

Your cubic subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use cubic.

Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit a3f6d47
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/683d2884d99da50008bc6610

type: "tool_use" as const,
id: toolCall.id,
name: toolCall.function?.name,
input: JSON.parse(toolCall.function?.arguments || "{}"),
Copy link

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.

📚 Relevant Docs


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(),
Copy link

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().

📚 Relevant Docs


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)

Copy link

recurseml bot commented Jun 13, 2025

😱 Found 2 issues. Time to roll up your sleeves! 😱

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

Successfully merging this pull request may close these issues.

1 participant