pub struct OpenAIExecutor;Expand description
OpenAI executor implementing the Executor trait.
Implementations§
Source§impl OpenAIExecutor
impl OpenAIExecutor
Sourcepub fn build_args(
agent: &Prompty,
messages: &[Message],
) -> Result<Value, InvokerError>
pub fn build_args( agent: &Prompty, messages: &[Message], ) -> Result<Value, InvokerError>
Build the request args without sending — useful for testing wire format.
Trait Implementations§
Source§impl Executor for OpenAIExecutor
impl Executor for OpenAIExecutor
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
agent: &'life1 Prompty,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Value, InvokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
agent: &'life1 Prompty,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Value, InvokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute an LLM call with the given messages.
Source§fn format_tool_messages(
&self,
_raw_response: &Value,
tool_calls: &[ToolCall],
tool_results: &[String],
_text_content: Option<&str>,
) -> Vec<Message>
fn format_tool_messages( &self, _raw_response: &Value, tool_calls: &[ToolCall], tool_results: &[String], _text_content: Option<&str>, ) -> Vec<Message>
Format tool-call results into messages for the next iteration of the
agent loop. Returns messages to append to the conversation. Read more
Source§fn execute_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
agent: &'life1 Prompty,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Value> + Send>>, InvokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
agent: &'life1 Prompty,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Value> + Send>>, InvokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute an LLM call and return a stream of raw SSE chunks. Read more
Auto Trait Implementations§
impl Freeze for OpenAIExecutor
impl RefUnwindSafe for OpenAIExecutor
impl Send for OpenAIExecutor
impl Sync for OpenAIExecutor
impl Unpin for OpenAIExecutor
impl UnsafeUnpin for OpenAIExecutor
impl UnwindSafe for OpenAIExecutor
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