We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently I need to write a lot of boilerplate code when the streaming has ended. this also means I need to add async_openai as dependeny.
let mut stream = chain.stream(input_variables).await?; while let Some(result) = stream.next().await { match &result { Ok(data) => data.to_stdout()?, Err(ChainError::LLMError(LLMError::OpenAIError( OpenAIError::StreamError(e), ))) => { if e == "Stream ended" { break; } else { error!("OpenAI Error: {:?}", e); break; } } Err(e) => panic!("Errorx: {:?}", e), } }
This could be simplified to use Result<Option<StreamData>>.
Result<Option<StreamData>>
let mut stream = chain.stream(input_variables).await?; while let Some(result) = stream.next().await { match &result { Ok(Some(data)) => data.to_stdout()?, None => break, Err(e) => panic!("Errorx: {:?}", e), } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently I need to write a lot of boilerplate code when the streaming has ended. this also means I need to add async_openai as dependeny.
This could be simplified to use
Result<Option<StreamData>>
.The text was updated successfully, but these errors were encountered: