Skip to content

refactor: standardize required fields handling across builders#1611

Merged
gold-silver-copper merged 9 commits into0xPlaygrounds:mainfrom
isSerge:refactor-typestate-transcription-and-vector-search-builders
Apr 14, 2026
Merged

refactor: standardize required fields handling across builders#1611
gold-silver-copper merged 9 commits into0xPlaygrounds:mainfrom
isSerge:refactor-typestate-transcription-and-vector-search-builders

Conversation

@isSerge
Copy link
Copy Markdown
Contributor

@isSerge isSerge commented Apr 8, 2026

Closes #1610

  1. Add Missing and Provided<T> centralized markers (src/markers.rs)
  2. Replace 3 custom marker structs (NoImplProvided, NeedsApiKey, NoData)
  3. Remove several runtime panics and Results
  4. Update following builders:
  • VectorSearchRequestBuilder<F, Missing, Missing> -> Requires .query() & .samples()
  • TranscriptionRequestBuilder<M, Missing> -> Requires .data() or .load_file()
  • ImageGenerationRequestBuilder<M, Missing> -> Requires .prompt()
  • AudioGenerationRequestBuilder<M, Missing, Missing> -> Requires .text() & .voice()
  • ChatBotBuilder<Missing> -> Requires .agent()
  • ClientBuilder<Ext, Missing> -> Requires .api_key()

@gold-silver-copper gold-silver-copper added this pull request to the merge queue Apr 14, 2026
Merged via the queue into 0xPlaygrounds:main with commit fdd3757 Apr 14, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 14, 2026
This was referenced Apr 27, 2026
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.

refactor: use Typestate in TranscriptionRequestBuilder and VectorSearchRequestBuilder to avoid runtime checks

2 participants