<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
    <services>
        <service id="RiccardoChat\Core\Content\Chat\ConversationDefinition">
            <tag name="shopware.entity.definition" entity="riccardo_chat_conversation"/>
        </service>
        <service id="RiccardoChat\Core\Content\Chat\MessageDefinition">
            <tag name="shopware.entity.definition" entity="riccardo_chat_message"/>
        </service>

        <service id="RiccardoChat\Core\Chat\Retrieval\ShopKnowledge">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
        </service>
        <service id="RiccardoChat\Core\Chat\SystemPrompt"/>
        <service id="RiccardoChat\Core\Chat\UsageGuard">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
        </service>

        <service id="RiccardoChat\Core\Chat\AnthropicProvider">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="logger"/>
        </service>
        <service id="RiccardoChat\Core\Chat\FallbackProvider"/>

        <service id="RiccardoChat\Core\Chat\ChatService">
            <argument type="service" id="riccardo_chat_conversation.repository"/>
            <argument type="service" id="riccardo_chat_message.repository"/>
            <argument type="service" id="RiccardoChat\Core\Chat\Retrieval\ShopKnowledge"/>
            <argument type="service" id="RiccardoChat\Core\Chat\SystemPrompt"/>
            <argument type="service" id="RiccardoChat\Core\Chat\UsageGuard"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="RiccardoChat\Core\Chat\AnthropicProvider"/>
            <argument type="service" id="RiccardoChat\Core\Chat\FallbackProvider"/>
        </service>

        <service id="RiccardoChat\Storefront\Controller\ChatController" public="true">
            <argument type="service" id="RiccardoChat\Core\Chat\ChatService"/>
            <call method="setContainer"><argument type="service" id="service_container"/></call>
        </service>
    </services>
</container>
