From 2c65b973b714d30f1545d670c9ec08d55481daca Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 24 Sep 2025 13:13:18 +0200 Subject: [PATCH] Import FQCNs in examples instead of using inline class names - Add proper use statements for TokenOutputProcessor in vertexai/token-metadata.php - Add proper use statement for ChromaDB\Factory in rag/chromadb.php - Replace inline FQCN usage with imported class names for better readability --- examples/rag/chromadb.php | 3 ++- examples/vertexai/token-metadata.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/rag/chromadb.php b/examples/rag/chromadb.php index 0bbec99c6..9f767abd5 100644 --- a/examples/rag/chromadb.php +++ b/examples/rag/chromadb.php @@ -9,6 +9,7 @@ * file that was distributed with this source code. */ +use Codewithkyrian\ChromaDB\Factory; use Symfony\AI\Agent\Agent; use Symfony\AI\Agent\Toolbox\AgentProcessor; use Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch; @@ -32,7 +33,7 @@ // initialize the store $store = new Store( - (new Codewithkyrian\ChromaDB\Factory()) + (new Factory()) ->withHost(env('CHROMADB_HOST')) ->withPort((int) env('CHROMADB_PORT')) ->connect(), diff --git a/examples/vertexai/token-metadata.php b/examples/vertexai/token-metadata.php index 56ed15575..2f137b8e0 100644 --- a/examples/vertexai/token-metadata.php +++ b/examples/vertexai/token-metadata.php @@ -12,6 +12,7 @@ use Symfony\AI\Agent\Agent; use Symfony\AI\Platform\Bridge\VertexAi\Gemini\Model; use Symfony\AI\Platform\Bridge\VertexAi\PlatformFactory; +use Symfony\AI\Platform\Bridge\VertexAi\TokenOutputProcessor; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; @@ -20,7 +21,7 @@ $platform = PlatformFactory::create(env('GOOGLE_CLOUD_LOCATION'), env('GOOGLE_CLOUD_PROJECT'), adc_aware_http_client()); $model = new Model(Model::GEMINI_2_0_FLASH_LITE); -$agent = new Agent($platform, $model, outputProcessors: [new Symfony\AI\Platform\Bridge\VertexAi\TokenOutputProcessor()], logger: logger()); +$agent = new Agent($platform, $model, outputProcessors: [new TokenOutputProcessor()], logger: logger()); $messages = new MessageBag( Message::forSystem('You are an expert assistant in animal study.'), Message::ofUser('What does a cat usually eat?'),