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

Add comment and prevent IndexOutOfBounds exception in ImageResponse

Open devholic22 opened this issue 1 year ago • 0 comments
trafficstars

Expected Behavior

Previously, an IndexOutOfBounds exception might occur if the developer using the getResult function, I modified returns null. (if imageGenerations is empty)

Current Behavior

In this version, the getResult function returns index element number 0 of imageGenerations directly.

Context

  • I added comments to make it easier to understand. (I referred to ChatResponse.)
  • I modified to return null if imageGenerations is empty.
  • I modified toString like ChatResponse format.

please see #707

devholic22 avatar May 10 '24 13:05 devholic22