feat: first cut at actual token generation and model loading
This commit is contained in:
@@ -224,18 +224,51 @@ impl App {
|
||||
.align_y(Alignment::Center);
|
||||
|
||||
let body: Element<'_, Message> = if let Some(session) = self.selected_session(item) {
|
||||
let mut messages = column![].spacing(12);
|
||||
if self.conversation.is_empty() {
|
||||
messages = messages.push(
|
||||
column![
|
||||
text(&session.title).size(26),
|
||||
text("Run DeepSeek locally with the Rust Metal engine.").size(14),
|
||||
]
|
||||
.spacing(8),
|
||||
);
|
||||
} else {
|
||||
for message in &self.conversation {
|
||||
let label = if message.user { "You" } else { "DS4" };
|
||||
let content = if !message.user && message.content.is_empty() && self.generating
|
||||
{
|
||||
"Loading model…"
|
||||
} else {
|
||||
&message.content
|
||||
};
|
||||
messages = messages.push(
|
||||
container(column![text(label).size(11), text(content).size(14)].spacing(5))
|
||||
.padding(14)
|
||||
.width(Length::Fill)
|
||||
.style(overview_style),
|
||||
);
|
||||
}
|
||||
}
|
||||
let composer = text_input("Ask DS4Server anything…", &self.composer)
|
||||
.on_input(Message::ComposerChanged)
|
||||
.on_submit(Message::SubmitPrompt)
|
||||
.padding(12)
|
||||
.size(14);
|
||||
let action = if self.generating {
|
||||
action_button(text("Stop").size(12)).on_press(Message::StopGeneration)
|
||||
} else if self.composer.trim().is_empty() {
|
||||
action_button(icon(ICON_SEND, 18)).padding(8)
|
||||
} else {
|
||||
action_button(icon(ICON_SEND, 18))
|
||||
.padding(8)
|
||||
.on_press(Message::SubmitPrompt)
|
||||
};
|
||||
let conversation = column![
|
||||
Space::with_height(Length::Fill),
|
||||
column![
|
||||
text(&session.title).size(26),
|
||||
text("This session is ready for the agent runtime.").size(14),
|
||||
]
|
||||
.spacing(8),
|
||||
Space::with_height(Length::Fill),
|
||||
scrollable(messages).height(Length::Fill),
|
||||
container(
|
||||
column![
|
||||
text("Ask DS4Server anything…"),
|
||||
Space::with_height(28),
|
||||
composer,
|
||||
row![
|
||||
icon(ICON_PAPERCLIP, 19),
|
||||
Space::with_width(Length::Fill),
|
||||
@@ -246,7 +279,7 @@ impl App {
|
||||
.to_string(),
|
||||
)
|
||||
.size(12),
|
||||
action_button(icon(ICON_SEND, 18)).padding(8),
|
||||
action,
|
||||
]
|
||||
.align_y(Alignment::Center),
|
||||
]
|
||||
@@ -658,7 +691,8 @@ impl App {
|
||||
let panel = container(
|
||||
column![
|
||||
header,
|
||||
scrollable(container(fields).padding(iced::Padding::ZERO.right(18))),
|
||||
scrollable(container(fields).padding(iced::Padding::ZERO.right(18)))
|
||||
.height(Length::Fill),
|
||||
footer
|
||||
]
|
||||
.spacing(16),
|
||||
|
||||
Reference in New Issue
Block a user