Skip to content
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

Orchestration streaming #227

Merged
merged 11 commits into from
Dec 10, 2024
Merged

Orchestration streaming #227

merged 11 commits into from
Dec 10, 2024

Conversation

CharlesDuboisSAP
Copy link
Contributor

@CharlesDuboisSAP CharlesDuboisSAP commented Dec 5, 2024

Context

AI/ai-sdk-java-backlog#71.

As an orchestration user I want to stream responses, similarly to streaming when using OpenAI

Feature scope:

  • Added streamChatCompletionDeltas() and streamChatCompletion() to the OrchestrationClient
  • Reduce code duplication to be done in AI/ai-sdk-java-backlog#111

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@CharlesDuboisSAP CharlesDuboisSAP self-assigned this Dec 5, 2024
@CharlesDuboisSAP CharlesDuboisSAP added the please-review Request to review a pull-request label Dec 5, 2024
* content_filter
*/
@Nonnull
public Stream<String> streamChatCompletion(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Comment)

New method names match the existing OpenAiClient counter-part in openai module.

}
return IterableStreamConverter.lines(response.getEntity())
// half of the lines are empty newlines, the last line is "data: [DONE]"
.peek(line -> log.info("Handler: {}", line))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Comment)

I'm surprised we have so many info log statements. I feel like we could define a coding guideline when to use what log level.

(no action required.)

@CharlesDuboisSAP CharlesDuboisSAP enabled auto-merge (squash) December 10, 2024 13:53
@CharlesDuboisSAP CharlesDuboisSAP merged commit c326b7d into main Dec 10, 2024
5 checks passed
@CharlesDuboisSAP CharlesDuboisSAP deleted the orchestration-streaming branch December 10, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please-review Request to review a pull-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants