mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-10 18:11:41 +02:00
Reference PR in comments
This commit is contained in:
parent
b007ed6be9
commit
5810fb239f
@ -18,7 +18,7 @@ impl NewPromptError {
|
|||||||
Self { kind: NewPromptErrorKind::CannotParseTemplate(inner), fault: FaultSource::User }
|
Self { kind: NewPromptErrorKind::CannotParseTemplate(inner), fault: FaultSource::User }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)] // See <https://github.com/meilisearch/meilisearch/pull/5593> for explanation
|
||||||
pub(crate) fn invalid_fields_in_template(inner: liquid::Error) -> NewPromptError {
|
pub(crate) fn invalid_fields_in_template(inner: liquid::Error) -> NewPromptError {
|
||||||
Self { kind: NewPromptErrorKind::InvalidFieldsInTemplate(inner), fault: FaultSource::User }
|
Self { kind: NewPromptErrorKind::InvalidFieldsInTemplate(inner), fault: FaultSource::User }
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ impl NewPromptError {
|
|||||||
pub enum NewPromptErrorKind {
|
pub enum NewPromptErrorKind {
|
||||||
#[error("cannot parse template: {0}")]
|
#[error("cannot parse template: {0}")]
|
||||||
CannotParseTemplate(liquid::Error),
|
CannotParseTemplate(liquid::Error),
|
||||||
#[allow(unused)]
|
#[allow(unused)] // See <https://github.com/meilisearch/meilisearch/pull/5593> for explanation
|
||||||
#[error("template contains invalid fields: {0}. Only `doc.*`, `fields[i].name`, `fields[i].value` are supported")]
|
#[error("template contains invalid fields: {0}. Only `doc.*`, `fields[i].name`, `fields[i].value` are supported")]
|
||||||
InvalidFieldsInTemplate(liquid::Error),
|
InvalidFieldsInTemplate(liquid::Error),
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore] // See <https://github.com/meilisearch/meilisearch/pull/5593> for explanation
|
||||||
fn template_missing_doc() {
|
fn template_missing_doc() {
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
Prompt::new("{{title}}: {{overview}}".into(), None),
|
Prompt::new("{{title}}: {{overview}}".into(), None),
|
||||||
@ -231,7 +231,7 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore] // See <https://github.com/meilisearch/meilisearch/pull/5593> for explanation
|
||||||
fn template_fields_invalid() {
|
fn template_fields_invalid() {
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
// intentionally garbled field
|
// intentionally garbled field
|
||||||
|
Loading…
x
Reference in New Issue
Block a user