mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 11:56:24 +02:00
add openai api call switch; fix ocr
This commit is contained in:
parent
ab04f610a3
commit
1249d12b6f
4 changed files with 30 additions and 22 deletions
|
|
@ -23,6 +23,8 @@ from metagpt.utils.git_repository import GitRepository
|
|||
from tests.mock.mock_llm import MockLLM
|
||||
|
||||
RSP_CACHE_NEW = {} # used globally for producing new and useful only response cache
|
||||
ALLOW_OPENAI_API_CALL = os.environ.get("ALLOW_OPENAI_API_CALL", False)
|
||||
ALLOW_OPENAI_API_CALL = True
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
|
@ -53,7 +55,7 @@ def pytest_runtest_makereport(item, call):
|
|||
|
||||
@pytest.fixture(scope="function", autouse=True)
|
||||
def llm_mock(rsp_cache, mocker, request):
|
||||
llm = MockLLM()
|
||||
llm = MockLLM(allow_open_api_call=ALLOW_OPENAI_API_CALL)
|
||||
llm.rsp_cache = rsp_cache
|
||||
mocker.patch("metagpt.provider.base_llm.BaseLLM.aask", llm.aask)
|
||||
mocker.patch("metagpt.provider.base_llm.BaseLLM.aask_batch", llm.aask_batch)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue