mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 15:15:34 +00:00
Merge pull request #128 from dongri/content-text-annotations
Add ContentTextAnnotations
This commit is contained in:
@ -101,7 +101,7 @@ pub struct Content {
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct ContentText {
|
||||
pub value: String,
|
||||
pub annotations: Vec<String>,
|
||||
pub annotations: Vec<ContentTextAnnotations>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
@ -132,3 +132,38 @@ pub struct ListMessageFile {
|
||||
pub has_more: bool,
|
||||
pub headers: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ContentTextAnnotations {
|
||||
FileCitation(ContentTextAnnotationsFileCitationObject),
|
||||
FilePath(ContentTextAnnotationsFilePathObject),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct ContentTextAnnotationsFileCitationObject {
|
||||
pub text: String,
|
||||
pub file_citation: FileCitation,
|
||||
pub start_index: u32,
|
||||
pub end_index: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FileCitation {
|
||||
pub file_id: String,
|
||||
pub quote: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct ContentTextAnnotationsFilePathObject {
|
||||
pub text: String,
|
||||
pub file_path: FilePath,
|
||||
pub start_index: u32,
|
||||
pub end_index: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FilePath {
|
||||
pub file_id: String,
|
||||
}
|
||||
|
Reference in New Issue
Block a user