Skip to content

Commit 0d2f625

Browse files
committed
refactor(core): remove ContentBlockType enum and update ContentBlock schema
1 parent 19dfd44 commit 0d2f625

3 files changed

Lines changed: 4 additions & 23 deletions

File tree

flowllm/core/enumeration/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
"""Core enumeration module."""
22

33
from .chunk_enum import ChunkEnum
4-
from .content_block_type import ContentBlockType
54
from .http_enum import HttpEnum
65
from .registry_enum import RegistryEnum
76
from .role import Role
87

98
__all__ = [
109
"ChunkEnum",
11-
"ContentBlockType",
1210
"HttpEnum",
1311
"RegistryEnum",
1412
"Role",

flowllm/core/enumeration/content_block_type.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

flowllm/core/schema/message.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pydantic import BaseModel, ConfigDict, Field, model_validator
77

88
from .tool_call import ToolCall
9-
from ..enumeration import Role, ContentBlockType
9+
from ..enumeration import Role
1010

1111

1212
class ContentBlock(BaseModel):
@@ -35,7 +35,7 @@ class ContentBlock(BaseModel):
3535

3636
model_config = ConfigDict(extra="allow")
3737

38-
type: ContentBlockType = Field(default="")
38+
type: str = Field(default="")
3939
content: str | dict | list = Field(default="")
4040

4141
@model_validator(mode="before")
@@ -51,8 +51,8 @@ def init_block(cls, data: dict):
5151
def simple_dump(self) -> dict:
5252
"""Convert ContentBlock to a simple dictionary format."""
5353
result = {
54-
"type": self.type.value,
55-
self.type.value: self.content,
54+
"type": self.type,
55+
self.type: self.content,
5656
**self.model_extra,
5757
}
5858

@@ -95,11 +95,6 @@ def simple_dump(self, add_reasoning: bool = True) -> dict:
9595

9696
return result
9797

98-
@property
99-
def string_buffer(self) -> str:
100-
"""Get a string representation of the message with role and content."""
101-
return f"{self.role.value}: {self.dump_content()}"
102-
10398

10499
class Trajectory(BaseModel):
105100
"""Represents a conversation trajectory with messages and optional scoring."""

0 commit comments

Comments
 (0)