Bug description The example code in the documentation for Spring AI currently labels the response key as "generation" in a curl command example. However, the correct key should be "completion" to match the actual API response format. https://docs.spring.io/spring-ai/reference/api/chatclient.html

Environment - Spring AI version: [Provide version here, e.g., 1.0.0] - Java version: [Provide Java version here, e.g., 11] - Vector Store: N/A

Steps to reproduce 1. Configure the ChatClient as shown in the documentation example. 2. Start the Spring application and make a request to the /ai/simple endpoint using curl localhost:8080/ai/simple. 3. Observe the response key, which is labeled "generation" instead of the expected "completion".

Expected behavior The response should use "completion" as the key to accurately reflect the API response format.

Minimal Complete Reproducible example The issue can be reproduced by using the example configuration in the documentation. The curl command will output:

{"generation": "Why did the pirate go to the comedy club? To hear some arrr-rated jokes! Arrr, matey!"}

but should output:

{"completion": "Why did the pirate go to the comedy club? To hear some arrr-rated jokes! Arrr, matey!"}

Thank you for reviewing this issue!

Comment From: LuizyHub

Here is my Pull Request #1534

Comment From: LuizyHub

solved #1534