Extract OpenAI API retry handler and unify ADA embeddings calls. (#3191)

* Extract retry logic, unify embedding functions

* Add some docstrings

* Remove embedding creation from API manager

* Add test suite for retry handler

* Make api manager fixture

* Fix typing

* Streamline tests
This commit is contained in:
James Collins
2023-04-25 11:12:24 -07:00
committed by GitHub
parent 940b115f0a
commit 2619740daa
9 changed files with 242 additions and 93 deletions

View File

@@ -21,7 +21,7 @@ def LocalCache():
@pytest.fixture
def mock_embed_with_ada(mocker):
mocker.patch(
"autogpt.memory.local.create_embedding_with_ada",
"autogpt.memory.local.get_ada_embedding",
return_value=[0.1] * EMBED_DIM,
)