Documentation Index
Fetch the complete documentation index at: https://javaai.pig4cloud.com/llms.txt
Use this file to discover all available pages before exploring further.
OpenAI 转录
Spring AI 集成了 OpenAI 的 Whisper 模型,以实现语音转文本功能。
将以下依赖项添加到您的项目中:
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
</dependency>
spring.ai.openai.api-key=YOUR_API_KEY
spring.ai.openai.audio.model=whisper-1
@Autowired
private TranscriptionClient transcriptionClient;
// 转录音频
TranscriptionResponse response = transcriptionClient.call(
new TranscriptionPrompt(audioFile)
);
文档有误?请协助编辑
发现文档问题?点击此处直接在 GitHub 上编辑并提交 PR,帮助我们改进文档!