AzureOpenAI Embedding Model and LLM Model Initialisation from Config. (#1773)

This commit is contained in:
k10
2024-09-01 02:09:00 +05:30
committed by GitHub
parent ad233034ef
commit 077d0c47f9
10 changed files with 88 additions and 22 deletions

View File

@@ -103,12 +103,16 @@ def test_generate_with_http_proxies():
with (patch("mem0.llms.azure_openai.AzureOpenAI") as mock_azure_openai,
patch("httpx.Client", new=mock_http_client) as mock_http_client):
config = BaseLlmConfig(model=MODEL, temperature=TEMPERATURE, max_tokens=MAX_TOKENS, top_p=TOP_P,
api_key="test", http_client_proxies="http://testproxy.mem0.net:8000")
api_key="test", http_client_proxies="http://testproxy.mem0.net:8000",
azure_kwargs= {"api_key" : "test"})
_ = AzureOpenAILLM(config)
mock_azure_openai.assert_called_once_with(
api_key="test",
http_client=mock_http_client_instance
http_client=mock_http_client_instance,
azure_deployment=None,
azure_endpoint=None,
api_version=None
)
mock_http_client.assert_called_once_with(proxies="http://testproxy.mem0.net:8000")