Complete long-context chat support
This commit is contained in:
@@ -298,13 +298,27 @@ impl App {
|
||||
.padding(8)
|
||||
.on_press(Message::SubmitPrompt)
|
||||
};
|
||||
let context_fraction = if self.context_limit == 0 {
|
||||
0.0
|
||||
} else {
|
||||
self.context_used.min(self.context_limit) as f32 / self.context_limit as f32
|
||||
};
|
||||
let conversation = column![
|
||||
scrollable(messages).height(Length::Fill),
|
||||
container(
|
||||
column![
|
||||
composer,
|
||||
progress_bar(0.0..=1.0, context_fraction).height(3),
|
||||
row![
|
||||
icon(ICON_PAPERCLIP, 19),
|
||||
text(format!(
|
||||
"{} / {} tokens ({:.0}%)",
|
||||
self.context_used,
|
||||
self.context_limit,
|
||||
context_fraction * 100.0
|
||||
))
|
||||
.size(11)
|
||||
.color(muted_text()),
|
||||
Space::with_width(Length::Fill),
|
||||
icon(ICON_MODEL, 16),
|
||||
text(
|
||||
|
||||
Reference in New Issue
Block a user