mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
change mixin name
This commit is contained in:
parent
e7c7c88c47
commit
d40c4f5025
3 changed files with 6 additions and 6 deletions
|
|
@ -19,12 +19,12 @@ from metagpt.schema import (
|
|||
CodeSummarizeContext,
|
||||
CodingContext,
|
||||
RunCodeContext,
|
||||
SerDeserMixin,
|
||||
SerializationMixin,
|
||||
TestingContext,
|
||||
)
|
||||
|
||||
|
||||
class Action(SerDeserMixin, is_polymorphic_base=True):
|
||||
class Action(SerializationMixin, is_polymorphic_base=True):
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True, exclude=["llm"])
|
||||
|
||||
name: str = ""
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ from metagpt.llm import LLM, HumanProvider
|
|||
from metagpt.logs import logger
|
||||
from metagpt.memory import Memory
|
||||
from metagpt.provider.base_llm import BaseLLM
|
||||
from metagpt.schema import Message, MessageQueue, SerDeserMixin
|
||||
from metagpt.schema import Message, MessageQueue, SerializationMixin
|
||||
from metagpt.utils.common import (
|
||||
any_to_name,
|
||||
any_to_str,
|
||||
|
|
@ -126,7 +126,7 @@ class RoleContext(BaseModel):
|
|||
return self.memory.get()
|
||||
|
||||
|
||||
class Role(SerDeserMixin, is_polymorphic_base=True):
|
||||
class Role(SerializationMixin, is_polymorphic_base=True):
|
||||
"""Role/Agent"""
|
||||
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True, exclude=["llm"])
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ from metagpt.utils.serialize import (
|
|||
)
|
||||
|
||||
|
||||
class SerDeserMixin(BaseModel):
|
||||
class SerializationMixin(BaseModel):
|
||||
"""SereDeserMixin for subclass' ser&deser"""
|
||||
|
||||
__is_polymorphic_base = False
|
||||
|
|
@ -62,7 +62,7 @@ class SerDeserMixin(BaseModel):
|
|||
|
||||
@classmethod
|
||||
def __get_pydantic_core_schema__(
|
||||
cls, source: type["SerDeserMixin"], handler: Callable[[Any], core_schema.CoreSchema]
|
||||
cls, source: type["SerializationMixin"], handler: Callable[[Any], core_schema.CoreSchema]
|
||||
) -> core_schema.CoreSchema:
|
||||
schema = handler(source)
|
||||
og_schema_ref = schema["ref"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue