Skip to content

fix: resolve plugin model.position parsing in legacy DSL (≤0.1.5) #20183

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

obelieve
Copy link

Summary

Fixes #20081

Reason: The ModelPosition definition in the following file is of type Optional[list[str]]:

https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/entities/model/provider.py#L156

Whereas in api/../provider_entities.py, the position is defined as list[str] type (non-optional).

In other words:

  • In provider.py: position: Optional[list[str]]
  • In provider_entities.py: position: list[str]

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

Before After
before after

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 25, 2025
@crazywoola crazywoola requested a review from laipz8200 May 26, 2025 08:32
@laipz8200
Copy link
Member

We do not intend to continue supporting DSL files prior to version 1.0.0. As you can see, allowing fields to be empty would introduce a substantial amount of code to handle types, which is something we prefer to avoid.

@obelieve
Copy link
Author

We do not intend to continue supporting DSL files prior to version 1.0.0. As you can see, allowing fields to be empty would introduce a substantial amount of code to handle types, which is something we prefer to avoid.

If the requested API returns an optional type, the ProviderEntity should still need to be parsed. May I resubmit a fix to improve the reference checking?

@laipz8200
Copy link
Member

laipz8200 commented May 27, 2025

If the requested API returns an optional type, the ProviderEntity should still need to be parsed.

Could you please explain which types of APIs return data that requires compatibility?

@obelieve
Copy link
Author

If the requested API returns an optional type, the ProviderEntity should still need to be parsed.

Could you please explain which types of APIs return data that requires compatibility?

I found out that if we need to parse this API: https://marketplace.dify.ai/api/v1/plugins/batch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 validation error for MarketplacePluginDeclaration\nmodel.position.text_embedding\n Input should be a valid list
2 participants