mirror of
https://github.com/sigoden/aichat
synced 2024-11-16 06:15:26 +00:00
refactor: adjust indicator text and render strategy
This commit is contained in:
parent
38e594505b
commit
16e9c647d4
@ -117,14 +117,15 @@ fn start_directive(
|
||||
let mut client = init_client(config)?;
|
||||
ensure_model_capabilities(client.as_mut(), input.required_capabilities())?;
|
||||
config.read().maybe_print_send_tokens(&input);
|
||||
let output = if !stdout().is_terminal() || no_stream {
|
||||
let is_terminal_stdout = stdout().is_terminal();
|
||||
let output = if !is_terminal_stdout || no_stream {
|
||||
let output = client.send_message(input.clone())?;
|
||||
let output = if code_mode && output.trim_start().starts_with("```") {
|
||||
extract_block(&output)
|
||||
} else {
|
||||
output.clone()
|
||||
};
|
||||
if no_stream {
|
||||
if is_terminal_stdout {
|
||||
let render_options = config.read().get_render_options()?;
|
||||
let mut markdown_render = MarkdownRender::init(render_options)?;
|
||||
println!("{}", markdown_render.render(&output).trim());
|
||||
|
@ -65,7 +65,7 @@ fn markdown_stream_inner(
|
||||
|
||||
let columns = terminal::size()?.0;
|
||||
|
||||
let mut spinner = Spinner::new(" Generating");
|
||||
let mut spinner = Spinner::new(" Thinking");
|
||||
|
||||
'outer: loop {
|
||||
if abort.aborted() {
|
||||
|
Loading…
Reference in New Issue
Block a user