use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ChatCompletionResponseMessageAnnotationsInnerUrlCitation {
#[serde(rename = "end_index")]
pub end_index: i32,
#[serde(rename = "start_index")]
pub start_index: i32,
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "title")]
pub title: String,
}
impl ChatCompletionResponseMessageAnnotationsInnerUrlCitation {
pub fn new(
end_index: i32,
start_index: i32,
url: String,
title: String,
) -> ChatCompletionResponseMessageAnnotationsInnerUrlCitation {
ChatCompletionResponseMessageAnnotationsInnerUrlCitation {
end_index,
start_index,
url,
title,
}
}
}
impl std::fmt::Display for ChatCompletionResponseMessageAnnotationsInnerUrlCitation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}