chore: disable pdf option (#719)
* chore: disable pdf option * chore: reanme
This commit is contained in:
parent
0b3949152b
commit
d27a0cf204
|
|
@ -298,8 +298,17 @@ impl QuestionStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum QuestionStreamValue {
|
pub enum QuestionStreamValue {
|
||||||
Answer { value: String },
|
Answer {
|
||||||
Metadata { value: serde_json::Value },
|
value: String,
|
||||||
|
},
|
||||||
|
/// Metadata is a JSON array object. its structure as below:
|
||||||
|
/// ```json
|
||||||
|
/// [
|
||||||
|
/// {"id": "xx", "source": "", "name": "" }
|
||||||
|
/// ]
|
||||||
|
Metadata {
|
||||||
|
value: serde_json::Value,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
impl Stream for QuestionStream {
|
impl Stream for QuestionStream {
|
||||||
type Item = Result<QuestionStreamValue, AppResponseError>;
|
type Item = Result<QuestionStreamValue, AppResponseError>;
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,8 @@ impl ChatMetadataData {
|
||||||
match self.content_type {
|
match self.content_type {
|
||||||
ChatMetadataContentType::Text => self.content.len() == self.size as usize,
|
ChatMetadataContentType::Text => self.content.len() == self.size as usize,
|
||||||
ChatMetadataContentType::Markdown => self.content.len() == self.size as usize,
|
ChatMetadataContentType::Markdown => self.content.len() == self.size as usize,
|
||||||
_ => true,
|
ChatMetadataContentType::Unknown => false,
|
||||||
|
ChatMetadataContentType::PDF => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -692,8 +693,7 @@ pub enum ChatMetadataContentType {
|
||||||
Unknown,
|
Unknown,
|
||||||
Text,
|
Text,
|
||||||
Markdown,
|
Markdown,
|
||||||
Pdf,
|
PDF,
|
||||||
Custom(String),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for ChatMetadataContentType {
|
impl Display for ChatMetadataContentType {
|
||||||
|
|
@ -702,8 +702,7 @@ impl Display for ChatMetadataContentType {
|
||||||
ChatMetadataContentType::Unknown => write!(f, "unknown"),
|
ChatMetadataContentType::Unknown => write!(f, "unknown"),
|
||||||
ChatMetadataContentType::Text => write!(f, "txt"),
|
ChatMetadataContentType::Text => write!(f, "txt"),
|
||||||
ChatMetadataContentType::Markdown => write!(f, "markdown"),
|
ChatMetadataContentType::Markdown => write!(f, "markdown"),
|
||||||
ChatMetadataContentType::Pdf => write!(f, "pdf"),
|
ChatMetadataContentType::PDF => write!(f, "pdf"),
|
||||||
ChatMetadataContentType::Custom(custom) => write!(f, "{}", custom),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue