pub struct AgentEngineOptions { /* private fields */ }Expand description
Options for serve_agent_engine and build_agent_engine_app.
Every field is optional: the zero-configuration default serves the agent with an in-memory session service — enough to answer platform queries, but sessions do not survive a container restart. Production deployments configure managed backends:
session_service—VertexAiSessionService(featurevertex-sessionin the consumer) picks up the platform’s managed Sessions viaVertexAiSessionConfig::from_env(), which reads the sameGOOGLE_CLOUD_*variables the platform sets.artifact_service—GcsArtifactService(featuregcsonadk-artifact) stores artifacts where the Gemini Enterprise console renders them; take the bucket from an environment variable or a flag.memory_service— enables theasync_add_session_to_memory/async_search_memoryclass methods; without one they return anUnsupportederror.
§Example
use adk_server::agent_engine::AgentEngineOptions;
let opts = AgentEngineOptions::new().with_app_name("weather-agent");Implementations§
Source§impl AgentEngineOptions
impl AgentEngineOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates empty options: in-memory sessions, no memory or artifact
service, app name from the agent, port from $PORT.
Sourcepub fn with_session_service(
self,
session_service: Arc<dyn SessionService>,
) -> Self
pub fn with_session_service( self, session_service: Arc<dyn SessionService>, ) -> Self
Sets the session persistence backend. Defaults to
InMemorySessionService when unset.
Sourcepub fn with_memory_service(self, memory_service: Arc<dyn MemoryService>) -> Self
pub fn with_memory_service(self, memory_service: Arc<dyn MemoryService>) -> Self
Sets the memory service backing the memory class methods.
Sourcepub fn with_artifact_service(
self,
artifact_service: Arc<dyn ArtifactService>,
) -> Self
pub fn with_artifact_service( self, artifact_service: Arc<dyn ArtifactService>, ) -> Self
Sets the artifact storage backend, wired into both the runner and the dispatch state.
Sourcepub fn with_app_name(self, app_name: impl Into<String>) -> Self
pub fn with_app_name(self, app_name: impl Into<String>) -> Self
Overrides the application name used for session scoping. Defaults to the agent’s name.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AgentEngineOptions
impl !UnwindSafe for AgentEngineOptions
impl Forget for AgentEngineOptions
impl Freeze for AgentEngineOptionswhere
*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 AgentEngineOptions
impl Send for AgentEngineOptionswhere
Arc<dyn SessionService>: Send,
Arc<dyn MemoryService>: Send,
Arc<dyn ArtifactService>: Send,
RawVecInner: Send,
impl Sync for AgentEngineOptionswhere
Arc<dyn SessionService>: Sync,
Arc<dyn MemoryService>: Sync,
Arc<dyn ArtifactService>: Sync,
RawVecInner: Sync,
impl Unpin for AgentEngineOptionswhere
Arc<dyn SessionService>: Unpin,
Arc<dyn MemoryService>: Unpin,
Arc<dyn ArtifactService>: Unpin,
*const u8 is !null: Unpin,
impl UnsafeUnpin for AgentEngineOptionswhere
*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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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 more