@1kbirds/chidori 0.1.23 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/Cargo.toml +13 -8
- package/README.md +3 -0
- package/package.json +2 -2
- package/pyproject.toml +4 -2
- package/src/translations/python.rs +5 -4
- package/src/translations/rust.rs +5 -5
- package/{package_python → tests/python}/test_chidori.py +1 -7
- package/package_python/.idea/inspectionProfiles/profiles_settings.xml +0 -6
- package/package_python/.idea/misc.xml +0 -4
- package/package_python/.idea/modules.xml +0 -8
- package/package_python/.idea/package_python.iml +0 -8
- package/package_python/.idea/vcs.xml +0 -6
- package/package_python/__init__.py +0 -0
- package/package_python/chidori.pyi +0 -32
- package/package_python/py.typed +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## 0.1.24 (2023-07-28)
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fixing releases
|
|
13
|
+
|
|
14
|
+
## 0.1.23 (2023-07-28)
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Fixing releases
|
|
19
|
+
|
|
20
|
+
## 0.1.22 (2023-07-28)
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Moved to SQL queries as triggers to nodes rather than graphql
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
|
package/Cargo.toml
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "chidori"
|
|
3
|
-
version
|
|
3
|
+
version= "0.1.24"
|
|
4
4
|
edition = "2021"
|
|
5
|
+
description = "A Rust library for executing prompt-graph models"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
homepage = "https://docs.thousandbirds.ai"
|
|
8
|
+
repository = "https://github.com/ThousandBirdsInc/chidori"
|
|
9
|
+
|
|
5
10
|
|
|
6
11
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
7
12
|
[lib]
|
|
8
|
-
name = "
|
|
13
|
+
name = "_chidori"
|
|
9
14
|
crate-type = ["cdylib", "lib"]
|
|
10
15
|
bench = false
|
|
11
16
|
|
|
@@ -28,10 +33,10 @@ sqlparser = "0.34.0"
|
|
|
28
33
|
# serde-wasm-bindgen should be used instead
|
|
29
34
|
|
|
30
35
|
# Vendor protoc and openssl so we don't need to separately install them
|
|
31
|
-
openssl = { version = "0.10", features = ["vendored"] }
|
|
36
|
+
openssl = { version = "0.10.55", features = ["vendored"] }
|
|
32
37
|
|
|
33
38
|
once_cell = "1"
|
|
34
|
-
prompt-graph-core = { path = "../prompt-graph-core", version = "0.1.
|
|
39
|
+
prompt-graph-core = { path = "../prompt-graph-core", version = "^0.1.24" }
|
|
35
40
|
wasm-bindgen = {version = "0.2.86", features = []}
|
|
36
41
|
handlebars = "4.3.7"
|
|
37
42
|
anyhow = { version = "1.0", default-features = false }
|
|
@@ -72,7 +77,7 @@ wasm-bindgen-test = "0.2"
|
|
|
72
77
|
tonic-build = "0.9.2"
|
|
73
78
|
pyo3-build-config = "0.19.1"
|
|
74
79
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
[profile.release]
|
|
81
|
+
lto = "fat"
|
|
82
|
+
codegen-units = 1
|
|
83
|
+
strip = true
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1kbirds/chidori",
|
|
3
|
-
"version": "v0.1.
|
|
3
|
+
"version": "v0.1.26",
|
|
4
4
|
"description": "Chidori is a library for building and running reactive AI agents.",
|
|
5
5
|
"main": "package_node/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "cargo-cp-artifact -
|
|
7
|
+
"build": "cargo-cp-artifact -a cdylib _chidori ./package_node/native/chidori.node -- cargo build --message-format=json-render-diagnostics --features nodejs",
|
|
8
8
|
"build-debug": "npm run build --",
|
|
9
9
|
"build-release": "npm run build -- --release",
|
|
10
10
|
"test-rust": "cargo test",
|
package/pyproject.toml
CHANGED
|
@@ -3,7 +3,7 @@ name = "chidori"
|
|
|
3
3
|
repository = "https://github.com/thousandbirds/chidori"
|
|
4
4
|
description = "A framework for building LLM based agents"
|
|
5
5
|
authors = [
|
|
6
|
-
{name = "Colton Pierson"}
|
|
6
|
+
{name = "Colton Pierson", email = "colton@thousandbirds.ai"}
|
|
7
7
|
]
|
|
8
8
|
classifiers=[
|
|
9
9
|
"Development Status :: 3 - Alpha",
|
|
@@ -29,5 +29,7 @@ requires = ["maturin>=1.0,<2.0"]
|
|
|
29
29
|
build-backend = "maturin"
|
|
30
30
|
|
|
31
31
|
[tool.maturin]
|
|
32
|
+
python-source = "package_python"
|
|
33
|
+
module-name = "chidori._chidori"
|
|
34
|
+
bindings = "pyo3"
|
|
32
35
|
features = ["python"]
|
|
33
|
-
python-source = "package_python"
|
|
@@ -402,8 +402,8 @@ async fn get_client(url: String) -> Result<ExecutionRuntimeClient<tonic::transpo
|
|
|
402
402
|
// TODO: return a handle to nodes so that we can understand and inspect them
|
|
403
403
|
// TODO: include a __repr__ method on those nodes
|
|
404
404
|
|
|
405
|
-
#[pyclass]
|
|
406
405
|
#[derive(Clone)]
|
|
406
|
+
#[pyclass(name="NodeHandle")]
|
|
407
407
|
struct PyNodeHandle {
|
|
408
408
|
n: NodeHandle,
|
|
409
409
|
}
|
|
@@ -746,7 +746,7 @@ impl PyGraphBuilder {
|
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
// https://github.com/PyO3/pyo3/issues/525
|
|
749
|
-
#[pyo3(signature = (name=String::new(), queries=vec!["None".to_string()], output_tables=vec![], output=String::from("
|
|
749
|
+
#[pyo3(signature = (name=String::new(), queries=vec!["None".to_string()], output_tables=vec![], output=String::from("{}"), node_type_name=String::new()))]
|
|
750
750
|
fn custom_node<'a>(
|
|
751
751
|
mut self_: PyRefMut<'_, Self>,
|
|
752
752
|
py: Python<'a>,
|
|
@@ -797,7 +797,7 @@ impl PyGraphBuilder {
|
|
|
797
797
|
}
|
|
798
798
|
|
|
799
799
|
|
|
800
|
-
#[pyo3(signature = (name=String::new(), queries=vec!["None".to_string()], output_tables=vec![], output=String::from("
|
|
800
|
+
#[pyo3(signature = (name=String::new(), queries=vec!["None".to_string()], output_tables=vec![], output=String::from("{}"), template=String::new(), action="WRITE".to_string(), embedding_model="TEXT_EMBEDDING_ADA_002".to_string(), db_vendor="QDRANT".to_string(), collection_name=String::new()))]
|
|
801
801
|
fn vector_memory_node<'a>(
|
|
802
802
|
mut self_: PyRefMut<'_, Self>,
|
|
803
803
|
py: Python<'a>,
|
|
@@ -910,11 +910,12 @@ impl PyGraphBuilder {
|
|
|
910
910
|
/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
|
|
911
911
|
/// import the module.
|
|
912
912
|
#[pymodule]
|
|
913
|
-
#[pyo3(name = "
|
|
913
|
+
#[pyo3(name = "_chidori")]
|
|
914
914
|
fn chidori(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
|
|
915
915
|
// pyo3_log::init();
|
|
916
916
|
m.add_class::<PyChidori>()?;
|
|
917
917
|
m.add_class::<PyGraphBuilder>()?;
|
|
918
|
+
m.add_class::<PyNodeHandle>()?;
|
|
918
919
|
Ok(())
|
|
919
920
|
}
|
|
920
921
|
|
package/src/translations/rust.rs
CHANGED
|
@@ -538,7 +538,7 @@ impl GraphBuilder {
|
|
|
538
538
|
let node = create_custom_node(
|
|
539
539
|
def.name.clone(),
|
|
540
540
|
remap_queries(def.queries.clone()),
|
|
541
|
-
def.output.unwrap_or("
|
|
541
|
+
def.output.unwrap_or("{}".to_string()),
|
|
542
542
|
def.node_type_name,
|
|
543
543
|
def.output_tables.unwrap_or(vec![])
|
|
544
544
|
);
|
|
@@ -553,7 +553,7 @@ impl GraphBuilder {
|
|
|
553
553
|
let node = create_code_node(
|
|
554
554
|
def.name.clone(),
|
|
555
555
|
remap_queries(def.queries.clone()),
|
|
556
|
-
def.output.unwrap_or("
|
|
556
|
+
def.output.unwrap_or("{}".to_string()),
|
|
557
557
|
SourceNodeType::Code("DENO".to_string(), def.code, def.is_template.unwrap_or(false)),
|
|
558
558
|
def.output_tables.unwrap_or(vec![])
|
|
559
559
|
);
|
|
@@ -568,7 +568,7 @@ impl GraphBuilder {
|
|
|
568
568
|
let node = create_vector_memory_node(
|
|
569
569
|
def.name.clone(),
|
|
570
570
|
remap_queries(def.queries.clone()),
|
|
571
|
-
def.output.unwrap_or("
|
|
571
|
+
def.output.unwrap_or("{}".to_string()),
|
|
572
572
|
def.action.unwrap_or("READ".to_string()),
|
|
573
573
|
def.embedding_model.unwrap_or("TEXT_EMBEDDING_ADA_002".to_string()),
|
|
574
574
|
def.template.unwrap_or("".to_string()),
|
|
@@ -670,7 +670,7 @@ impl NodeHandle {
|
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
fn get_output_type(&self) -> Vec<Vec<String>> {
|
|
673
|
-
self.indiv.
|
|
673
|
+
self.indiv.output_paths.clone()
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
pub fn run_when(&mut self, graph_builder: &mut GraphBuilder, other_node: &NodeHandle) -> anyhow::Result<bool> {
|
|
@@ -694,7 +694,7 @@ impl NodeHandle {
|
|
|
694
694
|
|
|
695
695
|
pub async fn query(&self, file_id: String, url: String, branch: u64, frame: u64) -> anyhow::Result<HashMap<String, SerializedValue>> {
|
|
696
696
|
let name = &self.node.core.as_ref().unwrap().name;
|
|
697
|
-
let query = construct_query_from_output_type(&name, &name, &self.indiv.
|
|
697
|
+
let query = construct_query_from_output_type(&name, &name, &self.indiv.output_paths).unwrap();
|
|
698
698
|
let mut client = get_client(url).await?;
|
|
699
699
|
let result = client.run_query(QueryAtFrame {
|
|
700
700
|
id: file_id,
|
|
@@ -16,13 +16,7 @@ async def test_simple_agent():
|
|
|
16
16
|
)
|
|
17
17
|
pn = await g.deno_code_node(
|
|
18
18
|
name="CodeNode",
|
|
19
|
-
queries=["""
|
|
20
|
-
query Q {
|
|
21
|
-
InspirationalQuote {
|
|
22
|
-
promptResult
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
"""],
|
|
19
|
+
queries=["""SELECT promptResult FROM InspirationalQuote"""],
|
|
26
20
|
code="""
|
|
27
21
|
return {"output": "Here is your quote for "+ new Date() + {{InspirationalQuote.promptResult}} }
|
|
28
22
|
""",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/package_python.iml" filepath="$PROJECT_DIR$/.idea/package_python.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="PYTHON_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$" />
|
|
5
|
-
<orderEntry type="inheritedJdk" />
|
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
-
</component>
|
|
8
|
-
</module>
|
|
File without changes
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import *
|
|
4
|
-
|
|
5
|
-
class Chidori:
|
|
6
|
-
def start_server(self, file_path: Optional[str]) -> None: ...
|
|
7
|
-
def play(self, branch: int, frame: int) -> None: ...
|
|
8
|
-
def pause(self, frame: int) -> None: ...
|
|
9
|
-
def branch(self) -> None: ...
|
|
10
|
-
def query(self, query: str, branch: int, frame: int) -> None: ...
|
|
11
|
-
def list_branches(self) -> None: ...
|
|
12
|
-
def display_graph_structure(self) -> None: ...
|
|
13
|
-
def list_registered_graphs(self) -> None: ...
|
|
14
|
-
def list_input_proposals(self) -> None: ...
|
|
15
|
-
def list_change_events(self, callback: object) -> None: ...
|
|
16
|
-
def poll_local_code_node_execution(self) -> None: ...
|
|
17
|
-
def ack_local_code_node_execution(self, branch: int, counter: int) -> None: ...
|
|
18
|
-
def respond_local_code_node_execution(self, branch: int, counter: int, node_name: str, response: Optional[object]) -> None: ...
|
|
19
|
-
|
|
20
|
-
class GraphBuilder:
|
|
21
|
-
def custom_node(self, name: str, queries: List[Optional[str]], output_tables: List[str], output: str, node_type_name: str) -> None: ...
|
|
22
|
-
def deno_code_node(self, name: str, queries: List[Optional[str]], output_tables: List[str], output: str, code: str, is_template: bool) -> None: ...
|
|
23
|
-
def vector_memory_node(self, name: str, queries: List[Optional[str]], output_tables: List[str], output: str, template: str, action: str, embedding_model: str, db_vendor: str, collection_name: str) -> None: ...
|
|
24
|
-
def prompt_node(self, name: str, queries: List[Optional[str]], output_tables: List[str], template: str, model: str) -> None: ...
|
|
25
|
-
def commit(self, c: Chidori, branch: int) -> None: ...
|
|
26
|
-
|
|
27
|
-
class NodeHandle:
|
|
28
|
-
def get_name(self) -> str: ...
|
|
29
|
-
def run_when(self, node_handle: Optional[NodeHandle]) -> None: ...
|
|
30
|
-
def query(self, branch: int, frame: int) -> None: ...
|
|
31
|
-
def __str__(self) -> str: ...
|
|
32
|
-
def __repr__(self) -> str: ...
|
package/package_python/py.typed
DELETED
|
File without changes
|