Skip to main content

call_llm_stream

Function call_llm_stream 

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

同步包装:创建 tokio runtime 执行异步流式调用