Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Correct response key from "generation" to "completion" in example code #1533

Closed
LuizyHub opened this issue Oct 14, 2024 · 2 comments

Comments

@LuizyHub
Copy link
Contributor

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!

@LuizyHub
Copy link
Contributor Author

Here is my Pull Request #1534

@LuizyHub
Copy link
Contributor Author

solved #1534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant