Skip to main content

dynamo_protocols/types/
mod.rs

1// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Types used in inference API requests and responses.
5//
6// Base OpenAI types are re-exported from upstream async-openai.
7// Inference-serving extensions and Anthropic types are locally defined.
8
9// --- Locally defined modules ---
10pub mod anthropic;
11mod chat;
12mod completion;
13pub mod responses;
14
15// --- Local type re-exports ---
16pub use chat::*;
17pub use completion::*;
18
19// --- Upstream re-exports (types-only, no HTTP client) ---
20
21// Embeddings (full re-export)
22pub use async_openai::types::embeddings::*;
23
24// Images
25pub use async_openai::types::images::*;
26
27// --- Convenience impls for locally-defined types ---
28mod impls;
29
30use crate::error::OpenAIError;
31use derive_builder::UninitializedFieldError;
32
33impl From<UninitializedFieldError> for OpenAIError {
34    fn from(value: UninitializedFieldError) -> Self {
35        OpenAIError::InvalidArgument(value.to_string())
36    }
37}