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
2 changes: 2 additions & 0 deletions cli/src/builtins.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod bulk_map;
pub mod chat;
pub mod email;
pub mod email2;
pub mod email3;
Expand All @@ -14,6 +15,7 @@ pub mod spans;
#[derive(clap::ValueEnum, Clone, Debug, serde::Serialize)]
#[clap(rename_all = "lowercase")]
pub enum Builtin {
Chat,
BulkMap,
Email,
Email2,
Expand Down
17 changes: 17 additions & 0 deletions cli/src/builtins/chat.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use crate::args::Args;
use spnl::{ir::Query, spnl};

pub fn query(args: Args) -> Query {
let Args {
model,
temperature,
max_tokens,
prompt,
..
} = args;
let my_prompt = prompt.unwrap_or("what is the sky blue".to_string());

spnl!(
g model (cross "Chatting" (system "You are a helpful chat bot") (user my_prompt)) temperature max_tokens
)
}
1 change: 1 addition & 0 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ async fn run(args: Args) -> Result<(), SpnlError> {

let query = hlo::optimize(
&match args.builtin {
Some(Builtin::Chat) => chat::query(args),
Some(Builtin::BulkMap) => bulk_map::query(args),
Some(Builtin::Email) => email::query(args),
Some(Builtin::Email2) => email2::query(args),
Expand Down
Loading