[PR #30070] fix: handle list content type in Parameter Extraction node #32668

Closed
opened 2026-02-21 20:51:51 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30070

State: closed
Merged: Yes


Summary

Fix Parameter Extraction node failing with "Invalid text content type: <class 'list'>. Expected str." error when using certain models like Gemini 2.5 Pro.

Problem

The PromptMessage.content field can be either str, list[PromptMessageContentUnionTypes], or None. When models return responses in multi-modal content format, the content is a list instead of a string, causing the node to fail.

Solution

Use the existing get_text_content() method which properly handles both string and list content types, extracting text content regardless of the response format.

Closes #30069

Test Plan

  • Create a workflow with a Parameter Extraction node using Gemini 2.5 Pro
  • Configure input variable and Array[String] parameter to extract
  • Run the workflow and verify successful parameter extraction
**Original Pull Request:** https://github.com/langgenius/dify/pull/30070 **State:** closed **Merged:** Yes --- ## Summary Fix Parameter Extraction node failing with "Invalid text content type: <class 'list'>. Expected str." error when using certain models like Gemini 2.5 Pro. ### Problem The `PromptMessage.content` field can be either `str`, `list[PromptMessageContentUnionTypes]`, or `None`. When models return responses in multi-modal content format, the content is a list instead of a string, causing the node to fail. ### Solution Use the existing `get_text_content()` method which properly handles both string and list content types, extracting text content regardless of the response format. Closes #30069 ## Test Plan - [ ] Create a workflow with a Parameter Extraction node using Gemini 2.5 Pro - [ ] Configure input variable and Array[String] parameter to extract - [ ] Run the workflow and verify successful parameter extraction
yindo added the pull-request label 2026-02-21 20:51:51 -05:00
yindo closed this issue 2026-02-21 20:51:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32668