summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-05-30 01:02:11 +0000
committersigoden <sigoden@gmail.com>2024-05-30 01:02:11 +0000
commitc0f4d2d71251b883519e45d9bf2e0cafa52e552d (patch)
treeb1d18b1b3fe9b81523ffb856634968e4cf5e38d3 /src
parent00f3cb182fbf70e99c4ccd21afe8f79359ef3d6d (diff)
downloadaichat-c0f4d2d71251b883519e45d9bf2e0cafa52e552d.tar.gz
chore: fix typos
Diffstat (limited to 'src')
-rw-r--r--src/client/common.rs4
-rw-r--r--src/function.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/client/common.rs b/src/client/common.rs
index 5d16a9b..044ed2e 100644
--- a/src/client/common.rs
+++ b/src/client/common.rs
@@ -333,7 +333,7 @@ pub trait Client: Sync + Send {
fn patch_request_body(&self, body: &mut Value) {
let model_name = self.model().name();
- if let Some(patch_data) = slect_model_patch(self.patches_config(), model_name) {
+ if let Some(patch_data) = select_model_patch(self.patches_config(), model_name) {
if body.is_object() && patch_data.request_body.is_object() {
json_patch::merge(body, &patch_data.request_body)
}
@@ -374,7 +374,7 @@ pub struct ModelPatch {
pub request_body: Value,
}
-pub fn slect_model_patch<'a>(
+pub fn select_model_patch<'a>(
patch: Option<&'a ModelPatches>,
name: &str,
) -> Option<&'a ModelPatch> {
diff --git a/src/function.rs b/src/function.rs
index a644185..a42b943 100644
--- a/src/function.rs
+++ b/src/function.rs
@@ -234,7 +234,7 @@ impl ToolCall {
let output = if self.is_execute() {
if stdout().is_terminal() {
println!("{prompt}");
- let anwser = Text::new("[1] Run, [2] Run & Retrieve, [3] Skip:")
+ let answer = Text::new("[1] Run, [2] Run & Retrieve, [3] Skip:")
.with_default("1")
.with_validator(|input: &str| match matches!(input, "1" | "2" | "3") {
true => Ok(Validation::Valid),
@@ -243,7 +243,7 @@ impl ToolCall {
)),
})
.prompt()?;
- match anwser.as_str() {
+ match answer.as_str() {
"1" => {
let exit_code = run_command(&name, &[arguments], Some(envs))?;
if exit_code != 0 {