main: clean up imports
This commit is contained in:
+23
-7
@@ -1,11 +1,9 @@
|
||||
use async_openai::types::chat::ChatCompletionRequestMessage;
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use futures_timer::Delay;
|
||||
use scraper::{Html, Selector};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use ratatui::{Frame, layout::{Constraint, Direction, Layout}, widgets::{Block, BorderType, Clear, Gauge, List, ListDirection, ListItem, ListState, Paragraph, Wrap}};
|
||||
use sqlite::OpenFlags;
|
||||
use throbber_widgets_tui::{Throbber, ThrobberState};
|
||||
use crossterm::{event::{self, EventStream, KeyCode, KeyModifiers}};
|
||||
use tokio::{sync::{mpsc, watch}, time::Instant};
|
||||
@@ -13,9 +11,9 @@ use tui_input::{Input, backend::crossterm::EventHandler};
|
||||
use futures::{StreamExt, future::FutureExt};
|
||||
|
||||
use ratatui::prelude::*;
|
||||
use tui_skeleton::{AnimationMode, SkeletonList, SkeletonText};
|
||||
use tui_skeleton::{AnimationMode, SkeletonText};
|
||||
|
||||
use crate::{events::AudioRecordRequest, prediction::{BandcampResult, PossibleResponse}, scene::{ConversationEntry, PlaylistEntry, Scene, StageActions, StageDirection}, tts::start_tts};
|
||||
use crate::{events::AudioRecordRequest, prediction::{BandcampResult, PossibleResponse}, scene::{ConversationEntry, Scene, StageActions, StageDirection}, tts::start_tts};
|
||||
|
||||
mod scene;
|
||||
mod events;
|
||||
@@ -55,8 +53,8 @@ impl<'a> Into<ListItem<'a>> for PossibleResponse {
|
||||
fn into(self) -> ListItem<'a> {
|
||||
if let Some(direction) = self.stage_direction {
|
||||
Line::from_iter([
|
||||
Span::from(format!("({})", direction)).style(ratatui::style::Color::Yellow),
|
||||
Span::from(" "),
|
||||
//Span::from(format!("({})", direction)).style(ratatui::style::Color::Yellow),
|
||||
//Span::from(" "),
|
||||
Span::from(self.text)
|
||||
]).into()
|
||||
} else {
|
||||
@@ -93,6 +91,24 @@ enum FocusState {
|
||||
UserInput
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum BandcampError {
|
||||
Json(serde_json::Error),
|
||||
Api(bandcamp::Error)
|
||||
}
|
||||
|
||||
impl From<serde_json::Error> for BandcampError {
|
||||
fn from(value: serde_json::Error) -> Self {
|
||||
BandcampError::Json(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<bandcamp::Error> for BandcampError {
|
||||
fn from(value: bandcamp::Error) -> Self {
|
||||
BandcampError::Api(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl App {
|
||||
fn new(prediction_request_sink: watch::Sender<StageActions>, audio_control_sink: watch::Sender<AudioRecordRequest>, tts_request_sink: mpsc::Sender<String>, sys_message_sink: mpsc::Sender<String>, initial_direction: StageDirection) -> Self {
|
||||
Self {
|
||||
@@ -318,7 +334,7 @@ impl App {
|
||||
|
||||
let status_layout = Layout::default()
|
||||
.direction(Direction::Horizontal)
|
||||
.constraints([Constraint::Max(3), Constraint::Fill(2), Constraint::Fill(1)])
|
||||
.constraints([Constraint::Max(3), Constraint::Fill(2), Constraint::Max(13), Constraint::Min(50)])
|
||||
.split(layout[3]);
|
||||
|
||||
self.draw_user_input(frame, layout[2]);
|
||||
|
||||
Reference in New Issue
Block a user