Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

921 B
Raw Blame
{% from 'types.jinja2' import hint %}
class {{ class_name }}({{ base_class }}):
{% if config %}
{% filter indent(4, true) %}{% include 'ConfigDict.jinja2' %}{% endfilter %}
{% endif %}
{%- for field in fields %}
{%- set normalized = field.extras.get("x-python-normalized") %}
    {{ field.name }}: {% if normalized %}{{ normalized.type }}{% if "minimum" in normalized %} = Field({% if field.required %}...{% else %}{{ field.default | int }}{% endif %}, ge={{ normalized.minimum }}, le={{ normalized.maximum }}){% elif not field.required %} = {{ "True" if field.default else "False" }}{% endif %}{% else %}{{ hint(field.data_type) }}{% if not field.required and field.default == [] %} = (){% elif field.field %} = {{ field.field }}{% elif not field.required or field.use_default_with_required %} = {{ field.represented_default }}{% endif %}{% endif %}
{%- endfor %}
{% if not fields and not config %}
    pass
{% endif %}