opi-agent 0.1.0

General-purpose agent runtime with tool calling and transport abstraction
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Transport abstraction for agent communication.

use async_trait::async_trait;

#[async_trait]
pub trait Transport: Send + Sync {
    async fn send(&self, message: &str) -> Result<(), TransportError>;
    async fn receive(&self) -> Result<String, TransportError>;
}

#[derive(Debug, thiserror::Error)]
pub enum TransportError {
    #[error("connection failed: {0}")]
    ConnectionFailed(String),
    #[error("send failed: {0}")]
    SendFailed(String),
}