OrchestrateClient

Struct OrchestrateClient 

Source
pub struct OrchestrateClient { /* private fields */ }
Expand description

WatsonX Orchestrate client for managing custom assistants and document collections

Implementations§

Source§

impl OrchestrateClient

Source

pub fn new(config: OrchestrateConfig) -> Self

Create a new Orchestrate client (matches wxo-client-main pattern)

Source

pub fn with_token(self, token: String) -> Self

Set the access token for authentication

Source

pub fn set_token(&mut self, token: String)

Set the access token for authentication (mutable)

Source

pub fn config(&self) -> &OrchestrateConfig

Get the current configuration

Source

pub fn is_authenticated(&self) -> bool

Check if authenticated

Source

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

Source

pub async fn list_assistants(&self) -> Result<Vec<CustomAssistant>>

List all custom assistants

Source

pub async fn send_batch_messages( &self, request: BatchMessageRequest, ) -> Result<BatchMessageResponse>

Send multiple messages in a batch

Source

pub async fn list_skills(&self) -> Result<Vec<Skill>>

List all skills

Source

pub async fn get_skill(&self, skill_id: &str) -> Result<Skill>

Get a specific skill by ID

Source§

impl OrchestrateClient

Source

pub async fn list_agents(&self) -> Result<Vec<Agent>>

List all agents (Watson Orchestrate API)

Source

pub async fn get_agent(&self, agent_id: &str) -> Result<Agent>

Get a specific agent by ID

Source§

impl OrchestrateClient

Source

pub async fn list_threads( &self, agent_id: Option<&str>, ) -> Result<Vec<ThreadInfo>>

List all threads for an agent

Source

pub async fn create_thread(&self, agent_id: Option<&str>) -> Result<ThreadInfo>

Create a new thread for conversation

Source

pub async fn delete_thread(&self, thread_id: &str) -> Result<()>

Delete a thread

Source

pub async fn get_thread_messages(&self, thread_id: &str) -> Result<Vec<Message>>

Get conversation history from a thread

Source§

impl OrchestrateClient

Source

pub async fn list_tools(&self) -> Result<Vec<Tool>>

List all tools

Source

pub async fn get_tool(&self, tool_id: &str) -> Result<Tool>

Get a specific tool by ID

Source

pub async fn execute_tool( &self, request: ToolExecutionRequest, ) -> Result<ToolExecutionResult>

Execute a tool directly

Source

pub async fn update_tool( &self, tool_id: &str, request: ToolUpdateRequest, ) -> Result<Tool>

Update a tool

Source

pub async fn delete_tool(&self, tool_id: &str) -> Result<()>

Delete a tool

Source

pub async fn test_tool( &self, request: ToolTestRequest, ) -> Result<ToolTestResult>

Test a tool with sample input

Source

pub async fn get_tool_execution_history( &self, tool_id: &str, limit: Option<u32>, ) -> Result<Vec<ToolExecutionHistory>>

Get tool execution history

Source

pub async fn get_tool_versions(&self, tool_id: &str) -> Result<Vec<ToolVersion>>

Get tool versions

Source§

impl OrchestrateClient

Source

pub async fn get_run(&self, run_id: &str) -> Result<RunInfo>

Get information about a specific run

Source

pub async fn list_runs(&self, agent_id: Option<&str>) -> Result<Vec<RunInfo>>

List all runs for an agent

Source

pub async fn cancel_run(&self, run_id: &str) -> Result<()>

Cancel a running execution

Source§

impl OrchestrateClient

Source

pub async fn list_collections(&self) -> Result<Vec<DocumentCollection>>

List all document collections

Source

pub async fn get_collection( &self, collection_id: &str, ) -> Result<DocumentCollection>

Get a specific document collection

Source

pub async fn get_document( &self, collection_id: &str, document_id: &str, ) -> Result<Document>

Get a specific document from a collection

Source

pub async fn delete_document( &self, collection_id: &str, document_id: &str, ) -> Result<()>

Delete a document from a collection

Source

pub async fn search_documents( &self, collection_id: &str, request: SearchRequest, ) -> Result<SearchResponse>

Search documents in a collection

Source§

impl OrchestrateClient

Source

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

Source

pub async fn stream_message<F>( &self, agent_id: &str, message: &str, thread_id: Option<String>, callback: F, ) -> Result<Option<String>>
where F: FnMut(String) -> Result<()>,

Stream response from an agent (matches wxo-client pattern)

Source

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

Source

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)

Source

pub async fn stream_chat_with_docs<F>( &self, agent_id: &str, thread_id: &str, request: ChatWithDocsRequest, callback: F, ) -> Result<()>
where F: FnMut(String) -> Result<()>,

Stream chat with documents response

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more