dynamo_llm/
endpoint_type.rs

1// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5use strum::Display;
6
7#[derive(Copy, Debug, Clone, Display, Serialize, Deserialize, Eq, PartialEq, Hash)]
8pub enum EndpointType {
9    // Chat Completions API
10    Chat,
11    /// Older completions API
12    Completion,
13    /// Embeddings API
14    Embedding,
15    /// Responses API
16    Responses,
17}
18
19impl EndpointType {
20    pub fn as_str(&self) -> &str {
21        match self {
22            Self::Chat => "chat",
23            Self::Completion => "completion",
24            Self::Embedding => "embedding",
25            Self::Responses => "responses",
26        }
27    }
28
29    pub fn all() -> Vec<Self> {
30        vec![
31            Self::Chat,
32            Self::Completion,
33            Self::Embedding,
34            Self::Responses,
35        ]
36    }
37}