mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
refine code
This commit is contained in:
parent
f5bb850f25
commit
5cd5eebc5b
12 changed files with 67 additions and 56 deletions
|
|
@ -79,3 +79,6 @@ def test_config_mixin_3():
|
|||
assert obj.b == "b"
|
||||
assert obj.c == "c"
|
||||
assert obj.d == "d"
|
||||
|
||||
print(obj.__dict__.keys())
|
||||
assert "_config" in obj.__dict__.keys()
|
||||
|
|
|
|||
|
|
@ -66,7 +66,5 @@ def test_context_2():
|
|||
def test_context_3():
|
||||
ctx = Context()
|
||||
ctx.use_llm(provider=LLMType.OPENAI)
|
||||
assert ctx.llm_config is not None
|
||||
assert ctx.llm_config.api_type == LLMType.OPENAI
|
||||
assert ctx.llm is not None
|
||||
assert "gpt" in ctx.llm.model
|
||||
assert ctx.llm() is not None
|
||||
assert "gpt" in ctx.llm().model
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
import pytest
|
||||
|
||||
from metagpt.config import CONFIG
|
||||
from metagpt.context import CONTEXT
|
||||
from metagpt.tools.moderation import Moderation
|
||||
|
||||
|
||||
|
|
@ -27,7 +28,7 @@ async def test_amoderation(content):
|
|||
assert not CONFIG.OPENAI_API_TYPE
|
||||
assert CONFIG.OPENAI_API_MODEL
|
||||
|
||||
moderation = Moderation()
|
||||
moderation = Moderation(CONTEXT.llm())
|
||||
results = await moderation.amoderation(content=content)
|
||||
assert isinstance(results, list)
|
||||
assert len(results) == len(content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue