pub struct VertexAiSessionService { /* private fields */ }Expand description
Session service backed by the Vertex AI managed session endpoint.
Uses the Vertex AI REST API for session CRUD and event storage. Requires a valid Google Cloud project with the AI Platform API enabled.
Sessions are stored server-side by Google Cloud, providing managed persistence without requiring a separate database.
Implementations§
Source§impl VertexAiSessionService
impl VertexAiSessionService
Sourcepub fn new(config: VertexAiSessionConfig) -> Self
pub fn new(config: VertexAiSessionConfig) -> Self
Create a new Vertex AI session service.
Sourcepub fn ttl_seconds(&self) -> Option<u64>
pub fn ttl_seconds(&self) -> Option<u64>
Returns the configured TTL in seconds, if any.
Trait Implementations§
Source§impl SessionService for VertexAiSessionService
impl SessionService for VertexAiSessionService
Source§fn create_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Session, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Session, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new session.
Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a session by ID.
Source§fn list_sessions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_sessions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List sessions for an app + user.
Source§fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a session.
Auto Trait Implementations§
impl Freeze for VertexAiSessionService
impl RefUnwindSafe for VertexAiSessionService
impl Send for VertexAiSessionService
impl Sync for VertexAiSessionService
impl Unpin for VertexAiSessionService
impl UnsafeUnpin for VertexAiSessionService
impl UnwindSafe for VertexAiSessionService
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