Closed clivelewis closed 2 months ago
I cloned the project, checked out to tags/v1.0.0-M1
and ran tests from OpenAiTranscriptionModelIT.java
All tests succeeded, so it's issue on my side. Either because of Kotlin, or because of my code...
I played around with different custom Bean definitions and somehow defining OpenAiAudioTranscriptionModel solved the issue for me...
@Bean
fun openAiAudioApi(@Value("\${spring.ai.openai.api-key}") apiKey: String) = OpenAiAudioApi(apiKey)
@Bean
fun openAiAudioTranscriptionModel(openAiAudioApi: OpenAiAudioApi) = OpenAiAudioTranscriptionModel(openAiAudioApi)
I'm closing the issue even though I have no idea why this helped. Will appreciate if somehow could explain.
Bug description Exception is thrown when attempting to send a request to OpenAI transcription service. Please note that the same logic was working approximately 1-2 months ago.
Environment Kotlin + Java 21 Spring Boot 3.3.1 Spring AI 1.0.0-M1 (Also tried on 1.0.0-SNAPSHOT)
Steps to reproduce Simply execute
.call
method from OpenAiAudioTranscriptionModel with a ByteArrayResource set in the Prompt. Here's my method:Expected behavior No exception. Executed method returns transcribed audio as text.
Some of the things that I tried to fix the issue
SerializationFeature.FAIL_ON_EMPTY_BEANS
Stack trace