fix tests

This commit is contained in:
geekan 2024-01-08 18:30:04 +08:00
parent d2233beff4
commit 76d05e44f4
6 changed files with 34 additions and 16 deletions

View file

@ -1,13 +1,13 @@
from typing import Optional
from metagpt.config2 import config
from metagpt.logs import log_llm_stream, logger
from metagpt.provider.openai_api import OpenAILLM
from tests.metagpt.provider.mock_llm_config import mock_llm_config
class MockLLM(OpenAILLM):
def __init__(self, allow_open_api_call):
super().__init__(mock_llm_config)
super().__init__(config.get_openai_llm())
self.allow_open_api_call = allow_open_api_call
self.rsp_cache: dict = {}
self.rsp_candidates: list[dict] = [] # a test can have multiple calls with the same llm, thus a list