vapi_client/models/
open_ai_responses_request.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OpenAiResponsesRequest {
16    /// This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
17    #[serde(rename = "assistantId", skip_serializing_if = "Option::is_none")]
18    pub assistant_id: Option<String>,
19    /// This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
20    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
21    pub assistant: Option<models::CreateAssistantDto>,
22    /// This is the name of the chat. This is just for your own reference.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// This is the ID of the session that will be used for the chat. Mutually exclusive with previousChatId.
26    #[serde(rename = "sessionId", skip_serializing_if = "Option::is_none")]
27    pub session_id: Option<String>,
28    #[serde(rename = "input")]
29    pub input: models::CreateChatDtoInput,
30    /// Whether to stream the response or not.
31    #[serde(rename = "stream", skip_serializing_if = "Option::is_none")]
32    pub stream: Option<bool>,
33    /// This is the ID of the chat that will be used as context for the new chat. The messages from the previous chat will be used as context. Mutually exclusive with sessionId.
34    #[serde(rename = "previousChatId", skip_serializing_if = "Option::is_none")]
35    pub previous_chat_id: Option<String>,
36}
37
38impl OpenAiResponsesRequest {
39    pub fn new(input: models::CreateChatDtoInput) -> OpenAiResponsesRequest {
40        OpenAiResponsesRequest {
41            assistant_id: None,
42            assistant: None,
43            name: None,
44            session_id: None,
45            input,
46            stream: None,
47            previous_chat_id: None,
48        }
49    }
50}