pub struct OrchestrateClient { /* private fields */ }Expand description
WatsonX Orchestrate client for managing custom assistants and document collections
Implementations§
Source§impl OrchestrateClient
impl OrchestrateClient
Sourcepub fn new(config: OrchestrateConfig) -> Self
pub fn new(config: OrchestrateConfig) -> Self
Create a new Orchestrate client (matches wxo-client-main pattern)
Sourcepub fn with_token(self, token: String) -> Self
pub fn with_token(self, token: String) -> Self
Set the access token for authentication
Sourcepub fn config(&self) -> &OrchestrateConfig
pub fn config(&self) -> &OrchestrateConfig
Get the current configuration
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Check if authenticated
Sourcepub async fn generate_jwt_token(api_key: &str) -> Result<String>
pub async fn generate_jwt_token(api_key: &str) -> Result<String>
Generate IAM Access Token from Watson Orchestrate API key This is required for Watson Orchestrate SaaS authentication
Sourcepub async fn list_assistants(&self) -> Result<Vec<CustomAssistant>>
pub async fn list_assistants(&self) -> Result<Vec<CustomAssistant>>
List all custom assistants
Sourcepub async fn send_batch_messages(
&self,
request: BatchMessageRequest,
) -> Result<BatchMessageResponse>
pub async fn send_batch_messages( &self, request: BatchMessageRequest, ) -> Result<BatchMessageResponse>
Send multiple messages in a batch
Sourcepub async fn list_skills(&self) -> Result<Vec<Skill>>
pub async fn list_skills(&self) -> Result<Vec<Skill>>
List all skills
Source§impl OrchestrateClient
impl OrchestrateClient
Sourcepub async fn list_threads(
&self,
agent_id: Option<&str>,
) -> Result<Vec<ThreadInfo>>
pub async fn list_threads( &self, agent_id: Option<&str>, ) -> Result<Vec<ThreadInfo>>
List all threads for an agent
Sourcepub async fn create_thread(&self, agent_id: Option<&str>) -> Result<ThreadInfo>
pub async fn create_thread(&self, agent_id: Option<&str>) -> Result<ThreadInfo>
Create a new thread for conversation
Sourcepub async fn delete_thread(&self, thread_id: &str) -> Result<()>
pub async fn delete_thread(&self, thread_id: &str) -> Result<()>
Delete a thread
Source§impl OrchestrateClient
impl OrchestrateClient
Sourcepub async fn list_tools(&self) -> Result<Vec<Tool>>
pub async fn list_tools(&self) -> Result<Vec<Tool>>
List all tools
Sourcepub async fn execute_tool(
&self,
request: ToolExecutionRequest,
) -> Result<ToolExecutionResult>
pub async fn execute_tool( &self, request: ToolExecutionRequest, ) -> Result<ToolExecutionResult>
Execute a tool directly
Sourcepub async fn update_tool(
&self,
tool_id: &str,
request: ToolUpdateRequest,
) -> Result<Tool>
pub async fn update_tool( &self, tool_id: &str, request: ToolUpdateRequest, ) -> Result<Tool>
Update a tool
Sourcepub async fn delete_tool(&self, tool_id: &str) -> Result<()>
pub async fn delete_tool(&self, tool_id: &str) -> Result<()>
Delete a tool
Sourcepub async fn test_tool(
&self,
request: ToolTestRequest,
) -> Result<ToolTestResult>
pub async fn test_tool( &self, request: ToolTestRequest, ) -> Result<ToolTestResult>
Test a tool with sample input
Sourcepub async fn get_tool_execution_history(
&self,
tool_id: &str,
limit: Option<u32>,
) -> Result<Vec<ToolExecutionHistory>>
pub async fn get_tool_execution_history( &self, tool_id: &str, limit: Option<u32>, ) -> Result<Vec<ToolExecutionHistory>>
Get tool execution history
Sourcepub async fn get_tool_versions(&self, tool_id: &str) -> Result<Vec<ToolVersion>>
pub async fn get_tool_versions(&self, tool_id: &str) -> Result<Vec<ToolVersion>>
Get tool versions
Source§impl OrchestrateClient
impl OrchestrateClient
Sourcepub async fn get_run(&self, run_id: &str) -> Result<RunInfo>
pub async fn get_run(&self, run_id: &str) -> Result<RunInfo>
Get information about a specific run
Sourcepub async fn list_runs(&self, agent_id: Option<&str>) -> Result<Vec<RunInfo>>
pub async fn list_runs(&self, agent_id: Option<&str>) -> Result<Vec<RunInfo>>
List all runs for an agent
Sourcepub async fn cancel_run(&self, run_id: &str) -> Result<()>
pub async fn cancel_run(&self, run_id: &str) -> Result<()>
Cancel a running execution
Source§impl OrchestrateClient
impl OrchestrateClient
Sourcepub async fn list_collections(&self) -> Result<Vec<DocumentCollection>>
pub async fn list_collections(&self) -> Result<Vec<DocumentCollection>>
List all document collections
Sourcepub async fn get_collection(
&self,
collection_id: &str,
) -> Result<DocumentCollection>
pub async fn get_collection( &self, collection_id: &str, ) -> Result<DocumentCollection>
Get a specific document collection
Sourcepub async fn get_document(
&self,
collection_id: &str,
document_id: &str,
) -> Result<Document>
pub async fn get_document( &self, collection_id: &str, document_id: &str, ) -> Result<Document>
Get a specific document from a collection
Sourcepub async fn delete_document(
&self,
collection_id: &str,
document_id: &str,
) -> Result<()>
pub async fn delete_document( &self, collection_id: &str, document_id: &str, ) -> Result<()>
Delete a document from a collection
Sourcepub async fn search_documents(
&self,
collection_id: &str,
request: SearchRequest,
) -> Result<SearchResponse>
pub async fn search_documents( &self, collection_id: &str, request: SearchRequest, ) -> Result<SearchResponse>
Search documents in a collection
Source§impl OrchestrateClient
impl OrchestrateClient
Sourcepub async fn send_message(
&self,
agent_id: &str,
message: &str,
thread_id: Option<String>,
) -> Result<(String, Option<String>)>
pub async fn send_message( &self, agent_id: &str, message: &str, thread_id: Option<String>, ) -> Result<(String, Option<String>)>
Send a message to an agent and get response (matches wxo-client pattern) Uses /runs/stream endpoint and maintains thread_id for conversation continuity
Sourcepub async fn stream_message<F>(
&self,
agent_id: &str,
message: &str,
thread_id: Option<String>,
callback: F,
) -> Result<Option<String>>
pub async fn stream_message<F>( &self, agent_id: &str, message: &str, thread_id: Option<String>, callback: F, ) -> Result<Option<String>>
Stream response from an agent (matches wxo-client pattern)
Sourcepub async fn get_chat_with_docs_status(
&self,
agent_id: &str,
thread_id: &str,
) -> Result<ChatWithDocsStatus>
pub async fn get_chat_with_docs_status( &self, agent_id: &str, thread_id: &str, ) -> Result<ChatWithDocsStatus>
Get the status of chat with documents knowledge base for a thread
Sourcepub async fn chat_with_docs(
&self,
agent_id: &str,
thread_id: &str,
request: ChatWithDocsRequest,
) -> Result<ChatWithDocsResponse>
pub async fn chat_with_docs( &self, agent_id: &str, thread_id: &str, request: ChatWithDocsRequest, ) -> Result<ChatWithDocsResponse>
Send a message with document context (chat with documents)