mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
fix bugs
This commit is contained in:
parent
c715b9c102
commit
92d31fb750
4 changed files with 25 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
|
@ -11,7 +11,7 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from metagpt.config2 import config
|
||||
from metagpt.config2 import Config
|
||||
from metagpt.learn.text_to_embedding import text_to_embedding
|
||||
from metagpt.utils.common import aread
|
||||
|
||||
|
|
@ -19,6 +19,7 @@ from metagpt.utils.common import aread
|
|||
@pytest.mark.asyncio
|
||||
async def test_text_to_embedding(mocker):
|
||||
# mock
|
||||
config = Config.default()
|
||||
mock_post = mocker.patch("aiohttp.ClientSession.post")
|
||||
mock_response = mocker.AsyncMock()
|
||||
mock_response.status = 200
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ class TestOpenAI:
|
|||
def test_make_client_kwargs_without_proxy(self):
|
||||
instance = OpenAILLM(mock_llm_config)
|
||||
kwargs = instance._make_client_kwargs()
|
||||
assert kwargs == {"api_key": "mock_api_key", "base_url": "mock_base_url"}
|
||||
assert kwargs["api_key"] == "mock_api_key"
|
||||
assert kwargs["base_url"] == "mock_base_url"
|
||||
assert "http_client" not in kwargs
|
||||
|
||||
def test_make_client_kwargs_with_proxy(self):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from metagpt.config2 import config
|
||||
from metagpt.config2 import Config
|
||||
from metagpt.tools.openai_text_to_embedding import oas3_openai_text_to_embedding
|
||||
from metagpt.utils.common import aread
|
||||
|
||||
|
|
@ -18,6 +18,7 @@ from metagpt.utils.common import aread
|
|||
@pytest.mark.asyncio
|
||||
async def test_embedding(mocker):
|
||||
# mock
|
||||
config = Config.default()
|
||||
mock_post = mocker.patch("aiohttp.ClientSession.post")
|
||||
mock_response = mocker.AsyncMock()
|
||||
mock_response.status = 200
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue