Skip to content

Commit d1eaa29

Browse files
committed
minor #42 (minor) Rename remaining "chain" into "agent" (smnandre)
This PR was merged into the main branch. Discussion ---------- (minor) Rename remaining "chain" into "agent" | Q | A | ------------- | --- | Bug fix? | yes/no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT Spotted while playing with the code (so much to react to in this repo but in a few words: this look very very **very** promising 👏 ) Commits ------- 1714001 (minor) Rename remaining "chain" into "agent"
2 parents 96c9a47 + 1714001 commit d1eaa29

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

demo/src/Wikipedia/Chat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class Chat
2525
public function __construct(
2626
private readonly RequestStack $requestStack,
2727
#[Autowire(service: 'symfony_ai.agent.wikipedia')]
28-
private readonly AgentInterface $chain,
28+
private readonly AgentInterface $agent,
2929
) {
3030
}
3131

@@ -39,7 +39,7 @@ public function submitMessage(string $message): void
3939
$messages = $this->loadMessages();
4040

4141
$messages->add(Message::ofUser($message));
42-
$response = $this->chain->call($messages);
42+
$response = $this->agent->call($messages);
4343

4444
\assert($response instanceof TextResponse);
4545

examples/google/toolcall.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
$toolbox = Toolbox::create(new Clock());
3434
$processor = new AgentProcessor($toolbox);
35-
$chain = new Agent($platform, $llm, [$processor], [$processor]);
35+
$agent = new Agent($platform, $llm, [$processor], [$processor]);
3636

3737
$messages = new MessageBag(Message::ofUser('What time is it?'));
38-
$response = $chain->call($messages);
38+
$response = $agent->call($messages);
3939

4040
echo $response->getContent().\PHP_EOL;

src/ai-bundle/src/DependencyInjection/AIExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
302302
// We use the memory factory in case method, description and name are set
303303
if (isset($tool['name'], $tool['description'])) {
304304
if ($tool['is_agent']) {
305-
$chainWrapperDefinition = new Definition(AgentTool::class, ['$agent' => $reference]);
306-
$container->setDefinition('symfony_ai.toolbox.'.$name.'.agent_wrapper.'.$tool['name'], $chainWrapperDefinition);
305+
$agentWrapperDefinition = new Definition(AgentTool::class, ['$agent' => $reference]);
306+
$container->setDefinition('symfony_ai.toolbox.'.$name.'.agent_wrapper.'.$tool['name'], $agentWrapperDefinition);
307307
$reference = new Reference('symfony_ai.toolbox.'.$name.'.agent_wrapper.'.$tool['name']);
308308
}
309309
$memoryFactoryDefinition->addMethodCall('addTool', [$reference, $tool['name'], $tool['description'], $tool['method'] ?? '__invoke']);

0 commit comments

Comments
 (0)