pub trait AgentSourcePort: Send + Sync {
// Required methods
fn invoke<'life0, 'async_trait>(
&'life0 self,
request: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn source_name(&self) -> &str;
}Expand description
Port trait for LLM agent data sources.
Implementations wrap an LLM provider and expose it as a pipeline-compatible data source.
§Example
use stygian_graph::ports::agent_source::{AgentSourcePort, AgentRequest};
use serde_json::json;
let req = AgentRequest {
prompt: "List the key takeaways".into(),
context: Some("...article text...".into()),
parameters: json!({}),
};
let resp = agent.invoke(req).await.unwrap();
println!("{}", resp.content);Required Methods§
Sourcefn invoke<'life0, 'async_trait>(
&'life0 self,
request: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
request: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn source_name(&self) -> &str
fn source_name(&self) -> &str
Name of this agent source for logging and identification.