You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use langhub_macros::chat;#[chat(msg = "Write a welcome message for a developer tool",type = "openai")]fngenerate_welcome() -> Result<String,Box<dyn std::error::Error>>{println!("Generated: {}", llm_response);Ok(llm_response)}
Reply to user using DeepSeek
use langhub_macros::chat;#[chat(msg = format!("Reply to the user in a friendly tone: {}", user_input),type = "deepseek")]fnreply_to_user(user_input:String) -> Result<String,Box<dyn std::error::Error>>{println!("AI reply: {}", llm_response);Ok(llm_response)}
Analyze sentiment with Anthropic
use langhub_macros::chat;#[chat(msg = format!("Analyze the sentiment (positive/negative/neutral) of this text:\n{}", text),type = "anthropic")]fnanalyze_sentiment(text:String) -> Result<String,Box<dyn std::error::Error>>{match llm_response {Ok(sentiment) => {println!("Sentiment analysis result: {}", sentiment);Ok(sentiment)}Err(e) => {eprintln!("Analysis failed: {}", e);Err(e.into())}}}
About
An LLM application development framework based on Rust.