spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

VertexAiGeminiChatClient loses information about Safety Ratings when returning ChatResponse

Open rafal-dudek opened this issue 1 year ago • 2 comments

Expected Behavior

I would like to be able to extract SafetyRatings from ChatResponse returned by VertexAiGeminiChatClient.call(Prompt prompt). GenerateContentResponse contains list of SafetyRatings on each Candidate, so the data is already obtained in the library.

image

Current Behavior

VertexAiGeminiChatClient.call(Prompt prompt) returns ChatResponse which does not have information about SafetyRatings returned from Gemini.

Context

I'm not sure how many LLM models returns similar information, but it would be a useful feature to store it in generic format in Generation objects of ChatResponse, instead of loosing it in this abstraction layer.

rafal-dudek avatar May 06 '24 12:05 rafal-dudek

Super important! The responses need a review and also tests for serialization.

markpollack avatar Jul 22 '24 21:07 markpollack

yes important. Looking forward for this. Any alternate suggestions to achieve this in the interim?

satishgutta avatar Apr 25 '25 18:04 satishgutta

I'm afraid not. Just doing issue triage and this unfortunately will have to wait until post GA.

markpollack avatar May 09 '25 18:05 markpollack