pub struct AgentEngineState { /* private fields */ }Expand description
Shared state for the Agent Engine dispatch handlers.
The session service and app name are taken from the Runner so the
dispatch surface and the runner can never disagree about session scoping.
The memory and artifact services are optional from day one: filling them
in later is additive, mirroring adk-python AdkApp’s
memory_service_builder / artifact_service_builder.
Implementations§
Source§impl AgentEngineState
impl AgentEngineState
Sourcepub fn new(runner: Arc<Runner>) -> Self
pub fn new(runner: Arc<Runner>) -> Self
Creates dispatch state around a prebuilt runner.
§Example
use adk_server::agent_engine::AgentEngineState;
use adk_runner::Runner;
use std::sync::Arc;
let state = AgentEngineState::new(runner);Sourcepub fn with_memory_service(self, memory_service: Arc<dyn MemoryService>) -> Self
pub fn with_memory_service(self, memory_service: Arc<dyn MemoryService>) -> Self
Configures the memory service backing async_add_session_to_memory
and async_search_memory. Without one, both return an
Unsupported error.
Sourcepub fn with_artifact_service(
self,
artifact_service: Arc<dyn ArtifactService>,
) -> Self
pub fn with_artifact_service( self, artifact_service: Arc<dyn ArtifactService>, ) -> Self
Configures the artifact service. No class method consumes it yet; it
is carried here so wiring GcsArtifactService later is additive.
Sourcepub fn session_service(&self) -> &Arc<dyn SessionService> ⓘ
pub fn session_service(&self) -> &Arc<dyn SessionService> ⓘ
The session service backing the session class methods.
Sourcepub fn memory_service(&self) -> Option<&Arc<dyn MemoryService>>
pub fn memory_service(&self) -> Option<&Arc<dyn MemoryService>>
The memory service, when configured.
Sourcepub fn artifact_service(&self) -> Option<&Arc<dyn ArtifactService>>
pub fn artifact_service(&self) -> Option<&Arc<dyn ArtifactService>>
The artifact service, when configured.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AgentEngineState
impl !UnwindSafe for AgentEngineState
impl Forget for AgentEngineState
impl Freeze for AgentEngineStatewhere
*const ArcInner<Runner> is !null: Freeze,
PhantomData<ArcInner<Runner>>: Freeze,
*const ArcInner<dyn SessionService> is !null: Freeze,
PhantomData<ArcInner<dyn SessionService>>: Freeze,
*const ArcInner<dyn MemoryService> is !null: Freeze,
PhantomData<ArcInner<dyn MemoryService>>: Freeze,
*const ArcInner<dyn ArtifactService> is !null: Freeze,
PhantomData<ArcInner<dyn ArtifactService>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for AgentEngineState
impl Send for AgentEngineStatewhere
Arc<Runner>: Send,
Arc<dyn SessionService>: Send,
Arc<dyn MemoryService>: Send,
Arc<dyn ArtifactService>: Send,
RawVecInner: Send,
impl Sync for AgentEngineStatewhere
Arc<Runner>: Sync,
Arc<dyn SessionService>: Sync,
Arc<dyn MemoryService>: Sync,
Arc<dyn ArtifactService>: Sync,
RawVecInner: Sync,
impl Unpin for AgentEngineStatewhere
Arc<Runner>: Unpin,
Arc<dyn SessionService>: Unpin,
Arc<dyn MemoryService>: Unpin,
Arc<dyn ArtifactService>: Unpin,
*const u8 is !null: Unpin,
impl UnsafeUnpin for AgentEngineStatewhere
*const ArcInner<Runner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Runner>>: UnsafeUnpin,
*const ArcInner<dyn SessionService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SessionService>>: UnsafeUnpin,
*const ArcInner<dyn MemoryService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn MemoryService>>: UnsafeUnpin,
*const ArcInner<dyn ArtifactService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ArtifactService>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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 more