objectiveai_sdk/functions/executions/
http.rs1use crate::{HttpClient, HttpError, McpHandler, Notifier};
4use futures::Stream;
5
6pub async fn create_function_execution_unary(
8 client: &HttpClient,
9 mut params: super::request::FunctionExecutionCreateParams,
10) -> Result<super::response::unary::FunctionExecution, HttpError> {
11 params.stream = None;
12 client
13 .send_unary(reqwest::Method::POST, "functions/executions", Some(params))
14 .await
15}
16
17pub async fn create_function_execution_streaming<H: McpHandler>(
22 client: &HttpClient,
23 mut params: super::request::FunctionExecutionCreateParams,
24 handler: H,
25) -> Result<
26 (
27 impl Stream<
28 Item = Result<
29 super::response::streaming::FunctionExecutionChunk,
30 HttpError,
31 >,
32 >
33 + Send
34 + Unpin
35 + 'static
36 + use<H>,
37 Notifier,
38 ),
39 HttpError,
40> {
41 params.stream = Some(true);
42 client
43 .send_streaming_ws(
44 reqwest::Method::POST,
45 "functions/executions",
46 params,
47 handler,
48 )
49 .await
50}