pub struct ThreadClient { /* private fields */ }Expand description
Agent threads of the project: conversations whose chat items, tasks and database outlive any one session.
Implementations§
Source§impl ThreadClient
impl ThreadClient
Sourcepub fn with_api_key(host: &str, api_key: &str, api_secret: &str) -> Self
pub fn with_api_key(host: &str, api_key: &str, api_secret: &str) -> Self
Authenticates with an API key and secret, signing a short-lived token per request.
Sourcepub fn with_token(host: &str, token: &str) -> Self
pub fn with_token(host: &str, token: &str) -> Self
Authenticates with a pre-signed token, sent verbatim on every request.
Sourcepub fn new(host: &str) -> ServiceResult<Self>
pub fn new(host: &str) -> ServiceResult<Self>
Reads the API key and secret from the LIVEKIT_API_KEY and
LIVEKIT_API_SECRET environment variables.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Overrides the default per-request timeout (10s) for calls on this client.
pub async fn create(&self, req: CreateRequest) -> ServiceResult<Thread>
pub async fn get(&self, thread_id: &str) -> ServiceResult<Thread>
Sourcepub async fn list(&self, req: ListRequest) -> ServiceResult<ListResponse>
pub async fn list(&self, req: ListRequest) -> ServiceResult<ListResponse>
The threads of one scope (every scope when empty), newest first.
pub async fn update(&self, req: UpdateRequest) -> ServiceResult<Thread>
Sourcepub async fn delete(&self, thread_id: &str) -> ServiceResult<()>
pub async fn delete(&self, thread_id: &str) -> ServiceResult<()>
Deletes the thread and its database.
Sourcepub async fn items(
&self,
req: GetItemsRequest,
) -> ServiceResult<GetItemsResponse>
pub async fn items( &self, req: GetItemsRequest, ) -> ServiceResult<GetItemsResponse>
The thread’s chat items, oldest first unless sort_order says otherwise.
Sourcepub async fn tasks(
&self,
req: GetTasksRequest,
) -> ServiceResult<GetTasksResponse>
pub async fn tasks( &self, req: GetTasksRequest, ) -> ServiceResult<GetTasksResponse>
The thread’s tasks, oldest first.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ThreadClient
impl !UnwindSafe for ThreadClient
impl Freeze for ThreadClient
impl Send for ThreadClient
impl Sync for ThreadClient
impl Unpin for ThreadClient
impl UnsafeUnpin for ThreadClient
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