File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/providers/google-vertex-ai Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -716,13 +716,23 @@ export const isEmbeddingModel = (modelName: string) => {
716716export const OPENAI_AUDIO_FORMAT_TO_VERTEX_MIME_TYPE_MAPPING = {
717717 mp3 : 'audio/mp3' ,
718718 wav : 'audio/wav' ,
719+ opus : 'audio/ogg' ,
720+ flac : 'audio/flac' ,
721+ pcm16 : 'audio/pcm' ,
722+ 'x-aac' : 'audio/aac' ,
723+ 'x-m4a' : 'audio/m4a' ,
724+ mpeg : 'audio/mpeg' ,
725+ mpga : 'audio/mpga' ,
726+ mp4 : 'audio/mp4' ,
727+ webm : 'audio/webm' ,
719728} ;
720729
721730export const transformInputAudioPart = ( c : ContentType ) : GoogleMessagePart => {
722731 const data = c . input_audio ?. data ;
723732 const mimeType =
724733 OPENAI_AUDIO_FORMAT_TO_VERTEX_MIME_TYPE_MAPPING [
725- c . input_audio ?. format as 'mp3' | 'wav'
734+ c . input_audio
735+ ?. format as keyof typeof OPENAI_AUDIO_FORMAT_TO_VERTEX_MIME_TYPE_MAPPING
726736 ] ;
727737 return {
728738 inlineData : {
You can’t perform that action at this time.
0 commit comments