async_openai/types/chat/
schema.rs1use super::*;
7use crate::types::shared::schema::schema;
8use utoipa::openapi::{schema::AnyOfBuilder, schema::ObjectBuilder, Type};
9
10schema!(
13 Prompt,
14 "async_openai.Prompt",
15 AnyOfBuilder::new()
16 .item(String::schema())
17 .item(Vec::<String>::schema())
18 .item(Vec::<u32>::schema())
19 .item(Vec::<Vec<u32>>::schema()),
20 []
21);
22
23schema!(
24 ChatCompletionFunctionCall,
25 "async_openai.ChatCompletionFunctionCall",
26 AnyOfBuilder::new()
27 .item(
28 ObjectBuilder::new()
29 .schema_type(Type::String)
30 .enum_values(Some(["none", "auto"]))
31 )
32 .item(FunctionName::schema()),
33 [FunctionName]
34);
35
36schema!(
39 ChatCompletionAudioVoice,
40 "async_openai.ChatCompletionAudioVoice",
41 String::schema(),
42 []
43);
44
45#[derive(utoipa::ToSchema)]
47#[serde(tag = "type", rename_all = "snake_case")]
48#[allow(dead_code)]
49enum TaggedToolChoice {
50 AllowedTools(ChatCompletionAllowedToolsChoice),
51 Function(ChatCompletionNamedToolChoice),
52 Custom(ChatCompletionNamedToolChoiceCustom),
53}
54
55schema!(
56 ChatCompletionToolChoiceOption,
57 "async_openai.ChatCompletionToolChoiceOption",
58 AnyOfBuilder::new()
59 .item(TaggedToolChoice::schema())
60 .item(ToolChoiceOptions::schema()),
61 [TaggedToolChoice, ToolChoiceOptions]
62);