Skip to content

Commit

Permalink
Merge branch 'scrippt-tech:main' into feat/concurrent-generate-embedd…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
Butch78 authored Nov 2, 2023
2 parents ae6b1fb + 8efaf5c commit 92603ee
Show file tree
Hide file tree
Showing 81 changed files with 10,720 additions and 963 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ orca = { git = "https://github.com/scrippt-tech/orca" }
* Current LLM support:
* [OpenAI Chat]("https://openai.com")
* Limited [Bert]("https://huggingface.co/docs/transformers/model_doc/bert) support using the [Candle]("https://github.com/huggingface/candle") ML framework
* Chains:
* Simple chains
* Sequential chains
* Pipelines:
* Simple pipelines
* Sequential pipelines

# Examples
Orca supports simple LLM chains and sequential chains. It also supports reading PDF and HTML records (documents).
Orca supports simple LLM pipelines and sequential pipelines. It also supports reading PDF and HTML records (documents).

## OpenAI Chat
```rust
use orca::chains::chain::LLMChain;
use orca::chains::Chain;
use orca::pipeline::simple::LLMPipeline;
use orca::pipeline::Pipeline;
use orca::llm::openai::OpenAI;
use orca::prompt::context::Context;
use serde::Serialize;

#[derive(Serialize)]
Expand All @@ -74,14 +75,14 @@ async fn main() -> anyhow::Result<()> {
{{/user}}
{{/chat}}
"#;
let mut chain = LLMChain::new(&client).with_template("capitals", prompt);
chain
.load_context(&Data {
let mut pipeline = LLMPipeline::new(&client).with_template("capitals", prompt);
pipeline
.load_context(&Context::new(Data {
country1: "France".to_string(),
country2: "Germany".to_string(),
})
})?)
.await;
let res = chain.execute("capitals").await?.content();
let res = pipeline.execute("capitals").await?.content();

assert!(res.contains("Berlin") || res.contains("berlin"));
Ok(())
Expand Down
21 changes: 20 additions & 1 deletion docs/.rustc_info.json
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
{"rustc_fingerprint":17236160968283789963,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.73.0 (cc66ad468 2023-10-03)\nbinary: rustc\ncommit-hash: cc66ad468955717ab92600c770da8c1601a4ff33\ncommit-date: 2023-10-03\nhost: aarch64-apple-darwin\nrelease: 1.73.0\nLLVM version: 17.0.2\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/santiagomedina/.rustup/toolchains/stable-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}}
{
"rustc_fingerprint": 17236160968283789963,
"outputs": {
"4614504638168534921": {
"success": true,
"status": "",
"code": 0,
"stdout": "rustc 1.73.0 (cc66ad468 2023-10-03)\nbinary: rustc\ncommit-hash: cc66ad468955717ab92600c770da8c1601a4ff33\ncommit-date: 2023-10-03\nhost: aarch64-apple-darwin\nrelease: 1.73.0\nLLVM version: 17.0.2\n",
"stderr": ""
},
"15729799797837862367": {
"success": true,
"status": "",
"code": 0,
"stdout": "___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/santiagomedina/.rustup/toolpipelines/stable-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n",
"stderr": ""
}
},
"successes": {}
}
41 changes: 40 additions & 1 deletion docs/debug/.fingerprint/orca-c0fd00abd688838d/doc-lib-orca.json
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
{"rustc":9313819672678296987,"features":"[]","target":15312707631679176516,"profile":7204359972152282074,"path":13944423399745936263,"deps":[[286105315730129192,"uuid",false,4003480634886957208],[996813347875584063,"candle_core",false,3151064862552433134],[1402890219209318537,"tokio",false,3153009443864065999],[1961652958923998717,"anyhow",false,2015435600082841783],[2270819559833323163,"serde",false,12133881638594174661],[2949660453085566109,"candle_nn",false,15820540239794422829],[4029980042253000321,"reqwest",false,2926274035391949493],[5910892534286594076,"rand",false,18384182241883354309],[6685978870289758589,"pdf",false,9605514507577983574],[6727101157262132865,"tokenizers",false,12407565196296628770],[7416334744765216273,"log",false,1354761754188164054],[7474076399583569463,"tracing_subscriber",false,8744597273925990007],[8942142186424886887,"pdf_text",false,11080673893968991865],[8960588895214073549,"serde_json",false,14216023452553587605],[10944502605539928769,"itertools",false,3426294964229269559],[11031748290035625770,"handlebars",false,869121610477591915],[11573737598821222763,"text_splitter",false,14455251095550177540],[13444899861998108526,"tracing_chrome",false,10751101957317938078],[14197070920105624443,"async_trait",false,17145894909574909532],[14529868973807519177,"hf_hub",false,3306588434719910898],[16849141258772654115,"serial_test",false,12800005345137390292],[17292803654893571594,"scraper",false,2183323984546313723],[17370586992517102248,"candle_transformers",false,15417840202294870594],[17664437716274205994,"qdrant_client",false,3811843073438000962]],"local":[{"Precalculated":"1698722268.628502946s (src/chains/chain.rs)"}],"rustflags":[],"metadata":11385388782292949905,"config":2202906307356721367,"compile_kind":0}
{
"rustc": 9313819672678296987,
"features": "[]",
"target": 15312707631679176516,
"profile": 7204359972152282074,
"path": 13944423399745936263,
"deps": [
[286105315730129192, "uuid", false, 4003480634886957208],
[996813347875584063, "candle_core", false, 3151064862552433134],
[1402890219209318537, "tokio", false, 3153009443864065999],
[1961652958923998717, "anyhow", false, 2015435600082841783],
[2270819559833323163, "serde", false, 12133881638594174661],
[2949660453085566109, "candle_nn", false, 15820540239794422829],
[4029980042253000321, "reqwest", false, 2926274035391949493],
[5910892534286594076, "rand", false, 18384182241883354309],
[6685978870289758589, "pdf", false, 9605514507577983574],
[6727101157262132865, "tokenizers", false, 12407565196296628770],
[7416334744765216273, "log", false, 1354761754188164054],
[7474076399583569463, "tracing_subscriber", false, 8744597273925990007],
[8942142186424886887, "pdf_text", false, 11080673893968991865],
[8960588895214073549, "serde_json", false, 14216023452553587605],
[10944502605539928769, "itertools", false, 3426294964229269559],
[11031748290035625770, "handlebars", false, 869121610477591915],
[11573737598821222763, "text_splitter", false, 14455251095550177540],
[13444899861998108526, "tracing_chrome", false, 10751101957317938078],
[14197070920105624443, "async_trait", false, 17145894909574909532],
[14529868973807519177, "hf_hub", false, 3306588434719910898],
[16849141258772654115, "serial_test", false, 12800005345137390292],
[17292803654893571594, "scraper", false, 2183323984546313723],
[17370586992517102248, "candle_transformers", false, 15417840202294870594],
[17664437716274205994, "qdrant_client", false, 3811843073438000962]
],
"local": [
{ "Precalculated": "1698722268.628502946s (src/pipelines/pipeline.rs)" }
],
"rustflags": [],
"metadata": 11385388782292949905,
"config": 2202906307356721367,
"compile_kind": 0
}
8 changes: 4 additions & 4 deletions docs/debug/deps/anyhow-3b275f4b3f23922c.d
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/Users/santiagomedina/scrippt/orca/docs/debug/deps/anyhow-3b275f4b3f23922c.rmeta: /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/chain.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/fmt.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/kind.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/macros.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ptr.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/wrapper.rs
/Users/santiagomedina/scrippt/orca/docs/debug/deps/anyhow-3b275f4b3f23922c.rmeta: /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/pipeline.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/fmt.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/kind.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/macros.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ptr.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/wrapper.rs

/Users/santiagomedina/scrippt/orca/docs/debug/deps/libanyhow-3b275f4b3f23922c.rlib: /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/chain.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/fmt.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/kind.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/macros.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ptr.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/wrapper.rs
/Users/santiagomedina/scrippt/orca/docs/debug/deps/libanyhow-3b275f4b3f23922c.rlib: /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/pipeline.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/fmt.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/kind.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/macros.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ptr.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/wrapper.rs

/Users/santiagomedina/scrippt/orca/docs/debug/deps/anyhow-3b275f4b3f23922c.d: /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/chain.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/fmt.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/kind.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/macros.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ptr.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/wrapper.rs
/Users/santiagomedina/scrippt/orca/docs/debug/deps/anyhow-3b275f4b3f23922c.d: /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/pipeline.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/fmt.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/kind.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/macros.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ptr.rs /Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/wrapper.rs

/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/lib.rs:
/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs:
/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/chain.rs:
/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/pipeline.rs:
/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/context.rs:
/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs:
/Users/santiagomedina/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs:
Expand Down
Loading

0 comments on commit 92603ee

Please sign in to comment.