OpenAIResponseInputTokensDetails (openai/models.py)

software-agent-sdk · openhands-agent-server/openhands/agent_server/openai/models.py · python · MIT
ai, AI / Agents

Defines Pydantic models representing OpenAI-compatible request and response structures for the agent server.

# Source: https://github.com/OpenHands/software-agent-sdk | License: MIT | Copyright 2026 OpenHands contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""Models for the OpenAI-compatible agent-server gateway."""

from typing import Literal

from openai.types import CompletionUsage, Model
from openai.types.chat import ChatCompletion, ChatCompletionChunk
from openai.types.chat.chat_completion import Choice
from openai.types.chat.chat_completion_chunk import Choice as ChunkChoice, ChoiceDelta
from openai.types.chat.chat_completion_message import ChatCompletionMessage
from pydantic import BaseModel, ConfigDict


OpenAIChatCompletionChoice = Choice
OpenAIChatCompletionChunk = ChatCompletionChunk
OpenAIChatCompletionChunkChoice = ChunkChoice
OpenAIChatCompletionChunkCho

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key