mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 16:56:26 +02:00
refine code
This commit is contained in:
parent
ba477a93d5
commit
cd29edcc4f
5 changed files with 14 additions and 23 deletions
|
|
@ -64,7 +64,10 @@ def test_context_2():
|
|||
|
||||
|
||||
def test_context_3():
|
||||
ctx = Context()
|
||||
ctx.use_llm(provider=LLMType.OPENAI)
|
||||
assert ctx.llm() is not None
|
||||
assert "gpt" in ctx.llm().model
|
||||
# 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
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
import pytest
|
||||
|
||||
from metagpt.config import CONFIG
|
||||
from metagpt.context import CONTEXT
|
||||
from metagpt.llm import LLM
|
||||
from metagpt.tools.moderation import Moderation
|
||||
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ async def test_amoderation(content):
|
|||
assert not CONFIG.OPENAI_API_TYPE
|
||||
assert CONFIG.OPENAI_API_MODEL
|
||||
|
||||
moderation = Moderation(CONTEXT.llm())
|
||||
moderation = Moderation(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