mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
fixbug: role option, cost_manager argments
This commit is contained in:
parent
8eaf22dd62
commit
9600787d63
1 changed files with 8 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from enum import StrEnum
|
||||
from typing import Type, TypedDict, Set, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
|
@ -16,6 +17,10 @@ from pydantic import BaseModel
|
|||
from metagpt.logs import logger
|
||||
|
||||
|
||||
class MessageTag(StrEnum):
|
||||
Prerequisite = "prerequisite"
|
||||
|
||||
|
||||
class RawMessage(TypedDict):
|
||||
content: str
|
||||
role: str
|
||||
|
|
@ -61,6 +66,7 @@ class UserMessage(Message):
|
|||
"""便于支持OpenAI的消息
|
||||
Facilitate support for OpenAI messages
|
||||
"""
|
||||
|
||||
def __init__(self, content: str):
|
||||
super().__init__(content, 'user')
|
||||
|
||||
|
|
@ -70,6 +76,7 @@ class SystemMessage(Message):
|
|||
"""便于支持OpenAI的消息
|
||||
Facilitate support for OpenAI messages
|
||||
"""
|
||||
|
||||
def __init__(self, content: str):
|
||||
super().__init__(content, 'system')
|
||||
|
||||
|
|
@ -79,6 +86,7 @@ class AIMessage(Message):
|
|||
"""便于支持OpenAI的消息
|
||||
Facilitate support for OpenAI messages
|
||||
"""
|
||||
|
||||
def __init__(self, content: str):
|
||||
super().__init__(content, 'assistant')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue