{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% if collector.platformCalls|length > 0 %} {% set icon %} {{ include('@Ai/icon.svg', { y: 18 }) }} {{ collector.platformCalls|length }} calls {% endset %} {% set text %}
Configured Platforms 1
Platform Calls {{ collector.platformCalls|length }}
Registered Tools {{ collector.tools|length }}
Messages stored {{ collector.messages|length }}
Tool Calls {{ collector.toolCalls|length }}
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }} {% endif %} {% endblock %} {% block menu %} {{ include('@Ai/icon.svg', { y: 16 }) }} Symfony AI {{ collector.platformCalls|length }} {% endblock %} {% macro tool_calls(toolCalls) %} Tool call{{ toolCalls|length > 1 ? 's' }}:
    {% for toolCall in toolCalls %}
  1. {{ toolCall.name }}({{ toolCall.arguments|map((value, key) => "#{key}: #{value|json_encode}")|join(', ') }}) (ID: {{ toolCall.id }})
  2. {% endfor %}
{% endmacro %} {% block panel %}

Symfony AI

1 Platforms
{{ collector.platformCalls|length }} Platform Calls
{{ collector.tools|length }} Tools
{{ collector.toolCalls|length }} Tool Calls

Platform Calls

{% if collector.platformCalls|length %}

Platform Calls {{ collector.platformCalls|length }}

{% for call in collector.platformCalls %}
Call {{ loop.index }}
Model {{ call.model }}
Input {% if call.input.messages is defined %}{# expect MessageBag #}
    {% for message in call.input.messages %}
  1. {{ message.role.value|title }}: {% if 'assistant' == message.role.value and message.hasToolCalls%} {{ _self.tool_calls(message.toolCalls) }} {% elseif 'tool' == message.role.value %} Result of tool call with ID {{ message.toolCall.id }}
    {{ message.content|nl2br }} {% elseif 'user' == message.role.value %} {% for item in message.content %} {% if item.text is defined %} {{ item.text|nl2br }} {% elseif item.format is defined and item.format starts with 'image/' %} {% elseif item.asDataUrl %} {{ item.filename ?? 'View File' }} {% endif %} {% endfor %} {% else %} {{ message.content|nl2br }} {% endif %}
  2. {% endfor %}
{% else %} {{ dump(call.input) }} {% endif %}
Options
    {% for key, value in call.options %} {% if key == 'tools' %}
  • {{ key }}:
      {% for tool in value %}
    • {{ tool.name }} {% if tool.parameters %} {{ dump(tool.parameters) }} {% endif %}
    • {% endfor %}
  • {% else %}
  • {{ key }}: {{ dump(value) }}
  • {% endif %} {% endfor %}
Result {% if call.input.messages is defined and call.result is iterable %}{# expect array of ToolCall #} {{ _self.tool_calls(call.result) }} {% elseif call.result is iterable %}{# expect array of Vectors #}
    {% for vector in call.result %}
  1. Vector with {{ vector.dimensions }} dimensions
  2. {% endfor %}
{% else %} {{ dump(call.result) }} {% endif %} {% if call.metadata|length > 0 %}
Metadata
    {% for key, value in call.metadata.all %}
  • {{ key }}:
    {{ dump(value) }}
  • {% endfor %}
{% endif %}
{% endfor %}
{% else %}

No platform calls were made.

{% endif %}

Tools

{% if collector.tools|length %} {% for tool in collector.tools %} {% endfor %}
Name Description Class & Method Parameters
{{ tool.name }} {{ tool.description }} {{ tool.reference.class }}::{{ tool.reference.method }} {% if tool.parameters %}
    {% for name, parameter in tool.parameters.properties %}
  • {{ name }} ({{ parameter.type is iterable ? parameter.type|join(', ') : parameter.type }})
    {{ parameter.description|default() }}
  • {% endfor %}
{% else %} none {% endif %}
{% else %}

No tools were registered.

{% endif %}

Tool Calls

{% if collector.toolCalls|length %} {% for toolResult in collector.toolCalls %}
{{ toolResult.toolCall.name }}
ID {{ toolResult.toolCall.id }}
Arguments {{ dump(toolResult.toolCall.arguments) }}
Result {{ dump(toolResult.result) }}
{% endfor %} {% else %}

No tool calls were made.

{% endif %} {% endblock %}