-
Notifications
You must be signed in to change notification settings - Fork 1
Development #5
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
Development #5
Conversation
… just prompt, and other properties for consistency.
Included discord server link.
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 PR represents a significant refactoring to improve API clarity and consistency in the CivitaiSharp SDK. The changes rename key builder classes and methods to better reflect their purpose, unify naming conventions across the codebase, and improve developer experience.
Summary: The PR renames TextToImageBuilder to ImageGenerationBuilder to support both text-to-image and image-to-image generation modes. Key method renamings include WithPrompt → WithPositivePrompt, WithCfgScale → WithConfigurationScale, WithSize → WithDimensions, and WithModel → WithAir for better clarity. Properties in ImageMeta and ImageJobParams were also renamed to follow C# naming conventions. Additionally, the PR adds comprehensive webhook documentation and Discord community links.
Key Changes:
- Renamed builder classes and methods for improved clarity and consistency (e.g.,
TextToImageBuilder→ImageGenerationBuilder,WithPrompt→WithPositivePrompt) - Moved image-to-image parameters (
SourceImageUrl,DenoisingStrength) fromImageJobParamstoImageGenerationJobRequestlevel for better API design - Updated all documentation, examples, and tests to reflect new naming conventions
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/CivitaiSharp.Sdk.Tests/Request/ImageJobParamsBuilderTests.cs | Updated test names and assertions to use new method and property names |
| Sdk/Services/ICoverageService.cs | Improved parameter naming from models/model to airIdentifiers/air for clarity |
| Sdk/Services/CoverageService.cs | Implemented parameter naming improvements and error message updates |
| Sdk/Request/JobsBuilder.cs | Updated method name from CreateTextToImage() to CreateImage() with expanded documentation |
| Sdk/Request/ImageJobParamsBuilder.cs | Renamed methods and properties, removed image-to-image specific parameters |
| Sdk/Request/ImageGenerationBuilder.cs | Renamed class from TextToImageBuilder, added new image-to-image parameters |
| Sdk/Models/Jobs/ImageJobParams.cs | Renamed properties with detailed remarks explaining JSON property mappings |
| Sdk/Models/Jobs/ImageGenerationJobRequest.cs | Renamed class, added image-to-image parameters with documentation |
| Sdk/Models/Jobs/BatchJobRequest.cs | Updated to use new ImageGenerationJobRequest type |
| Sdk/Json/SdkJsonContext.cs | Updated JSON serialization context for renamed types |
| Sdk/Http/SdkJsonTypeResolver.cs | Updated type resolver for renamed request type |
| README.md, README.ja.md, README.es-AR.md, NUGET.md | Updated all examples and added Discord community links |
| Documentation/Guides/*.md | Updated all guides with new API names and added webhook documentation |
| Core/Models/ImageMeta.cs | Renamed properties for clarity with detailed remarks |
| CONTRIBUTING.md | Updated example code to reflect new naming conventions |
Comments suppressed due to low confidence (1)
Documentation/Guides/sdk-jobs.md:632
- The example shows outdated property names in the manual construction. Line 630 uses
Modelbut should beAir, and line 631 usesPromptbut should bePositivePromptto match the actual API as shown in the ImageGenerationJobRequest and ImageJobParams classes.
var request = new ImageGenerationJobRequest
{
Model = model,
Params = new ImageJobParams { Prompt = "landscape" }
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.