Skip to content

Commit

Permalink
Add getContent() method to ChatResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
habuma committed May 19, 2024
1 parent 6f4ab64 commit bae3e51
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ public Generation getResult() {
return this.generations.get(0);
}

/**
* Convenience method equivalent to {@code getResult().getOutput().getContent()}.
* @return The content from the output of the first {@link Generation} in the
* generations list.
*/
public String getContent() {
return getResult().getOutput().getContent();
}

/**
* @return Returns {@link ChatResponseMetadata} containing information about the use
* of the AI provider's API.
Expand Down

0 comments on commit bae3e51

Please sign in to comment.