2026-09-15 00:05:55 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
|
|
|
|
|
2026-02-12 00:52:05 +08:00
|
|
|
from typing import Any
|
|
|
|
|
|
2026-09-15 00:05:55 +08:00
|
|
|
from pydantic import SerializeAsAny
|
|
|
|
|
from vllm.entrypoints.openai.chat_completion.protocol import (
|
|
|
|
|
ChatCompletionResponse,
|
|
|
|
|
ChatCompletionResponseChoice,
|
|
|
|
|
ChatCompletionResponseStreamChoice,
|
|
|
|
|
ChatCompletionStreamResponse,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
from vllm_omni.entrypoints.openai.protocol.audio import AudioChunkMetadata
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OmniChatCompletionResponseStreamChoice(ChatCompletionResponseStreamChoice):
|
|
|
|
|
audio_metadata: AudioChunkMetadata | None = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OmniChatCompletionResponseChoice(ChatCompletionResponseChoice):
|
|
|
|
|
audio_metadata: AudioChunkMetadata | None = None
|
2025-12-31 22:02:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class OmniChatCompletionStreamResponse(ChatCompletionStreamResponse):
|
2026-09-15 00:05:55 +08:00
|
|
|
choices: list[SerializeAsAny[ChatCompletionResponseStreamChoice]]
|
2025-12-31 22:02:04 +08:00
|
|
|
modality: str | None = "text"
|
2026-02-12 00:52:05 +08:00
|
|
|
metrics: dict[str, Any] | None = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OmniChatCompletionResponse(ChatCompletionResponse):
|
2026-09-15 00:05:55 +08:00
|
|
|
choices: list[SerializeAsAny[ChatCompletionResponseChoice]]
|
2026-02-12 00:52:05 +08:00
|
|
|
metrics: dict[str, Any] | None = None
|