mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
refactor(model_runtime): use Sequence for content in PromptMessage
- Replaced list with Sequence for more flexible content type. - Improved type consistency by importing from collections.abc.
This commit is contained in:
parent
93bbb194f2
commit
47e8a5d4d1
|
@ -1,4 +1,5 @@
|
|||
from abc import ABC
|
||||
from collections.abc import Sequence
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
|
@ -107,7 +108,7 @@ class PromptMessage(ABC, BaseModel):
|
|||
"""
|
||||
|
||||
role: PromptMessageRole
|
||||
content: Optional[str | list[PromptMessageContent]] = None
|
||||
content: Optional[str | Sequence[PromptMessageContent]] = None
|
||||
name: Optional[str] = None
|
||||
|
||||
def is_empty(self) -> bool:
|
||||
|
|
Loading…
Reference in New Issue
Block a user