mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-18 19:43:26 +02:00
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:
@@ -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 +
|
||||
|
Reference in New Issue
Block a user