use super::*;
use crate::types::shared::schema::schema;
use utoipa::openapi::{schema::AnyOfBuilder, schema::ObjectBuilder, Type};
schema!(
Prompt,
"async_openai.Prompt",
AnyOfBuilder::new()
.item(String::schema())
.item(Vec::<String>::schema())
.item(Vec::<u32>::schema())
.item(Vec::<Vec<u32>>::schema()),
[]
);
schema!(
ChatCompletionFunctionCall,
"async_openai.ChatCompletionFunctionCall",
AnyOfBuilder::new()
.item(
ObjectBuilder::new()
.schema_type(Type::String)
.enum_values(Some(["none", "auto"]))
)
.item(FunctionName::schema()),
[FunctionName]
);
schema!(
ChatCompletionAudioVoice,
"async_openai.ChatCompletionAudioVoice",
String::schema(),
[]
);
#[derive(utoipa::ToSchema)]
#[serde(tag = "type", rename_all = "snake_case")]
#[allow(dead_code)]
enum TaggedToolChoice {
AllowedTools(ChatCompletionAllowedToolsChoice),
Function(ChatCompletionNamedToolChoice),
Custom(ChatCompletionNamedToolChoiceCustom),
}
schema!(
ChatCompletionToolChoiceOption,
"async_openai.ChatCompletionToolChoiceOption",
AnyOfBuilder::new()
.item(TaggedToolChoice::schema())
.item(ToolChoiceOptions::schema()),
[TaggedToolChoice, ToolChoiceOptions]
);