Skip to content

Commit da31229

Browse files
committed
Cargo fmt
1 parent ca6d655 commit da31229

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

aiscript-directive/src/validator/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ impl FromDirective for Box<dyn Validator> {
266266
"any" => Ok(Box::new(AnyValidator::from_directive(directive)?)),
267267
"not" => Ok(Box::new(NotValidator::from_directive(directive)?)),
268268
"date" => Ok(Box::new(DateValidator::from_directive(directive)?)),
269-
"array" => Ok(Box::new(AnyValidator::from_directive(directive)?)), // Add this line
270-
"regex" => Ok(Box::new(RegexValidator::from_directive(directive)?)), // Add support for regex directive
269+
"array" => Ok(Box::new(AnyValidator::from_directive(directive)?)),
270+
"regex" => Ok(Box::new(RegexValidator::from_directive(directive)?)),
271271
v => Err(format!("Invalid validators: @{}", v)),
272272
}
273273
}

aiscript-runtime/src/parser.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,13 +954,16 @@ mod tests {
954954

955955
let route = result.unwrap();
956956
assert_eq!(route.prefix, "/api");
957-
957+
958958
let endpoint1 = &route.endpoints[0];
959959
assert_eq!(endpoint1.path_specs[0].method, HttpMethod::Get);
960960
assert_eq!(endpoint1.path_specs[0].path, "/get-messages");
961-
961+
962962
let endpoint2 = &route.endpoints[1];
963963
assert_eq!(endpoint2.path_specs[0].method, HttpMethod::Post);
964-
assert_eq!(endpoint2.path_specs[0].path, "/user-profile/update-settings");
964+
assert_eq!(
965+
endpoint2.path_specs[0].path,
966+
"/user-profile/update-settings"
967+
);
965968
}
966969
}

aiscript-vm/src/ai/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub use agent::{Agent, run_agent};
77
use openai_api_rs::v1::api::OpenAIClient;
88
pub use prompt::{PromptConfig, prompt_with_config};
99

10+
#[allow(unused)]
1011
pub(crate) fn openai_client() -> OpenAIClient {
1112
OpenAIClient::builder()
1213
.with_api_key(env::var("OPENAI_API_KEY").unwrap().to_string())

examples/routes/regex.ai

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ post /api/register {
1414
return { "success": true };
1515
}
1616

17-
get /api/validate_phone {
17+
get /api/validate-phone {
1818
query {
19-
"""Phone number validation ((XXX)-XXX-XXXX format)"""
19+
"""Phone number validation (XXX-XXX-XXXX format)"""
2020
@regex(pattern="^\d{3}-\d{3}-\d{4}$")
2121
phone: str
2222
}

0 commit comments

Comments
 (0)