-
Notifications
You must be signed in to change notification settings - Fork 1
Sdk overhaul #4
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
Sdk overhaul #4
Conversation
…te related documentation
Replaced explicit ImmutableDictionary/ImmutableList.Empty initializations with collection expressions for conciseness. Changed 'Type' property in TextToImageJobRequest to static. Updated lock object type in SdkApiStringRegistry for thread safety improvements.
…ate table of contents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request represents a major architectural refactoring of the SDK's job submission and management API, transitioning from a service-based pattern to an immutable builder-based pattern. It also introduces comprehensive documentation for the Coverage, Jobs, and Usage services across multiple languages.
Key Changes:
- Replaced
IJobsService/JobsServicewith a newJobsBuilderentry point that exposes fluent, immutable builders for creating (TextToImageBuilder) and querying (JobQueryBuilder) jobs - Changed job submission method from
SubmitAsync()toExecuteAsync()for consistency with the builder pattern - Added comprehensive SDK documentation guides (sdk-coverage.md, sdk-jobs.md, sdk-usage.md) with detailed examples, best practices, and API references
- Enhanced multilingual README files (English, Japanese, Spanish) with practical SDK usage examples for image generation, coverage checking, and usage monitoring
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
Sdk/Request/TextToImageBuilder.cs |
New immutable, thread-safe builder for text-to-image job creation with fluent API and direct HTTP execution |
Sdk/Request/JobsBuilder.cs |
New entry point for job operations providing factory methods for job creation and cached query builder |
Sdk/Request/JobQueryBuilder.cs |
New immutable builder for fluent job querying with filtering, cancellation, and tainting capabilities |
Sdk/Services/JobsService.cs |
Removed in favor of new builder pattern |
Sdk/Services/IJobsService.cs |
Removed in favor of new builder pattern |
Sdk/SdkClient.cs |
Updated Jobs property type from IJobsService to JobsBuilder |
Sdk/ISdkClient.cs |
Updated interface to reflect new JobsBuilder return type |
Sdk/Models/Jobs/TextToImageJobRequest.cs |
Changed Type property from instance to static |
Tests/CivitaiSharp.Sdk.Tests/Request/TextToImageJobBuilderTests.cs |
Removed comprehensive tests for old builder (437 lines) |
Documentation/Guides/sdk-jobs.md |
New comprehensive guide for Jobs service (520 lines) |
Documentation/Guides/sdk-coverage.md |
New guide for Coverage service with caching and batching strategies (325 lines) |
Documentation/Guides/sdk-usage.md |
New guide for Usage service with monitoring patterns (412 lines) |
Documentation/Guides/sdk-introduction.md |
Updated with new builder-based API examples and fluent query patterns |
Documentation/Guides/toc.yml |
Added navigation links to new service guides |
README.md |
Added SDK usage examples for Jobs, Coverage, and Usage services |
README.ja.md |
Added Japanese translations of SDK usage examples |
README.es-AR.md |
Added Spanish translations of SDK usage examples |
Sdk/Extensions/SdkApiStringRegistry.cs |
Updated lock implementation to use .NET 9's Lock type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
All of copilots suggestions were beyond stupid and incorrect; useless garbage. |
This pull request expands and refines the SDK documentation for image generation, coverage, and usage services. It introduces a comprehensive guide for the Coverage Service, improves job management documentation, updates multilingual README files with practical SDK usage examples, and enhances navigation in the documentation table of contents. These changes help users better understand and utilize the SDK’s capabilities for resource checking, job submission, and usage tracking.
SDK Documentation Improvements
sdk-coverage.md, detailing how to check model and resource availability before submitting jobs, including API usage, error handling, caching strategies, batching, and resource discovery.sdk-introduction.mdto clarify job creation, querying, and management with fluent builders, and improved the "Next Steps" section to reference new guides for jobs, coverage, usage, and AIR identifiers. [1] [2].SubmitAsync()to.ExecuteAsync()in code samples for consistency with the new builder pattern.Multilingual Example Expansion
README.es-AR.md) and Japanese (README.ja.md), including code for querying job status, checking resource availability, and monitoring consumption. [1] [2]Documentation Navigation
toc.ymlto include direct links to the new Jobs Service, Coverage Service, and Usage Service guides for easier access.