mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-27 20:15:01 +02:00
✨(backend) allow to use new ai feature using mistral sdk
We give the possibility, for the new ai feature, to choose between using the OpenAI or Mistral sdk. For instances having access to the mistral infrastructure, using it is mor appropriated than using the openai compatible chat model.
This commit is contained in:
@@ -14,6 +14,7 @@ import pytest
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from core import factories, models
|
||||
from core.services.ai_services import configure_legacy_openai_client
|
||||
from core.tests.documents.test_api_documents_ai_proxy import ( # pylint: disable=unused-import
|
||||
ai_settings,
|
||||
)
|
||||
@@ -23,6 +24,13 @@ pytestmark = pytest.mark.django_db
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clear_openai_client_config():
|
||||
"""Clear the configure_legacy_openai_client cache."""
|
||||
yield
|
||||
configure_legacy_openai_client.cache_clear()
|
||||
|
||||
|
||||
def test_external_api_documents_ai_transform_not_allowed(
|
||||
user_token, resource_server_backend, user_specific_sub
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user