chatgpt-spring-boot-starter icon indicating copy to clipboard operation
chatgpt-spring-boot-starter copied to clipboard

Help with Structured Output

Open Alex793x opened this issue 1 year ago • 1 comments
trafficstars

Hi @linux-china, thanks for you hard work and this amazing repo!

  • We struggle to use the Structured Output, and in the documentation it looks like we simply use a different return type than String and that would automatically make the request a function call to the output structured json format ... is that correct ? Otherwise we totally misunderstood, your implementation. Would you be able to show an example of how we can utilize the new Structured output?

Alex793x avatar Aug 12 '24 21:08 Alex793x

@Alex793x yes, just change return type, please take a look at unit test: https://github.com/linux-china/chatgpt-spring-boot-starter/blob/5abf40473320abbdaf364fe939e05449eeaaa796/src/test/java/org/mvnsearch/chatgpt/spring/service/GPTHelloServiceTest.java#L56

linux-china avatar Aug 13 '24 08:08 linux-china