pub struct AgentSDKClient {
pub options: AgentSDKOptions,
/* private fields */
}Fields§
§options: AgentSDKOptionsImplementations§
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn new(options: AgentSDKOptions) -> Self
pub fn new_with_agent(options: AgentSDKOptions, agent: AgentDefinition) -> Self
pub fn new_with_agents( options: AgentSDKOptions, agents: BTreeMap<String, AgentDefinition>, ) -> Result<Self, String>
pub fn with_runtime<C: LlmClient + Clone + 'static>( self, runtime: AgentRuntime<C>, ) -> Self
pub fn set_default_agent(&mut self, definition: AgentDefinition)
pub fn register_agent( &mut self, name: impl Into<String>, definition: AgentDefinition, ) -> Result<(), String>
pub fn register_agents( &mut self, agents: BTreeMap<String, AgentDefinition>, ) -> Result<(), String>
pub fn list_agents(&self) -> Vec<String>
pub fn resource_diagnostics(&self) -> Vec<String>
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn query(&self, prompt: impl Into<String>) -> Result<String, String>
pub fn query_with_require_completed( &self, prompt: impl Into<String>, require_completed: bool, ) -> Result<String, String>
pub fn query_with_request( &self, request: AgentSessionRunRequest, require_completed: bool, ) -> Result<String, String>
pub fn query_with_agent_request( &self, definition: AgentDefinition, request: AgentSessionRunRequest, require_completed: bool, ) -> Result<String, String>
pub fn query_agent( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, ) -> Result<String, String>
pub fn query_agent_with_require_completed( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, require_completed: bool, ) -> Result<String, String>
pub fn query_agent_with_request( &self, agent_name: impl AsRef<str>, request: AgentSessionRunRequest, require_completed: bool, ) -> Result<String, String>
pub fn query_agent_in_workspace( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<String, String>
pub fn query_agent_in_workspace_with_require_completed( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, workspace: impl Into<PathBuf>, require_completed: bool, ) -> Result<String, String>
pub fn query_in_workspace( &self, prompt: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<String, String>
pub fn query_in_workspace_with_require_completed( &self, prompt: impl Into<String>, workspace: impl Into<PathBuf>, require_completed: bool, ) -> Result<String, String>
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn run(&self, prompt: impl Into<String>) -> Result<AgentRun, String>
pub fn run_in_workspace( &self, prompt: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentRun, String>
pub fn run_with_agent( &self, definition: AgentDefinition, prompt: impl Into<String>, ) -> Result<AgentRun, String>
pub fn run_with_agent_in_workspace( &self, definition: AgentDefinition, prompt: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentRun, String>
pub fn run_with_agent_request( &self, definition: AgentDefinition, request: AgentSessionRunRequest, ) -> Result<AgentRun, String>
pub fn run_with_request( &self, request: AgentSessionRunRequest, ) -> Result<AgentRun, String>
pub fn run_agent( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, ) -> Result<AgentRun, String>
pub fn run_agent_in_workspace( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentRun, String>
pub fn run_agent_with_request( &self, agent_name: impl AsRef<str>, request: AgentSessionRunRequest, ) -> Result<AgentRun, String>
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn create_session( &self, agent_name: impl Into<String>, definition: AgentDefinition, ) -> AgentSession
pub fn create_session_with_id( &self, agent_name: impl Into<String>, definition: AgentDefinition, session_id: impl Into<String>, ) -> AgentSession
pub fn create_session_with_workspace( &self, agent_name: impl Into<String>, definition: AgentDefinition, workspace: impl Into<PathBuf>, ) -> AgentSession
pub fn create_session_with_id_and_workspace( &self, agent_name: impl Into<String>, definition: AgentDefinition, session_id: impl Into<String>, workspace: impl Into<PathBuf>, ) -> AgentSession
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn create_default_session(&self) -> Result<AgentSession, String>
pub fn create_default_session_with_workspace( &self, workspace: impl Into<PathBuf>, ) -> Result<AgentSession, String>
pub fn create_default_session_with_id( &self, session_id: impl Into<String>, ) -> Result<AgentSession, String>
pub fn create_default_session_with_id_and_workspace( &self, session_id: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentSession, String>
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn create_agent_session_by_name( &self, agent_name: impl AsRef<str>, ) -> Result<AgentSession, String>
pub fn create_agent_session_by_name_in_workspace( &self, agent_name: impl AsRef<str>, workspace: impl Into<PathBuf>, ) -> Result<AgentSession, String>
pub fn create_agent_session_by_name_with_id( &self, agent_name: impl AsRef<str>, session_id: impl Into<String>, ) -> Result<AgentSession, String>
pub fn create_agent_session_by_name_with_id_and_workspace( &self, agent_name: impl AsRef<str>, session_id: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentSession, String>
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn prepare_task( &self, prompt: impl Into<String>, resolved_model_id: impl Into<String>, ) -> Result<AgentTask, String>
pub fn prepare_task_with_request( &self, request: AgentSessionRunRequest, resolved_model_id: impl Into<String>, ) -> Result<AgentTask, String>
pub fn prepare_task_with_session_id( &self, prompt: impl Into<String>, resolved_model_id: impl Into<String>, session_id: impl Into<String>, ) -> Result<AgentTask, String>
pub fn prepare_task_in_workspace( &self, prompt: impl Into<String>, resolved_model_id: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentTask, String>
pub fn prepare_task_in_workspace_with_session_id( &self, prompt: impl Into<String>, resolved_model_id: impl Into<String>, workspace: impl Into<PathBuf>, session_id: impl Into<String>, ) -> Result<AgentTask, String>
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn prepare_task_with_agent( &self, definition: AgentDefinition, prompt: impl Into<String>, resolved_model_id: impl Into<String>, ) -> AgentTask
pub fn prepare_task_with_agent_request( &self, definition: AgentDefinition, request: AgentSessionRunRequest, resolved_model_id: impl Into<String>, ) -> AgentTask
pub fn prepare_task_with_agent_with_session_id( &self, definition: AgentDefinition, prompt: impl Into<String>, resolved_model_id: impl Into<String>, session_id: impl Into<String>, ) -> AgentTask
pub fn prepare_task_with_agent_in_workspace( &self, definition: AgentDefinition, prompt: impl Into<String>, resolved_model_id: impl Into<String>, workspace: impl Into<PathBuf>, ) -> AgentTask
pub fn prepare_task_with_agent_in_workspace_with_session_id( &self, definition: AgentDefinition, prompt: impl Into<String>, resolved_model_id: impl Into<String>, workspace: impl Into<PathBuf>, session_id: impl Into<String>, ) -> AgentTask
Source§impl AgentSDKClient
impl AgentSDKClient
pub fn prepare_task_for_agent( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, resolved_model_id: impl Into<String>, ) -> Result<AgentTask, String>
pub fn prepare_task_for_agent_with_request( &self, agent_name: impl AsRef<str>, request: AgentSessionRunRequest, resolved_model_id: impl Into<String>, ) -> Result<AgentTask, String>
pub fn prepare_task_for_agent_with_session_id( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, resolved_model_id: impl Into<String>, session_id: impl Into<String>, ) -> Result<AgentTask, String>
pub fn prepare_task_for_agent_in_workspace( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, resolved_model_id: impl Into<String>, workspace: impl Into<PathBuf>, ) -> Result<AgentTask, String>
pub fn prepare_task_for_agent_in_workspace_with_session_id( &self, agent_name: impl AsRef<str>, prompt: impl Into<String>, resolved_model_id: impl Into<String>, workspace: impl Into<PathBuf>, session_id: impl Into<String>, ) -> Result<AgentTask, String>
Trait Implementations§
Source§impl Clone for AgentSDKClient
impl Clone for AgentSDKClient
Source§fn clone(&self) -> AgentSDKClient
fn clone(&self) -> AgentSDKClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AgentSDKClient
impl !RefUnwindSafe for AgentSDKClient
impl Send for AgentSDKClient
impl Sync for AgentSDKClient
impl Unpin for AgentSDKClient
impl UnsafeUnpin for AgentSDKClient
impl !UnwindSafe for AgentSDKClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.