refactor: Move to agent architecture

This commit is contained in:
Petr Mironychev
2026-05-30 14:50:49 +02:00
parent 34ce787320
commit ccc2ec2e80
364 changed files with 10801 additions and 19020 deletions

View File

@@ -0,0 +1,46 @@
schema_version = 1
name = "OpenAI Responses Base"
description = "OpenAI Responses API request body (/responses). Abstract — extend it and set model."
abstract = true
provider_instance = "OpenAI (Responses API)"
endpoint = "/responses"
[body]
stream = true
instructions = """{% if existsIn(ctx, "system_prompt") %}{{ tojson(ctx.system_prompt) }}{% endif %}"""
input = """
[
{% for msg in ctx.history %}
{% if msg.role == "assistant" %}
{% if msg.content != "" %}
{ "role": "assistant", "content": {{ tojson(msg.content) }} },
{% endif %}
{% for b in filter_by_type(msg.content_blocks, "tool_use") %}
{ "type": "function_call", "call_id": {{ tojson(b.id) }}, "name": {{ tojson(b.name) }}, "arguments": {{ tojson(tojson(b.input)) }} },
{% endfor %}
{% else if length(filter_by_type(msg.content_blocks, "tool_result")) > 0 %}
{% for b in filter_by_type(msg.content_blocks, "tool_result") %}
{ "type": "function_call_output", "call_id": {{ tojson(b.tool_use_id) }}, "output": {{ tojson(b.content) }} },
{% endfor %}
{% else %}
{% if existsIn(msg, "images") %}
{ "role": "user", "content": [
{ "type": "input_text", "text": {{ tojson(msg.content) }} }
{% for img in msg.images %}
,
{% if img.is_url %}
{ "type": "input_image", "detail": "auto", "image_url": {{ tojson(img.data) }} }
{% else %}
{ "type": "input_image", "detail": "auto", "image_url": "data:{{ img.media_type }};base64,{{ img.data }}" }
{% endif %}
{% endfor %}
] },
{% else %}
{ "role": "user", "content": {{ tojson(msg.content) }} },
{% endif %}
{% endif %}
{% endfor %}
]
"""