Skip to content

Commit 8553880

Browse files
refactor(chat): change conversation id to be a uuid v4 (#147)
1 parent 84e22bb commit 8553880

File tree

1 file changed

+1
-5
lines changed
  • crates/chat-cli/src/cli/chat

1 file changed

+1
-5
lines changed

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ use parser::{
9090
RecvErrorKind,
9191
ResponseParser,
9292
};
93-
use rand::distr::{
94-
Alphanumeric,
95-
SampleString,
96-
};
9793
use regex::Regex;
9894
use serde_json::Map;
9995
use spinners::{
@@ -259,7 +255,7 @@ impl ChatArgs {
259255
}
260256
}
261257

262-
let conversation_id = Alphanumeric.sample_string(&mut rand::rng(), 9);
258+
let conversation_id = uuid::Uuid::new_v4().to_string();
263259
info!(?conversation_id, "Generated new conversation id");
264260
let (prompt_request_sender, prompt_request_receiver) = std::sync::mpsc::channel::<Option<String>>();
265261
let (prompt_response_sender, prompt_response_receiver) = std::sync::mpsc::channel::<Vec<String>>();

0 commit comments

Comments
 (0)