✨(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:
Manuel Raynaud
2026-04-30 09:32:34 +02:00
parent fa9d56d79b
commit b6efac3983
14 changed files with 284 additions and 116 deletions
@@ -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
):