Skip to main content

call_openai_stream_async

Function call_openai_stream_async 

Source
pub async fn call_openai_stream_async(
    provider: &ModelProvider,
    messages: &[ChatMessage],
    on_chunk: &mut dyn FnMut(&str),
) -> Result<String, String>
Expand description

使用 async-openai 流式调用 API,通过回调逐步输出 返回完整的助手回复内容