spring-projects / spring-projects/spring-ai
Please make EmbeddingModel asynchronous
Open
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
It's synchronous API, this forces class OpenAiApi holds both RestClient and WebClient:
This also forces a Spring WebFlux application to use thread pool for blocking call to embed().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading spring-ai-model/src/main/java/org/springframework/ai/embedding/EmbeddingModel.java and the referenced OpenAiApi.java around line 100. Trace how the current synchronous embed() call interacts with RestClient and WebClient; done should be an agreed asynchronous EmbeddingModel API that does not force WebFlux applications to use a blocking thread pool.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100