A user, Overgrow, reports encountering Net::HTTPBadResponse errors in their error log after enabling sentiment analysis using OpenAI, which appears to be linked to unusually long posts causing OpenAI API to return a 400 Bad Request. Despite adjusting the token limit to 64,000 (50% of the 128K context window), the issue persists. Jagster clarifies that the error is due to an incorrect HTTP status code and questions the setup process. Overgrow explains the configuration involves enabling the ai sentiment enabled module and entering LLM model parameters. Sam requests a screenshot of the configuration, which Overgrow provides. Falco corrects the misconception, stating that there is no sentiment analysis feature via OpenAI in DiscourseAI and directs users to the official guide for local setup.
Looking at the post_ids in question, it seems the issue is likely caused by the unusually long posts. Otherwise, the sentiment graphs generate without any problems.
To add more information, I’ve got Number of tokens for the prompt set according to the recommendation (64000 which is 50% of 128K context window). But I’m not sure if this plays any role..