pub struct AgentClient { /* private fields */ }Expand description
Client for Wauldo MCP Server
§Example
use wauldo::{AgentClient, ReasoningOptions};
#[tokio::main]
async fn main() -> wauldo::Result<()> {
let mut client = AgentClient::new().connect().await?;
let result = client.reason("How to optimize?").await?;
println!("{}", result.solution);
client.disconnect().await;
Ok(())
}Implementations§
Source§impl AgentClient
impl AgentClient
Sourcepub async fn chunk_document(
&mut self,
content: &str,
chunk_size: usize,
) -> Result<ChunkResult>
pub async fn chunk_document( &mut self, content: &str, chunk_size: usize, ) -> Result<ChunkResult>
Chunk a document
Sourcepub async fn retrieve_context(
&mut self,
query: &str,
top_k: usize,
) -> Result<RetrievalResult>
pub async fn retrieve_context( &mut self, query: &str, top_k: usize, ) -> Result<RetrievalResult>
Retrieve context for a query
Source§impl AgentClient
impl AgentClient
Sourcepub async fn extract_concepts(
&mut self,
text: &str,
source_type: SourceType,
) -> Result<ConceptResult>
pub async fn extract_concepts( &mut self, text: &str, source_type: SourceType, ) -> Result<ConceptResult>
Extract concepts from text or code
Source§impl AgentClient
impl AgentClient
Sourcepub async fn search_knowledge(
&mut self,
query: &str,
limit: usize,
) -> Result<KnowledgeGraphResult>
pub async fn search_knowledge( &mut self, query: &str, limit: usize, ) -> Result<KnowledgeGraphResult>
Search knowledge graph
Sourcepub async fn add_to_knowledge(
&mut self,
text: &str,
) -> Result<KnowledgeGraphResult>
pub async fn add_to_knowledge( &mut self, text: &str, ) -> Result<KnowledgeGraphResult>
Add to knowledge graph
Sourcepub async fn knowledge_stats(&mut self) -> Result<KnowledgeGraphResult>
pub async fn knowledge_stats(&mut self) -> Result<KnowledgeGraphResult>
Get knowledge graph stats
Source§impl AgentClient
impl AgentClient
Sourcepub async fn plan_task(&mut self, task: &str) -> Result<PlanResult>
pub async fn plan_task(&mut self, task: &str) -> Result<PlanResult>
Plan a task
Sourcepub async fn plan_task_with_options(
&mut self,
task: &str,
options: PlanOptions,
) -> Result<PlanResult>
pub async fn plan_task_with_options( &mut self, task: &str, options: PlanOptions, ) -> Result<PlanResult>
Plan a task with options
Source§impl AgentClient
impl AgentClient
Sourcepub async fn reason(&mut self, problem: &str) -> Result<ReasoningResult>
pub async fn reason(&mut self, problem: &str) -> Result<ReasoningResult>
Perform Tree-of-Thought reasoning
§Example
let mut client = AgentClient::new().connect().await?;
let result = client
.reason_with_options(
"What's the best sorting algorithm?",
ReasoningOptions::new().depth(4).branches(3)
)
.await?;Sourcepub async fn reason_with_options(
&mut self,
problem: &str,
options: ReasoningOptions,
) -> Result<ReasoningResult>
pub async fn reason_with_options( &mut self, problem: &str, options: ReasoningOptions, ) -> Result<ReasoningResult>
Perform reasoning with custom options
Source§impl AgentClient
impl AgentClient
Sourcepub fn with_options(options: ClientOptions) -> Self
pub fn with_options(options: ClientOptions) -> Self
Create a new client with custom options
Sourcepub async fn disconnect(&mut self)
pub async fn disconnect(&mut self)
Disconnect from MCP server
Sourcepub async fn list_tools(&mut self) -> Result<Vec<ToolDefinition>>
pub async fn list_tools(&mut self) -> Result<Vec<ToolDefinition>>
List available tools
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentClient
impl !RefUnwindSafe for AgentClient
impl Send for AgentClient
impl Sync for AgentClient
impl Unpin for AgentClient
impl UnsafeUnpin for AgentClient
impl !UnwindSafe for AgentClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more