Bugfix/model tests (#4092)

* trying out a fix

* add ability to manually run model tests

* add log dump

* check status code, not text?

* just the model server

* add port mapping to host

* pass through more api keys

* add azure tests

* fix litellm env vars

* fix env vars in github workflow

* temp disable litellm test

---------

Co-authored-by: Richard Kuo (Danswer) <rkuo@onyx.app>
This commit is contained in:
rkuo-danswer
2025-02-24 20:53:51 -08:00
committed by GitHub
parent 5d58a5e3ea
commit 60bd9271f7
3 changed files with 66 additions and 5 deletions

View File

@@ -71,12 +71,13 @@ def litellm_embedding_model() -> EmbeddingModel:
normalize=True,
query_prefix=None,
passage_prefix=None,
api_key=os.getenv("LITE_LLM_API_KEY"),
api_key=os.getenv("LITELLM_API_KEY"),
provider_type=EmbeddingProvider.LITELLM,
api_url=os.getenv("LITE_LLM_API_URL"),
api_url=os.getenv("LITELLM_API_URL"),
)
@pytest.mark.skip(reason="re-enable when we can get the correct litellm key and url")
def test_litellm_embedding(litellm_embedding_model: EmbeddingModel) -> None:
_run_embeddings(VALID_SAMPLE, litellm_embedding_model, 1536)
_run_embeddings(TOO_LONG_SAMPLE, litellm_embedding_model, 1536)
@@ -117,6 +118,11 @@ def azure_embedding_model() -> EmbeddingModel:
)
def test_azure_embedding(azure_embedding_model: EmbeddingModel) -> None:
_run_embeddings(VALID_SAMPLE, azure_embedding_model, 1536)
_run_embeddings(TOO_LONG_SAMPLE, azure_embedding_model, 1536)
# NOTE (chris): this test doesn't work, and I do not know why
# def test_azure_embedding_model_rate_limit(azure_embedding_model: EmbeddingModel):
# """NOTE: this test relies on a very low rate limit for the Azure API +