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
6 changes: 3 additions & 3 deletions .github/workflows/tauri-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ jobs:
# demo5,demo6 each depend on an external file, and the interpreter does not currently capture this in the trace
# demo8 currently requires building a model which the interpreter does not directly support
# demo9 takes forever, so... for now skip it
for i in ./src/demos/*.json
do if [[ $(basename $i) != "demo4.json" ]] && [[ $(basename $i) != "demo5.json" ]] && [[ $(basename $i) != "demo6.json" ]] && [[ $(basename $i) != "demo8.json" ]] && [[ $(basename $i) != "demo9.json" ]]; then pdl run $i; fi
done
#for i in ./src/demos/*.json
#do if [[ $(basename $i) != "demo4.json" ]] && [[ $(basename $i) != "demo5.json" ]] && [[ $(basename $i) != "demo6.json" ]] && [[ $(basename $i) != "demo8.json" ]] && [[ $(basename $i) != "demo9.json" ]]; then pdl run $i; fi
#done

- name: Tear down xvfb
run: killall Xvfb || true
20 changes: 7 additions & 13 deletions pdl-live-react/src-tauri/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use urlencoding::encode;

use crate::compile;
use crate::gui::new_window;
use crate::pdl::interpreter::run_file_sync as runr;
use crate::pdl::run::run_pdl_program;
use crate::pdl::interpreter::run_file_sync as run;

#[cfg(desktop)]
pub fn setup(app: &mut tauri::App) -> Result<bool, Box<dyn ::std::error::Error>> {
Expand Down Expand Up @@ -50,11 +49,16 @@ pub fn setup(app: &mut tauri::App) -> Result<bool, Box<dyn ::std::error::Error>>
_ => Err(Box::from("Unsupported compile command")),
}
}
"runr" => runr(
"run" => run(
subcommand_args
.get("source")
.and_then(|a| a.value.as_str())
.expect("valid positional source arg"),
subcommand_args.get("trace").and_then(|a| a.value.as_str()),
subcommand_args.get("data").and_then(|a| a.value.as_str()),
subcommand_args
.get("data-file")
.and_then(|a| a.value.as_str()),
subcommand_args
.get("debug")
.and_then(|a| a.value.as_bool())
Expand All @@ -67,16 +71,6 @@ pub fn setup(app: &mut tauri::App) -> Result<bool, Box<dyn ::std::error::Error>>
== Some(false),
)
.and_then(|_trace| Ok(true)),
"run" => run_pdl_program(
subcommand_args
.get("source")
.and_then(|a| a.value.as_str())
.expect("valid positional source arg"),
subcommand_args.get("trace").and_then(|a| a.value.as_str()),
subcommand_args.get("data").and_then(|a| a.value.as_str()),
subcommand_args.get("stream").and_then(|a| a.value.as_str()),
)
.and_then(|()| Ok(true)),
"view" => new_window(
app.handle().clone(),
subcommand_args.get("trace").and_then(|a| {
Expand Down
9 changes: 8 additions & 1 deletion pdl-live-react/src-tauri/src/pdl/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,14 @@ pub async fn run_file(source_file_path: &str, debug: bool, stream: bool) -> Inte
run(&program, cwd, debug, stream).await
}

pub fn run_file_sync(source_file_path: &str, debug: bool, stream: bool) -> InterpretationSync {
pub fn run_file_sync(
source_file_path: &str,
_trace: Option<&str>,
_data: Option<&str>,
_data_file: Option<&str>,
debug: bool,
stream: bool,
) -> InterpretationSync {
tauri::async_runtime::block_on(run_file(source_file_path, debug, stream))
.map_err(|err| Box::<dyn Error>::from(err.to_string()))
}
Expand Down
1 change: 0 additions & 1 deletion pdl-live-react/src-tauri/src/pdl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ mod interpreter_tests;
pub mod pip;
pub mod pull;
pub mod requirements;
pub mod run;
5 changes: 2 additions & 3 deletions pdl-live-react/src-tauri/src/pdl/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ use rayon::prelude::*;

use crate::pdl::ast::PdlBlock;
use crate::pdl::extract;
use crate::pdl::interpreter::parse_file;

pub async fn pull_if_needed_from_path(
/* pub async fn pull_if_needed_from_path(
source_file_path: &str,
) -> Result<(), Box<dyn ::std::error::Error + Send + Sync>> {
let program = parse_file(&::std::path::PathBuf::from(source_file_path))?;
pull_if_needed(&program)
.await
.map_err(|e| Box::from(e.to_string()))
}
} */

/// Pull models (in parallel) from the PDL program in the given filepath.
pub async fn pull_if_needed(program: &PdlBlock) -> Result<(), Error> {
Expand Down
3 changes: 0 additions & 3 deletions pdl-live-react/src-tauri/src/pdl/requirements.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
//pub const PDL_INTERPRETER: &str = "-e ../";
pub const PDL_INTERPRETER: &str = "prompt-declaration-language==0.6.0";

pub const BEEAI_FRAMEWORK: &str = "-e git+https://github.com/starpit/bee-agent-framework.git@nick-meta-combo#egg=beeai_framework&subdirectory=python";
//pub const BEEAI_FRAMEWORK: &str = "beeai_framework==0.1";
52 changes: 0 additions & 52 deletions pdl-live-react/src-tauri/src/pdl/run.rs

This file was deleted.

24 changes: 7 additions & 17 deletions pdl-live-react/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
}
}
},
"runr": {
"run": {
"description": "Run a PDL program",
"args": [
{
"name": "source",
Expand All @@ -59,31 +60,20 @@
"name": "no-stream"
},
{
"name": "debug",
"short": "g"
}
]
},
"run": {
"description": "Run a PDL program",
"args": [
{
"name": "source",
"index": 1,
"required": true,
"name": "data",
"takesValue": true
},
{
"name": "stream",
"name": "data-file",
"takesValue": true
},
{
"name": "data",
"name": "trace",
"takesValue": true
},
{
"name": "trace",
"takesValue": true
"name": "debug",
"short": "g"
}
]
},
Expand Down