pub struct AgyBridge { /* private fields */ }Expand description
Primary entry point for the Antigravity bridge.
Wraps the runtime and provides a clean Rust API for creating agents.
§Example
// Zero-config:
// let bridge = AgyBridge::builder().build()?;
// With custom timeouts:
let bridge = AgyBridge::builder()
.chat_timeout(std::time::Duration::from_secs(120))
.build()?;
// Create an agent (simple):
// let agent = bridge.agent(AgentConfig::default()).await?;
// Create an agent with tools and hooks:
// let agent = bridge.agent(config)
// .tools(registry)
// .hooks(hooks)
// .await?;
let answer = agent.chat("Hello!").await?.text().await?;Implementations§
Source§impl AgyBridge
impl AgyBridge
Sourcepub fn builder() -> AgyBridgeBuilder
pub fn builder() -> AgyBridgeBuilder
Sourcepub fn agent(&self, config: AgentConfig) -> AgentBuilder<'_>
pub fn agent(&self, config: AgentConfig) -> AgentBuilder<'_>
Begin building a new agent on this bridge.
Returns an AgentBuilder that can be directly .awaited for the
simple case, or chained with .tools() and
.hooks() before awaiting.
§Examples
// Simple — no tools or hooks:
let agent = bridge.agent(AgentConfig::default()).await?;
// With tools:
// let agent = bridge.agent(config).tools(registry).await?;
// With tools and hooks:
// let agent = bridge.agent(config).tools(registry).hooks(hooks).await?;Sourcepub fn default_agent(&self) -> AgentBuilder<'_>
pub fn default_agent(&self) -> AgentBuilder<'_>
Auto Trait Implementations§
impl !RefUnwindSafe for AgyBridge
impl !UnwindSafe for AgyBridge
impl Freeze for AgyBridge
impl Send for AgyBridge
impl Sync for AgyBridge
impl Unpin for AgyBridge
impl UnsafeUnpin for AgyBridge
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