Skip to main content

call_llm_stream_async

Function call_llm_stream_async 

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

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