fix tests

This commit is contained in:
geekan 2024-01-08 18:04:22 +08:00
parent fee24bbdfb
commit d2233beff4

View file

@ -2,11 +2,12 @@ from typing import Optional
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__()
super().__init__(mock_llm_config)
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