Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ResponseEntity<String> completion(
@GetMapping("/streamChatCompletion")
@Nonnull
ResponseEntity<ResponseBodyEmitter> streamChatCompletion() {
return service.streamChatCompletion(100);
return service.streamChatCompletion();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,10 @@ public OrchestrationChatResponse grounding(@Nonnull final String groundingInput)
* @return the emitter that streams the assistant message response
*/
@Nonnull
public ResponseEntity<ResponseBodyEmitter> streamChatCompletion(final int numberOfFibonacci) {
public ResponseEntity<ResponseBodyEmitter> streamChatCompletion() {
final var prompt =
new OrchestrationPrompt(
"Can you give me the first "
+ numberOfFibonacci
+ " numbers of the Fibonacci sequence?");
"Please create a small story about developing a software project with around 700 words.");
Copy link
Contributor

Choose a reason for hiding this comment

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

(Minor/Comment)

For sake of sample code quality and "real world" application, I would probably still prefer a service method parameter.

Suggested change
"Please create a small story about developing a software project with around 700 words.");
"Please create a small story about "+topic+" with around 700 words.");

final var stream = client.streamChatCompletion(prompt, config);

final var emitter = new ResponseBodyEmitter();
Expand Down
Loading