dave: cleanly separate ui from logic

This is a good demo of how easy it is to build a notedeck app,
so let's detangle the ui from logic to showcase this

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-04-21 11:51:30 -07:00
parent 5811a5f4e6
commit 04a11fd45d
4 changed files with 277 additions and 208 deletions

View File

@@ -4,16 +4,16 @@ use nostrdb::{Ndb, Transaction};
#[derive(Debug, Clone)]
pub enum Message {
System(String),
User(String),
Assistant(String),
System(String),
ToolCalls(Vec<ToolCall>),
ToolResponse(ToolResponse),
}
/// The ai backends response. Since we are using streaming APIs these are
/// represented as individual tokens or tool calls
pub enum DaveResponse {
pub enum DaveApiResponse {
ToolCalls(Vec<ToolCall>),
Token(String),
}