pub struct StakpakApiClient { /* private fields */ }Expand description
Client for Stakpak’s non-inference APIs
Implementations§
Source§impl StakpakApiClient
impl StakpakApiClient
Sourcepub fn new(config: &StakpakApiConfig) -> Result<Self, String>
pub fn new(config: &StakpakApiConfig) -> Result<Self, String>
Create a new StakpakApiClient
Sourcepub async fn create_session(
&self,
req: &CreateSessionRequest,
) -> Result<CreateSessionResponse, String>
pub async fn create_session( &self, req: &CreateSessionRequest, ) -> Result<CreateSessionResponse, String>
Create a new session
Sourcepub async fn create_checkpoint(
&self,
session_id: Uuid,
req: &CreateCheckpointRequest,
) -> Result<CreateCheckpointResponse, String>
pub async fn create_checkpoint( &self, session_id: Uuid, req: &CreateCheckpointRequest, ) -> Result<CreateCheckpointResponse, String>
Create a checkpoint for a session
Sourcepub async fn list_sessions(
&self,
query: &ListSessionsQuery,
) -> Result<ListSessionsResponse, String>
pub async fn list_sessions( &self, query: &ListSessionsQuery, ) -> Result<ListSessionsResponse, String>
List sessions
Sourcepub async fn get_session(&self, id: Uuid) -> Result<GetSessionResponse, String>
pub async fn get_session(&self, id: Uuid) -> Result<GetSessionResponse, String>
Get a session by ID
Sourcepub async fn update_session(
&self,
id: Uuid,
req: &UpdateSessionRequest,
) -> Result<UpdateSessionResponse, String>
pub async fn update_session( &self, id: Uuid, req: &UpdateSessionRequest, ) -> Result<UpdateSessionResponse, String>
Update a session
Sourcepub async fn list_checkpoints(
&self,
session_id: Uuid,
query: &ListCheckpointsQuery,
) -> Result<ListCheckpointsResponse, String>
pub async fn list_checkpoints( &self, session_id: Uuid, query: &ListCheckpointsQuery, ) -> Result<ListCheckpointsResponse, String>
List checkpoints for a session
Sourcepub async fn get_checkpoint(
&self,
id: Uuid,
) -> Result<GetCheckpointResponse, String>
pub async fn get_checkpoint( &self, id: Uuid, ) -> Result<GetCheckpointResponse, String>
Get a checkpoint by ID
Sourcepub async fn cancel_request(&self, request_id: &str) -> Result<(), String>
pub async fn cancel_request(&self, request_id: &str) -> Result<(), String>
Cancel an active inference request
Sourcepub async fn get_account(&self) -> Result<GetMyAccountResponse, String>
pub async fn get_account(&self) -> Result<GetMyAccountResponse, String>
Get the current user’s account info
Sourcepub async fn get_billing(
&self,
username: &str,
) -> Result<BillingResponse, String>
pub async fn get_billing( &self, username: &str, ) -> Result<BillingResponse, String>
Get billing info for a user
Sourcepub async fn list_rulebooks(&self) -> Result<Vec<ListRuleBook>, String>
pub async fn list_rulebooks(&self) -> Result<Vec<ListRuleBook>, String>
List all rulebooks
Sourcepub async fn get_rulebook_by_uri(&self, uri: &str) -> Result<RuleBook, String>
pub async fn get_rulebook_by_uri(&self, uri: &str) -> Result<RuleBook, String>
Get a rulebook by URI
Sourcepub async fn create_rulebook(
&self,
input: &CreateRuleBookInput,
) -> Result<CreateRuleBookResponse, String>
pub async fn create_rulebook( &self, input: &CreateRuleBookInput, ) -> Result<CreateRuleBookResponse, String>
Create a new rulebook
Sourcepub async fn search_docs(
&self,
req: &SearchDocsRequest,
) -> Result<Vec<Content>, String>
pub async fn search_docs( &self, req: &SearchDocsRequest, ) -> Result<Vec<Content>, String>
Search documentation
Sourcepub async fn search_memory(
&self,
req: &SearchMemoryRequest,
) -> Result<Vec<Content>, String>
pub async fn search_memory( &self, req: &SearchMemoryRequest, ) -> Result<Vec<Content>, String>
Search memory
Sourcepub async fn memorize_session(&self, checkpoint_id: Uuid) -> Result<(), String>
pub async fn memorize_session(&self, checkpoint_id: Uuid) -> Result<(), String>
Memorize a session checkpoint (extract memory)
Sourcepub async fn slack_read_messages(
&self,
req: &SlackReadMessagesRequest,
) -> Result<Vec<Content>, String>
pub async fn slack_read_messages( &self, req: &SlackReadMessagesRequest, ) -> Result<Vec<Content>, String>
Read Slack messages from a channel
Sourcepub async fn slack_read_replies(
&self,
req: &SlackReadRepliesRequest,
) -> Result<Vec<Content>, String>
pub async fn slack_read_replies( &self, req: &SlackReadRepliesRequest, ) -> Result<Vec<Content>, String>
Read Slack thread replies
Sourcepub async fn slack_send_message(
&self,
req: &SlackSendMessageRequest,
) -> Result<Vec<Content>, String>
pub async fn slack_send_message( &self, req: &SlackSendMessageRequest, ) -> Result<Vec<Content>, String>
Send a Slack message
Trait Implementations§
Source§impl Clone for StakpakApiClient
impl Clone for StakpakApiClient
Source§fn clone(&self) -> StakpakApiClient
fn clone(&self) -> StakpakApiClient
Returns a duplicate of the value. Read more
1.0.0 · 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 StakpakApiClient
impl !RefUnwindSafe for StakpakApiClient
impl Send for StakpakApiClient
impl Sync for StakpakApiClient
impl Unpin for StakpakApiClient
impl !UnwindSafe for StakpakApiClient
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request