:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
from typing import Any
from pydantic import BaseModel, ConfigDict
class ChatCompletionRequest(BaseModel):
model_config = ConfigDict(extra="allow")
model: str
messages: list[dict[str, Any]]
stream: bool = False
class ResponsesRequest(BaseModel):
"""OpenAI Responses API request model.
The Responses API is a newer stateful API from OpenAI that supports
multimodal inputs, reasoning models, and persistent conversations.
"""
model_config = ConfigDict(extra="allow")
model: str
input: str | list[dict[str, Any]]
stream: bool = False
max_output_tokens: int | None = None
previous_response_id: str | None = None
class TranscriptionRequest(BaseModel):
model_config = ConfigDict(extra="allow")
model: str
file: tuple[str, bytes, str] # (filename, content, content_type)
language: str | None = None