Skip to content

Commit 7d1b881

Browse files
committed
🥅 Add information about supported file types
1 parent 4000eda commit 7d1b881

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/utils.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { fileTypeFromBuffer, FileTypeResult } from "file-type";
2-
import type { GeminiResponse, Message } from "./types";
1+
import { FileTypeResult, fileTypeFromBuffer } from "file-type";
32
import { PolyfillTextDecoderStream } from "./polyfillTextDecoderStream";
3+
import type { GeminiResponse, Message } from "./types";
44

55
export const getFileType = async (buffer: Uint8Array | ArrayBuffer) => {
66
const fileType: FileTypeResult | undefined = await fileTypeFromBuffer(buffer);
@@ -37,7 +37,7 @@ export const getFileType = async (buffer: Uint8Array | ArrayBuffer) => {
3737

3838
if (format === undefined || !validMediaFormats.includes(format))
3939
throw new Error(
40-
"Please provide a valid file format that is accepted by Gemini. Learn more about valid formats here: TBD"
40+
"Please provide a valid file format that is accepted by Gemini. Learn more about valid formats here: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=node#supported_file_formats"
4141
);
4242

4343
return format;
@@ -73,4 +73,4 @@ export const pairToMessage = (message: [string, string]): Message[] => {
7373
role: "model",
7474
},
7575
];
76-
};
76+
};

0 commit comments

Comments
 (0)