Skip to content

feat: Add Send to StreamingCompletionModel trait #412

New issue

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

Closed
1 task done
JazzyMcJazz opened this issue Apr 22, 2025 · 1 comment · Fixed by #388 · May be fixed by #413
Closed
1 task done

feat: Add Send to StreamingCompletionModel trait #412

JazzyMcJazz opened this issue Apr 22, 2025 · 1 comment · Fixed by #388 · May be fixed by #413

Comments

@JazzyMcJazz
Copy link

  • I have looked for existing issues (including closed) about this

Feature Request

Add Send to fn stream() in the StreamingCompletionModel trait in src/streaming.rs

Motivation

The ability to do multi turn while streaming the response. Currently, attempting to call the stream function inside Box::pin(async_stream::stream! { ... }) causes the follow error:

"impl Future<Output = Result<Pin<Box<...>>, ...>> cannot be sent between threads safely
within AsyncStream<Result<StreamingContent, PromptError>, ...>, the trait std::marker::Send is not implemented for impl Future<Output = Result<Pin<Box<...>>, ...>>"

Proposal

Change stream(...) -> impl Future<Output = Result<StreamingResult, CompletionError>>;
To stream(...) -> impl Future<Output = Result<StreamingResult, CompletionError>> + Send;

Alternatives

None that I can think of.

Copy link

linear bot commented Apr 22, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants