Skip to content

Commit 3b2196a

Browse files
committed
style: DRY principle for test import
1 parent ad3adbf commit 3b2196a

File tree

1 file changed

+1
-4
lines changed
  • lib/llm/src/preprocessor/prompt/template

1 file changed

+1
-4
lines changed

lib/llm/src/preprocessor/prompt/template/oai.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ impl OAIPromptFormatter for HfTokenizerConfigJsonFormatter {
330330
#[cfg(test)]
331331
mod tests {
332332
use super::*;
333+
use minijinja::{context, Environment};
333334

334335
#[test]
335336
fn test_may_be_fix_tool_schema_missing_type_and_properties() {
@@ -739,8 +740,6 @@ NORMAL MODE
739740

740741
#[test]
741742
fn test_normalize_tool_arguments_tojson() {
742-
use minijinja::{Environment, context};
743-
744743
let tmpl = r#"{{ messages[0].tool_calls[0].function.arguments | tojson }}"#;
745744

746745
// Message with tool_calls containing JSON string arguments
@@ -775,8 +774,6 @@ NORMAL MODE
775774

776775
#[test]
777776
fn test_normalize_tool_arguments_items_loop() {
778-
use minijinja::{Environment, context};
779-
780777
let tmpl = r#"{% for k, v in messages[0].tool_calls[0].function.arguments|items %}{{k}}={{v}};{% endfor %}"#;
781778

782779
let mut messages = serde_json::Value::Array(vec![serde_json::json!({

0 commit comments

Comments
 (0)