Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/application/serializers/application_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ class ModelSettingSerializer(serializers.Serializer):
error_messages=ErrMessage.char(_("No citation segmentation prompt")))
reasoning_content_enable = serializers.BooleanField(required=False,
error_messages=ErrMessage.char(_("Thinking process switch")))
reasoning_content_start = serializers.CharField(required=False, allow_null=True, allow_blank=True, max_length=256,
reasoning_content_start = serializers.CharField(required=False, allow_null=True, default="<think>",
allow_blank=True, max_length=256,
error_messages=ErrMessage.char(
_("The thinking process begins to mark")))
reasoning_content_end = serializers.CharField(required=False, allow_null=True, allow_blank=True, max_length=256,
reasoning_content_end = serializers.CharField(required=False, allow_null=True, allow_blank=True, default="</think>",
max_length=256,
error_messages=ErrMessage.char(_("End of thinking process marker")))


Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with the reasoning_content_start field: it now uses <think> by default instead of {"start": "<think>"}. This could lead to unexpected behavior if this value were required at runtime or if other parts of your application expect {"start": "<think>"} directly.

To resolve this, you should change the default value back to {"start": "<think>"}:

        reasoning_content_start = serializers.CharField(required=False, allow_null=True, 
                                                      default={"start": "<think>"},
                                                       allow_blank=True, max_length=256,
                                                      error_messages=ErrMessage.char(_("The thinking process begins to mark")))

Also, ensure there are no similar issues with other fields that might have default values affecting expected data integrity.

Expand Down