Skip to content

Fixed optional field setup#254

Open
Sirsho1997 wants to merge 5 commits intomainfrom
Fix-optionalField
Open

Fixed optional field setup#254
Sirsho1997 wants to merge 5 commits intomainfrom
Fix-optionalField

Conversation

@Sirsho1997
Copy link
Collaborator

Changed

  • Request wiring: Image/video/audio builders now rely on _addOptionalBuiltInDataTypesFields() instead of hardcoded optional field lists, ensuring fields like acceleration and webhookURL are always forwarded when set.

Copy link
Contributor

Copilot AI left a 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 refactors how image/video/audio request payloads are assembled so that optional dataclass fields are forwarded automatically (instead of maintaining per-request hardcoded allowlists), with the intent of consistently propagating fields like acceleration and webhookURL.

Changes:

  • Replace _addOptional{Image,Video,Audio}Fields() allowlists with a new _addOptionalBuiltInDataTypesFields() dataclass-introspection helper.
  • Wire image/video/audio request builders to use the new helper.
  • Add temporary request-object printing in _requestVideo().
Comments suppressed due to low confidence (1)

runware/base.py:2866

  • _buildAudioRequest() adds requestAudio.settings twice via _addOptionalField (once before providerSettings and again after inputs). This is redundant work and makes the request assembly harder to reason about; please remove the duplicate call.
        self._addOptionalField(request_object, requestAudio.settings)
        self._addAudioProviderSettings(request_object, requestAudio)
        self._addOptionalField(request_object, requestAudio.inputs)
        self._addOptionalField(request_object, requestAudio.settings)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a 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 refactors request serialization for image/video/audio inference so optional fields are forwarded via a shared _addOptionalBuiltInDataTypesFields() helper rather than per-task hardcoded lists, and removes the legacy skipResponse flow in favor of deliveryMethod="async".

Changes:

  • Replace image/video/audio “optional fields” lists with generic dataclass-field forwarding (_addOptionalBuiltInDataTypesFields()).
  • Remove skipResponse support from video inference request handling and docs; steer users to async delivery methods instead.
  • Update README guidance around long-running video operations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
runware/types.py Removes skipResponse from IVideoInference and adds a migration hint in __post_init__.
runware/base.py Introduces _addOptionalBuiltInDataTypesFields() and wires image/video/audio builders to use it instead of task-specific optional-field lists.
README.md Removes the skipResponse example/section and updates notes to reference deliveryMethod="async".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a 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 refactors request-building for image/video/audio inference to reduce hardcoded optional-field lists and ensure any set scalar fields (e.g., acceleration, webhookURL) are forwarded consistently. It also removes the legacy skipResponse flow in favor of deliveryMethod="async" and hard-deprecates checkNsfw/skipResponse at the dataclass level.

Changes:

  • Replace hardcoded optional-field lists with a reflection-based _addOptionalBuiltInDataTypesFields() helper for image/video/audio request builders.
  • Deprecate IImageInference.checkNsfw and IVideoInference.skipResponse (InitVar + runtime rejection) and remove skipResponse handling from video requests.
  • Update README to remove skipResponse documentation and recommend deliveryMethod="async" instead.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
runware/types.py Deprecates checkNsfw and skipResponse via InitVar and rejects usage in __post_init__.
runware/base.py Introduces _addOptionalBuiltInDataTypesFields() and switches image/video/audio builders to use it; removes video skipResponse handling.
README.md Removes the skipResponse example/notes and points users to deliveryMethod="async".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants