Skip to content

Improve API design with builder pattern and Java async conventions#232

Merged
andreadimaio merged 6 commits intomainfrom
refactor/api-improvements
Apr 6, 2026
Merged

Improve API design with builder pattern and Java async conventions#232
andreadimaio merged 6 commits intomainfrom
refactor/api-improvements

Conversation

@andreadimaio
Copy link
Copy Markdown
Member

@andreadimaio andreadimaio commented Apr 5, 2026

This PR refactors several core APIs

  • Converted EmbeddingRequest to builder pattern
  • Converted RerankRequest to builder pattern
  • Added embeddingAsync()
  • Renamed async methods to follow Java naming conventions
    • asyncToken()tokenAsync()
    • asyncTokenize()tokenizeAsync()
    • asyncDeleteFile()deleteFileAsync()
  • Improved timeout handling in text classification and extraction services
  • Enhanced batch operation timeout handling

@andreadimaio andreadimaio self-assigned this Apr 5, 2026
@andreadimaio andreadimaio force-pushed the refactor/api-improvements branch 2 times, most recently from 2dd0602 to ab7b0ea Compare April 5, 2026 22:55
…` method

Changes:
- Converted EmbeddingRequest from record to builder class for extensibility
- Created EmbeddingPayload record for internal API requests
- Added `embeddingAsync` method
- Extracted Parameters and ReturnOptions to separate classes
Change async method naming from prefix to suffix pattern:
- asyncToken() → tokenAsync()
- asyncTokenize() → tokenizeAsync()
- asyncDeleteFile() → deleteFileAsync()
Changes:
- Converted RerankRequest from record to builder class for extensibility
- Created RerankPayload record for internal API requests
@andreadimaio andreadimaio force-pushed the refactor/api-improvements branch from ab7b0ea to 0e0ff1e Compare April 6, 2026 07:15
@andreadimaio andreadimaio marked this pull request as ready for review April 6, 2026 07:29
@andreadimaio andreadimaio merged commit e424b68 into main Apr 6, 2026
8 checks passed
@andreadimaio andreadimaio deleted the refactor/api-improvements branch April 6, 2026 07:45
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.

1 participant