-
-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
AI BundleIssues & PRs about the AI integration bundleIssues & PRs about the AI integration bundleAgentIssues & PRs about the AI Agent componentIssues & PRs about the AI Agent componentBugSomething isn't workingSomething isn't workingStatus: Needs Review
Description
I registered a custom service as memory provider like this:
ai:
platform:
openai:
api_key: '%env(OPENAI_API_KEY)%'
agent:
default:
model:
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
name: 'gpt-4o-mini'
prompt: 'You are a pirate and you write funny.'
memory: 'App\MyMemory'And the implementation looks like this:
<?php
declare(strict_types=1);
namespace App;
use Symfony\AI\Agent\Input;
use Symfony\AI\Agent\Memory\Memory;
use Symfony\AI\Agent\Memory\MemoryProviderInterface;
final readonly class MyMemory implements MemoryProviderInterface
{
public function __construct(
private string $myMemory,
) {
}
public function load(Input $input): array
{
return [
new Memory(file_get_contents($this->myMemory)),
];
}
}But this is always false for App\MyMemory:
ai/src/ai-bundle/src/AiBundle.php
Line 628 in f691523
| if ($container->hasDefinition($memoryValue) || $container->hasAlias($memoryValue)) { |
Metadata
Metadata
Assignees
Labels
AI BundleIssues & PRs about the AI integration bundleIssues & PRs about the AI integration bundleAgentIssues & PRs about the AI Agent componentIssues & PRs about the AI Agent componentBugSomething isn't workingSomething isn't workingStatus: Needs Review