From 074e28ff1767edf4429d7abf4c94b5fe1b016a7b Mon Sep 17 00:00:00 2001 From: stellahsr Date: Sun, 24 Sep 2023 11:22:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0schema=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/environment.py | 1 - metagpt/schema.py | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/metagpt/environment.py b/metagpt/environment.py index 24e6ada2f..8d533d6ca 100644 --- a/metagpt/environment.py +++ b/metagpt/environment.py @@ -7,7 +7,6 @@ """ import asyncio from typing import Iterable - from pydantic import BaseModel, Field from metagpt.memory import Memory diff --git a/metagpt/schema.py b/metagpt/schema.py index 27f5dd10c..9e016059d 100644 --- a/metagpt/schema.py +++ b/metagpt/schema.py @@ -70,7 +70,16 @@ class AIMessage(Message): def __init__(self, content: str): super().__init__(content, 'assistant') +class HumanMessage(Message): + """ + 便于支持OpenAI的消息 + Facilitate support for OpenAI messages + """ + def __init__(self, content: str): + super().__init__(content, 'human') + + if __name__ == '__main__': test_content = 'test_message' msgs = [