mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-28 01:02:56 +00:00
Formatting
This commit is contained in:
parent
6c7adf5e59
commit
81e68b58a0
@ -26,7 +26,6 @@ public partial class ReadFileContent : MSGComponentBase
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var ext = Path.GetExtension(selectedFile.SelectedFilePath).TrimStart('.');
|
var ext = Path.GetExtension(selectedFile.SelectedFilePath).TrimStart('.');
|
||||||
|
|
||||||
if (Array.Exists(FileTypeFilter.Executables.FilterExtensions, x => x.Equals(ext, StringComparison.OrdinalIgnoreCase)))
|
if (Array.Exists(FileTypeFilter.Executables.FilterExtensions, x => x.Equals(ext, StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.AppBlocking, T("Executables are not allowed")));
|
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.AppBlocking, T("Executables are not allowed")));
|
||||||
|
@ -28,11 +28,22 @@ pub struct Chunk {
|
|||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
pub enum Metadata {
|
pub enum Metadata {
|
||||||
Text { line_number: usize },
|
Text {
|
||||||
Pdf { page_number: usize },
|
line_number: usize
|
||||||
Spreadsheet { sheet_name: String, row_number: usize },
|
},
|
||||||
|
|
||||||
|
Pdf {
|
||||||
|
page_number: usize
|
||||||
|
},
|
||||||
|
|
||||||
|
Spreadsheet {
|
||||||
|
sheet_name: String,
|
||||||
|
row_number: usize,
|
||||||
|
},
|
||||||
|
|
||||||
Document {},
|
Document {},
|
||||||
Image {},
|
Image {},
|
||||||
|
|
||||||
Presentation {
|
Presentation {
|
||||||
slide_number: u32,
|
slide_number: u32,
|
||||||
image: Option<Base64Image>,
|
image: Option<Base64Image>,
|
||||||
@ -72,7 +83,7 @@ pub async fn extract_data(_token: APIToken, path: String, mut end: Shutdown) ->
|
|||||||
chunk = stream.next() => match chunk {
|
chunk = stream.next() => match chunk {
|
||||||
Some(Ok(chunk)) => chunk,
|
Some(Ok(chunk)) => chunk,
|
||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
yield Event::json(&format!("Error: {}", e));
|
yield Event::json(&format!("Error: {e}"));
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
None => break,
|
None => break,
|
||||||
@ -85,7 +96,7 @@ pub async fn extract_data(_token: APIToken, path: String, mut end: Shutdown) ->
|
|||||||
},
|
},
|
||||||
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
yield Event::json(&format!("Error starting stream: {}", e));
|
yield Event::json(&format!("Error starting stream: {e}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user