Skip to content

Commit 12a26de

Browse files
author
hexuguang
committed
mcp schema update
1 parent af62d41 commit 12a26de

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/agentscope_runtime/engine/schemas/agent_schemas.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ class Content(Event):
311311

312312
@staticmethod
313313
def from_chat_completion_chunk(
314-
chunk: ChatCompletionChunk,
315-
index: Optional[int] = None,
314+
chunk: ChatCompletionChunk,
315+
index: Optional[int] = None,
316316
) -> Optional[Union["TextContent", "DataContent", "ImageContent"]]:
317317
if not chunk.choices:
318318
return None
@@ -592,8 +592,8 @@ def get_audio_content(self) -> List[str]:
592592
for item in self.content:
593593
if hasattr(item, "type"):
594594
if item.type == "input_audio" and hasattr(
595-
item,
596-
"input_audio",
595+
item,
596+
"input_audio",
597597
):
598598
if hasattr(item.input_audio, "data"):
599599
audios.append(item.input_audio.data)
@@ -612,8 +612,8 @@ def get_audio_content(self) -> List[str]:
612612
return audios
613613

614614
def add_delta_content(
615-
self,
616-
new_content: Union[TextContent, ImageContent, DataContent],
615+
self,
616+
new_content: Union[TextContent, ImageContent, DataContent],
617617
):
618618
self.content = self.content or []
619619

@@ -648,12 +648,12 @@ def add_delta_content(
648648
if _type == ContentType.DATA:
649649
for key in new_content.data:
650650
if (
651-
key in pre_content.data
652-
and isinstance(pre_content.data[key], (list, str))
653-
and isinstance(
654-
new_content.data[key],
655-
type(pre_content.data[key]),
656-
)
651+
key in pre_content.data
652+
and isinstance(pre_content.data[key], (list, str))
653+
and isinstance(
654+
new_content.data[key],
655+
type(pre_content.data[key]),
656+
)
657657
):
658658
if isinstance(pre_content.data[key], list):
659659
pre_content.data[key].extend(new_content.data[key])
@@ -680,8 +680,8 @@ def content_completed(self, content_index: int):
680680
return new_content
681681

682682
def add_content(
683-
self,
684-
new_content: Union[TextContent, ImageContent, DataContent],
683+
self,
684+
new_content: Union[TextContent, ImageContent, DataContent],
685685
):
686686
self.content = self.content or []
687687

@@ -831,7 +831,7 @@ class AgentRequest(BaseRequest):
831831
class BaseResponse(Event):
832832
id: Optional[str] = Field(
833833
default_factory=lambda: "response_"
834-
+ str(
834+
+ str(
835835
uuid4(),
836836
),
837837
)

0 commit comments

Comments
 (0)