pub struct Agent<T: LLMBackend = OpenAI> {
pub world: Option<World>,
pub entity: Option<Entity>,
/* private fields */
}Fields§
§world: Option<World>§entity: Option<Entity>Implementations§
Source§impl<T: LLMBackend> Agent<T>
impl<T: LLMBackend> Agent<T>
pub fn builder() -> AgentBuilder<T>
pub async fn dispatch_user_message(&mut self, text: &str) -> String
Sourcepub async fn run(&mut self) -> Result<AgentRunOutput>
pub async fn run(&mut self) -> Result<AgentRunOutput>
Run the agent to completion and return the final AgentRunOutput,
which contains the full hecs::World with all components.
§Errors
Returns an error if the LLM API call fails and no plugin handles it.
Sourcepub async fn run_json<R>(&mut self) -> Result<R>where
R: DeserializeOwned + JsonSchema,
pub async fn run_json<R>(&mut self) -> Result<R>where
R: DeserializeOwned + JsonSchema,
Trait Implementations§
Source§impl<T: LLMBackend> Debug for Agent<T>
impl<T: LLMBackend> Debug for Agent<T>
Auto Trait Implementations§
impl<T = OpenAI> !Freeze for Agent<T>
impl<T = OpenAI> !RefUnwindSafe for Agent<T>
impl<T = OpenAI> !UnwindSafe for Agent<T>
impl<T> Send for Agent<T>
impl<T> Sync for Agent<T>
impl<T> Unpin for Agent<T>where
T: Unpin,
impl<T> UnsafeUnpin for Agent<T>where
T: 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