fix: use UserPromptMessage instead of AssistantPromptMessage for resp…#167
Open
harryzsh wants to merge 1 commit into
Open
fix: use UserPromptMessage instead of AssistantPromptMessage for resp…#167harryzsh wants to merge 1 commit into
harryzsh wants to merge 1 commit into
Conversation
|
@harryzsh Thank you for your support!! Your solution is simple but effective. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…onse_format hint
Issue #, if available:
fixing this issue langgenius/dify-official-plugins#2824
Description of changes:
Since AWS bedrock converse API doesn't support prefill (dify has a feature to set structured output in such format like json), we will need to replace the assistance message with user message and i have tested it with claude opus 4.6 which works perfectly fine with the user message but again for some other LLM, the json format may not always be enforced.
The real fix is to add in the nre structured output https://docs.aws.amazon.com/bedrock/latest/userguide/structured-output.html to the existing code but it requires a lot of code change as well as boto3 upgrade which requires thorough test before release
Hence, the short fix which can unblock our user quickly is to replace assistance message with user message first.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.