Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [devtools(), tailwindcss(), solidPlugin()],
server: {
port: 3000,
port: 9010,
},
build: {
target: 'esnext',
Expand Down
25 changes: 25 additions & 0 deletions nocodo-agents/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod config;
pub mod database;
pub mod factory;
pub mod imap_email;
pub mod pdftotext;
pub mod requirements_gathering;
pub mod settings_management;
pub mod sqlite_reader;
Expand All @@ -28,6 +29,7 @@ pub enum AgentTool {
AskUser,
Sqlite3Reader,
ImapReader,
PdfToText,
}

impl AgentTool {
Expand All @@ -43,6 +45,7 @@ impl AgentTool {
AgentTool::AskUser => "ask_user",
AgentTool::Sqlite3Reader => "sqlite3_reader",
AgentTool::ImapReader => "imap_reader",
AgentTool::PdfToText => "pdftotext",
}
}

Expand Down Expand Up @@ -111,6 +114,11 @@ impl AgentTool {
serde_json::from_value(arguments)?;
ToolRequest::ImapReader(req)
}
"pdftotext" => {
let req: nocodo_tools::types::PdfToTextRequest =
serde_json::from_value(arguments)?;
ToolRequest::PdfToText(req)
}
_ => anyhow::bail!("Unknown tool: {}", name),
};

Expand Down Expand Up @@ -151,6 +159,23 @@ pub fn format_tool_response(response: &nocodo_tools::types::ToolResponse) -> Str
)
}
}
ToolResponse::PdfToText(r) => {
if r.success {
if let Some(content) = &r.content {
format!("PDF text extraction successful:\n{}", content)
} else if let Some(output_path) = &r.output_path {
format!(
"PDF text extraction successful: {} bytes written to {}",
r.bytes_written.unwrap_or(0),
output_path
)
} else {
r.message.clone()
}
} else {
format!("PDF text extraction failed: {}", r.message)
}
}
ToolResponse::Error(e) => format!("Error: {}", e.message),
}
}
Expand Down
Loading