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

Reevaluate class name BeanOutputConverter

Open ullenboom opened this issue 9 months ago • 3 comments

BeanOutputConverterworks fine with records too:

record Profile( String nickname, int hornlength ) {}
var outputParser = new BeanOutputConverter<>( Profile.class );
System.out.println( outputParser.getFormat() );

->

Your response should be in JSON format.
Do not include any explanations, only provide a RFC8259 compliant JSON response following this format without deviation.
Do not include markdown code blocks in your response.
Here is the JSON Schema instance your output must adhere to:
```{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "type" : "object",
  "properties" : {
    "hornlength" : {
      "type" : "integer"
    },
    "nickname" : {
      "type" : "string"
    }
  }
}```

Maybe rename the class name.

This reminds me of class DataClassRowMapper extends BeanPropertyRowMapper.

ullenboom avatar May 10 '24 18:05 ullenboom

There is a new class OutputParserConverter

eddumelendez avatar May 11 '24 11:05 eddumelendez

@ullenboom have you checked the new Structured Output docs: https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/api/structured-output-converter.html

tzolov avatar May 11 '24 13:05 tzolov

I've updated my issue. The naming concern also applies to BeanOutputConverter.

ullenboom avatar May 13 '24 06:05 ullenboom

Has been addressed, now using OutputConverter style suffix

markpollack avatar Jul 22 '24 22:07 markpollack