Skip to content

Conversation

@ibolmo
Copy link
Collaborator

@ibolmo ibolmo commented Jan 12, 2026

Also attempted to convert a plain file to pdf at runtime, but it would require an extra dependency. Didn't want to go that far in this round.

@ibolmo ibolmo self-assigned this Jan 12, 2026
@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ai-proxy Ready Ready Preview, Comment Jan 13, 2026 9:09pm

matrix:
node-version:
- 20
steps:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

confused me not seeing a specific test job in the ci

{
type: "file",
file: {
file_data: MD_DATA_URL,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@annalinwang i didn't go further in trying to convert text to pdf. i had a spike but then i fell short because of unicode support. going to assume we want to wait for the rust gateway to convert user's text to pdf kind of like i did here: https://braintrustdata.slack.com/archives/C08DRGSEMS8/p1768262457722489?thread_ts=1767909967.121049&cid=C08DRGSEMS8

OpenAIChatCompletion
>({
body: {
model: "gpt-audio",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@annalinwang i'm going to skip this, but let me know if you know of customers that want this. small lift, if there's a need.

@@ -0,0 +1,21 @@
import { readFileSync } from "fs";

const fileToBase64 = (filename: string, mimetype: string) =>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this avoids spamming the LLM with all the base64 encoded strings

},
"dependencies": {
"@anthropic-ai/sdk": "^0.39.0",
"@anthropic-ai/sdk": "^0.71.2",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Earlier versions didn't have plain text content parts.

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

nice cache

);
});

it("should return error for markdown file content (unsupported)", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

random but how come anthropic accepts markdown in a plain text format? openai doesnt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is odd, but that's just how the openai spec/apis are. i've been meaning to test sending a markdown file to their files api and seeing if passing that id ref works (to get around the limitation), but it is a lot more complex even if it does

Comment on lines +31 to +33
expect(isMediaTypeSupported("image/jpeg", "openai")).toBe(false);
expect(isMediaTypeSupported("image/heic", "openai")).toBe(true);
expect(isMediaTypeSupported("image/heif", "openai")).toBe(true);

Choose a reason for hiding this comment

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

is this reversed? should it be true for jpeg and false for heic/heif?

Comment on lines +99 to +107
(type) => type.endsWith("heic") || type.endsWith("heif"),
),
),
...toMediaTypeSupport(DOCUMENT_MEDIA_TYPES),
},
anthropic: {
...toMediaTypeSupport(
IMAGE_MEDIA_TYPES.filter(
(type) => type.endsWith("heic") || type.endsWith("heif"),

Choose a reason for hiding this comment

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

are these filters reversed?

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