Files
QodeAssist/sources/agents/partials/openai_assistant.jinja
2026-06-09 08:48:32 +02:00

20 lines
432 B
Django/Jinja

{% set tcalls = filter_by_type(msg.content_blocks, "tool_use") %}
{
"role": "assistant",
"content": {{ tojson(msg.content) }}
{% if length(tcalls) > 0 %}
, "tool_calls": [
{% for b in tcalls %}
{
"id": {{ tojson(b.id) }},
"type": "function",
"function": {
"name": {{ tojson(b.name) }},
"arguments": {{ tojson(tojson(b.input)) }}
}
},
{% endfor %}
]
{% endif %}
},