Skip to content

Add retry of failed calls for AiClient, EmbeddingClient and VectorStore #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Nov 22, 2023

  • Refactor the EmbeddingResponse and Embedding from “class” into “record” types. Fix the affected code get calls.
  • Refactor the TransformersEmbeddingClient to avoid telescopic public methods call anti-patter.
  • Add spring-retry dependency to spring-ai-core.
  • Implement RetryAiClient, RetryEmbeddingClient and RetryVectorStore as decorators around AiClient, EmbeddingClient and VectorStore instance. The retry decorators use RetryTemplate to wrap all delegate methods calls. Default RetryTemplate is provided with each instance.
  • Add Tests for all Retry decorators.
  • Add missing javadocs to existing core classes.

Resolves #123

@tzolov tzolov force-pushed the retry-failed-remote-calls branch from 719c558 to 3d05830 Compare November 23, 2023 11:43
…nd VectorStore clients

- Refactor the EmbeddingResponse and Embedding from “class” into “record” types. Fix the affected code get calls.
- Refactor the TransformersEmbeddingClient to avoid telescopic public methods call anti-patter.
- Add spring-retry dependency to spring-ai-core.
- Implement RetryAiClient, RetryEmbeddingClient and RetryVectorStore as decorators around AiClient, EmbeddingClient and VectorStore instance. The retry decorators use RetryTemplate to wrap all delegate methods calls.  Default RetryTemplate is provided with each instance.
- Add Tests for all Retry decorators.
- Add missing javadocs to existing core classes.

 Resolves spring-projects#123
 Add retryEnabled (default to false) propety to the auto-config properties.
 When the retryEnabled=true the auto-config wrapps the response into corresponding RetryXXXX decorator
 uisng a default RestTemplate instance.
@tzolov tzolov force-pushed the retry-failed-remote-calls branch from fd727b4 to 2e7fcd6 Compare November 24, 2023 12:30
@markpollack markpollack self-assigned this Nov 28, 2023
@markpollack markpollack added this to the 0.9.0 milestone Jan 25, 2024
@tzolov
Copy link
Contributor Author

tzolov commented Mar 8, 2024

Replaced by 1e3eaec

@tzolov tzolov closed this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add invocation retry capabilities for AiClient, EmbeddingClient and VectorStore
2 participants