Pydantic models for OpenAI-compatible Responses API with text, tools, and streaming events.
# Source: https://github.com/waybarrios/vllm-mlx | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
# SPDX-License-Identifier: Apache-2.0
"""
Pydantic models for the OpenAI-compatible Responses API.
This intentionally implements the subset needed for local coding-agent
workflows: text messages, function tools, function call outputs, and SSE
streaming events. The object and event shapes follow the conventions used by
OpenAI's gpt-oss reference server and llama.cpp's OpenAI-compatible server.
"""
import time
import uuid
from typing import Literal
from typing import Any
from pydantic import BaseModel, Field, computed_field
class ResponseTextFormat(BaseModel):
"""Output text form
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key