spring-projects / spring-projects/spring-ai

Voice parameter in SpeechRequest to be a free form text param instead of restricted enum

Open Beginner friendly
#2,389 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Expected Behavior

We should be able to use OpenAI api with other services that are compatible with OpenAI API contract. In this case, voice parameter to be free text so server will interpret that variable however it wants rather than artificially restricting it to an enum.

Current Behavior

As of now, voice parameter is an enum. So, we cant use the API with other services that are OpenAI compatible unless they too support exact same options.

Context

Voice should be a freeform text so OpenAI API can be used with all OpenAI compatible services. For e.g, tools like kokoro needs user to specify the voice thats not provided by OpenAI i.e kokuru has its own mechanism to define voices rather than standard formats that OpenAI supports. One of the value for voice being "af_heart" & others being "af_sky+af_bella" i.e mix of two voices.

By keeping the variable as a string/Voice type that get marshalled into string when being sent to server, new services can use it however they want rather than being artificially narrowed down to just OpenAI provided speech formats (may be these options OpenAI currently supports increase tomorrow).

Because this is not supported in Spring AI, I am using another library that allows me to specify freetext instead.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the SpeechRequest voice parameter and trace how its type is serialized for the OpenAI-compatible API. Check existing SpeechRequest tests, if present, and verify that arbitrary voice strings such as "af_heart" and "af_sky+af_bella" are accepted and sent unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend-api-design
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.