-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Galadriel API integration (#188)
* feat: add Galadriel API integration * Fix toolCall for the Galadriel LLM provider
- Loading branch information
1 parent
5f93297
commit ef8ca81
Showing
3 changed files
with
422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use rig::{completion::Prompt, providers}; | ||
use std::env; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), anyhow::Error> { | ||
// Create Galadriel client | ||
let client = providers::galadriel::Client::new( | ||
&env::var("GALADRIEL_API_KEY").expect("GALADRIEL_API_KEY not set"), | ||
env::var("GALADRIEL_FINE_TUNE_API_KEY").ok().as_deref(), | ||
); | ||
|
||
// Create agent with a single context prompt | ||
let comedian_agent = client | ||
.agent("gpt-4o") | ||
.preamble("You are a comedian here to entertain the user using humour and jokes.") | ||
.build(); | ||
|
||
// Prompt the agent and print the response | ||
let response = comedian_agent.prompt("Entertain me!").await?; | ||
println!("{}", response); | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.