mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-20 16:51:07 +02:00
migrate from pydantic v1 to v2
This commit is contained in:
parent
0569fc5560
commit
66925dd791
29 changed files with 143 additions and 158 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import asyncio
|
||||
from typing import AsyncGenerator, Awaitable, Callable
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from metagpt.logs import logger
|
||||
from metagpt.roles import Role
|
||||
|
|
@ -33,10 +33,9 @@ class SubscriptionRunner(BaseModel):
|
|||
>>> asyncio.run(main())
|
||||
"""
|
||||
|
||||
tasks: dict[Role, asyncio.Task] = Field(default_factory=dict)
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
tasks: dict[Role, asyncio.Task] = Field(default_factory=dict)
|
||||
|
||||
async def subscribe(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue