from django.urls import include, path

from ocyan.core.plugins import OcyanPluginConfig


class AiAssistantConfig(OcyanPluginConfig):
    def contribute_to_installed_apps(self, installed_apps):
        installed_apps.ocyan.append("ocyan.plugin.ai_assistant")
        return installed_apps

    def contribute_to_urlpatterns(self, urlpatterns):
        new_patterns = [
            path(
                "ai-assistant/",
                include(
                    ("ocyan.plugin.ai_assistant.urls", "ai_assistant"),
                    namespace="ai_assistant",
                ),
            ),
        ]
        return urlpatterns + new_patterns
