Skip to content

Commit

Permalink
broken attempt to move requests into transactions type
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmikwolf committed Oct 23, 2023
1 parent 4df9792 commit a24c769
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 437 deletions.
4 changes: 2 additions & 2 deletions src/action.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::app::types::{ChatTransaction, Model};
use crate::app::types::{ChatResponse, Model, Transaction};
use serde::{
de::{self, Deserializer, Visitor},
Deserialize, Serialize,
Expand All @@ -18,7 +18,7 @@ pub enum Action {
Help,
SubmitInput(String),
SelectModel(Model),
ProcessResponse(Box<ChatTransaction>),
ProcessResponse(Box<ChatResponse>),
EnterNormal,
EnterInsert,
EnterProcessing,
Expand Down
11 changes: 11 additions & 0 deletions src/app/errors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
use async_openai::error::OpenAIError;
use std::fmt;

#[derive(Debug)]
pub enum SazidError {
OpenAiError(OpenAIError),
}
impl fmt::Display for SazidError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
SazidError::OpenAiError(err) => write!(f, "OpenAIError: {}", err),
}
}
}
#[derive(Debug)]
pub enum ChunkifierError {
IO(std::io::Error),
Expand Down
Loading

0 comments on commit a24c769

Please sign in to comment.