Files
QodeAssist/sources/agents/partials/openai_assistant.jinja
2026-06-11 13:36:23 +02:00

20 lines
483 B
Django/Jinja

{% set tcalls = filter_by_type(msg.content_blocks, "tool_use") %}
{
"role": "assistant",
"content": {% if msg.content != "" %}{{ tojson(msg.content) }}{% else %}null{% endif %}
{% 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 %}
},