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

Remove extra lines before body of response OpenAI API sends back #16

Open
ash1eygrace opened this issue Sep 12, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ash1eygrace
Copy link
Owner

ash1eygrace commented Sep 12, 2022

Examples responses from API, seem to consistently come back with two extra lines \n\n before the text:

{
  "output": {
    "id": "cmpl-5piNzLeqAZOMoVema2MeguNftjgEg",
    "object": "text_completion",
    "created": 1663007031,
    "model": "text-davinci-002",
    "choices": [
      {
        "text": "\n\n-Tips for saving money on groceries\n-Ways to save money on your utility bills\n-How to create a budget that works for you\n-Saving money tips for busy families\n-10 simple ways to save money every day\n-3 big mistakes people make when trying to save money\n-How to save money on travel expenses\n-7 creative ways to save money",
        "index": 0,
        "logprobs": null,
        "finish_reason": "stop"
      }
    ],
    "usage": {
      "prompt_tokens": 16,
      "completion_tokens": 79,
      "total_tokens": 95
    }
  }
}

The result appears as unintentional CSS styling on the frontend when the response state is displayed:

Screen Shot 2022-09-12 at 12 25 43 PM

@ash1eygrace ash1eygrace added the bug Something isn't working label Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant