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

Add getContent() method to ChatResponse #737

Closed

Conversation

habuma
Copy link
Member

@habuma habuma commented May 19, 2024

Simple convenience method on ChatRespoonse to return the content of the first generation.

Although ChatResponse has many useful bits of information carried in it, the most common thing needed by all applications is the content of the first generation. E.g.

String content = chatResponse.getResult().getOuptut().getContent();

Because it's the most commonly needed information from a ChatResponse, it would be helpful if there were a convenience method that returns the content directly instead of having to navigate through a few other properties. That's what this PR provides. The above code can then be replaced with:

String content = chatResponse.getContent();

@markpollack
Copy link
Member

the branch modelcaller has a new fluent api that covers this use case and more.

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

Successfully merging this pull request may close these issues.

2 participants