Parameter extractor reported an error #6870

Closed
opened 2026-02-21 18:17:45 -05:00 by yindo · 2 comments
Owner

Originally created by @cuihaojie24 on GitHub (Nov 21, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

I refer to the documentation, but the result is different from the documentation, the error message is as follows:
Error: 3 validation errors for AssistantPromptMessage content.str Input should be a valid string [type=string_type, input_value=[{'text': '{"query": "2405.10739"}'}], input_type=list] For further information visit https://errors.pydantic.dev/2.9/v/string_type content.list[PromptMessageContent].0.type Field required [type=missing, input_value={'text': '{"query": "2405.10739"}'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.9/v/missing content.list[PromptMessageContent].0.data Field required [type=missing, input_value={'text': '{"query": "2405.10739"}'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.9/v/missing

Originally created by @cuihaojie24 on GitHub (Nov 21, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Provide a description of requested docs changes I refer to the documentation, but the result is different from the documentation, the error message is as follows: Error: 3 validation errors for AssistantPromptMessage content.str Input should be a valid string [type=string_type, input_value=[{'text': '{"query": "2405.10739"}'}], input_type=list] For further information visit https://errors.pydantic.dev/2.9/v/string_type content.list[PromptMessageContent].0.type Field required [type=missing, input_value={'text': '{"query": "2405.10739"}'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.9/v/missing content.list[PromptMessageContent].0.data Field required [type=missing, input_value={'text': '{"query": "2405.10739"}'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.9/v/missing
yindo closed this issue 2026-02-21 18:17:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 21, 2024):

@cuihaojie24 Hello there! I'm here to help you with bugs, answer questions, and guide you on becoming a contributor. Let's work together to resolve the issue you're facing.

The error you're encountering with the AssistantPromptMessage suggests that there are issues with the structure and data types of the input being validated by Pydantic. Here are the key points to address:

  1. String Type Error: The error indicates that the content.str field expects a valid string, but it received a list instead. Ensure that the content field is a string, not a list or any other data type.

  2. Missing Fields: The errors for content.list[PromptMessageContent].0.type and content.list[PromptMessageContent].0.data indicate that these fields are required but missing. Make sure that each PromptMessageContent object includes the type and data fields with appropriate values.

To resolve these issues, review the structure of your AssistantPromptMessage input and ensure it aligns with the expected format. Each PromptMessageContent should be a dictionary containing the necessary fields, and the content should be a string if that's what the validation expects. Adjust your input data accordingly to meet these requirements.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 21, 2024): <!-- Greeting --> @cuihaojie24 Hello there! I'm here to help you with bugs, answer questions, and guide you on becoming a contributor. Let's work together to resolve the issue you're facing. <!-- Answer --> The error you're encountering with the `AssistantPromptMessage` suggests that there are issues with the structure and data types of the input being validated by Pydantic. Here are the key points to address: 1. **String Type Error**: The error indicates that the `content.str` field expects a valid string, but it received a list instead. Ensure that the `content` field is a string, not a list or any other data type. 2. **Missing Fields**: The errors for `content.list[PromptMessageContent].0.type` and `content.list[PromptMessageContent].0.data` indicate that these fields are required but missing. Make sure that each `PromptMessageContent` object includes the `type` and `data` fields with appropriate values. To resolve these issues, review the structure of your `AssistantPromptMessage` input and ensure it aligns with the expected format. Each `PromptMessageContent` should be a dictionary containing the necessary fields, and the `content` should be a string if that's what the validation expects. Adjust your input data accordingly to meet these requirements. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Nov 21, 2024):

Please open this as a bug report. Also we need to check the version you are using.

@crazywoola commented on GitHub (Nov 21, 2024): Please open this as a bug report. Also we need to check the version you are using.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6870