Search by

symfony / ai-open-router-platform

fabpot

OpenRouter platform bridge for Symfony AI

Package info

github.com/symfony/ai-open-router-platform

Type:symfony-ai-platform

pkg:composer/symfony/ai-open-router-platform

Statistics

Installs: 154 754

Dependents: 10

Suggesters: 2

Stars: 1

v1.0.0-BETA1 2026-10-26 14:03 UTC

This package is auto-updated.

Last update: 2026-11-06 18:15:53 UTC


README

OpenRouter platform bridge for Symfony AI.

Decision models

Decision models are served through the experimental POST /api/alpha/decisions endpoint. This requires symfony/ai-decision-platform. They are queried with the Evaluation of the Decision bridge and answer with its Answers. Use the DecisionModelCatalog or the ModelApiCatalog, which lists them via GET /v1/models?output_modalities=decisions.

use Symfony\AI\Platform\Bridge\Decision\Evaluation;
use Symfony\AI\Platform\Bridge\Decision\Question\NoulQuestion;
use Symfony\AI\Platform\Bridge\OpenRouter\Decision\DecisionModelCatalog;
use Symfony\AI\Platform\Bridge\OpenRouter\Factory;

$platform = Factory::createPlatform($apiKey, modelCatalog: new DecisionModelCatalog());

$answers = $platform->invoke('typesafe/jev-1.13', new Evaluation($ticket, [
    'is_bug' => new NoulQuestion('Is this a software defect?', 'Broken behavior', 'A question or feature request'),
]))->asObject();

When a NoulQuestion has criteria, OpenRouter requires both the true and the false one. The provider, session_id, trace and user options are forwarded to the request. Image inputs and box questions are not supported yet.

OpenRouter Documentation

Resources