Closed
Description
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
- Configure the
ChatClient
as shown in the documentation example. - Start the Spring application and make a request to the
/ai/simple
endpoint usingcurl localhost:8080/ai/simple
. - 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!
Metadata
Metadata
Assignees
Labels
No labels