dave: return tool errors back to the ai

So that it can correct itself
This commit is contained in:
William Casarin
2025-04-22 16:04:54 -07:00
parent 9692b6b9fe
commit 56f5151739
4 changed files with 90 additions and 9 deletions

View File

@@ -19,6 +19,10 @@ pub enum DaveApiResponse {
}
impl Message {
pub fn tool_error(id: String, msg: String) -> Self {
Self::ToolResponse(ToolResponse::error(id, msg))
}
pub fn to_api_msg(&self, txn: &Transaction, ndb: &Ndb) -> ChatCompletionRequestMessage {
match self {
Message::User(msg) => {