Skip to content

Commit

Permalink
feat: add Galadriel API integration (#188)
Browse files Browse the repository at this point in the history
* feat: add Galadriel API integration

* Fix toolCall for the Galadriel LLM provider
  • Loading branch information
kristjanpeterson1 authored Feb 3, 2025
1 parent 5f93297 commit ef8ca81
Show file tree
Hide file tree
Showing 3 changed files with 422 additions and 0 deletions.
23 changes: 23 additions & 0 deletions rig-core/examples/agent_with_galadriel.rs
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(())
}
Loading

0 comments on commit ef8ca81

Please sign in to comment.