Enhancement (dev): Use OpenAI-like backend (#12668)

This commit is contained in:
shamoon
2026-04-28 10:06:59 -07:00
committed by GitHub
parent 2f8f126223
commit 69cb4d06c6
17 changed files with 136 additions and 83 deletions
+1 -1
View File
@@ -848,7 +848,7 @@ class TestApiAppConfig(DirectoriesMixin, APITestCase):
json.dumps(
{
"ai_enabled": True,
"llm_embedding_backend": "openai",
"llm_embedding_backend": "openai-like",
},
),
content_type="application/json",
+2 -2
View File
@@ -404,7 +404,7 @@ class TestSystemStatus(APITestCase):
THEN:
- The response contains the correct AI status
"""
with override_settings(AI_ENABLED=True, LLM_EMBEDDING_BACKEND="openai"):
with override_settings(AI_ENABLED=True, LLM_EMBEDDING_BACKEND="openai-like"):
self.client.force_login(self.user)
# No tasks found
@@ -431,7 +431,7 @@ class TestSystemStatus(APITestCase):
THEN:
- The response contains the correct AI status
"""
with override_settings(AI_ENABLED=True, LLM_EMBEDDING_BACKEND="openai"):
with override_settings(AI_ENABLED=True, LLM_EMBEDDING_BACKEND="openai-like"):
PaperlessTaskFactory(
task_type=PaperlessTask.TaskType.LLM_INDEX,
trigger_source=PaperlessTask.TriggerSource.SCHEDULED,
+4 -2
View File
@@ -359,7 +359,7 @@ class TestAISuggestions(DirectoriesMixin, TestCase):
@patch("documents.views.get_ai_document_classification")
@override_settings(
AI_ENABLED=True,
LLM_BACKEND="openai",
LLM_BACKEND="openai-like",
)
def test_suggestions_with_invalid_ai_configuration(
self,
@@ -379,7 +379,9 @@ class TestAISuggestions(DirectoriesMixin, TestCase):
"ai": ["Invalid AI configuration."],
},
)
self.assertIsNone(get_llm_suggestion_cache(self.document.pk, backend="openai"))
self.assertIsNone(
get_llm_suggestion_cache(self.document.pk, backend="openai-like"),
)
def test_invalidate_suggestions_cache(self) -> None:
self.client.force_login(user=self.user)