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 the "Search with AI" tab if AI search is not enabled in the backend. #3204

Closed
Neurone opened this issue Feb 6, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Neurone
Copy link
Contributor

Neurone commented Feb 6, 2024

Problem description

If the OpenAI API key is not set, he AI search feature does not work, as expected. Still the feature is visible and the user can try using it, resulting in errors code 500 in the backend (especially the api-gateway) and in a "forever spinning" waiting icon on the WebUI.

Screenshot 2024-02-07 at 00 30 42
2024-02-07 00:30:36 2024-02-06T23:30:36.744Z [API_GATEWAY]: Error: Request failed with status code 401
2024-02-07 00:30:36     at /usr/local/api-gateway/node_modules/@guardian/common/dist/mq/nats-service.js:140:28
2024-02-07 00:30:36     at AISuggestions.<anonymous> (/usr/local/api-gateway/node_modules/@guardian/common/dist/mq/nats-service.js:55:33)
2024-02-07 00:30:36     at Generator.next (<anonymous>)
2024-02-07 00:30:36     at fulfilled (/usr/local/api-gateway/node_modules/@guardian/common/dist/mq/nats-service.js:5:58)
2024-02-07 00:30:36     at runMicrotasks (<anonymous>)
2024-02-07 00:30:36     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2024-02-07 00:30:36 [Nest] 19  - 02/06/2024, 11:30:36 PM   ERROR [ExceptionsHandler] Request failed with status code 401
2024-02-07 00:30:36 Error: Request failed with status code 401
2024-02-07 00:30:36     at /usr/local/api-gateway/node_modules/@guardian/common/dist/mq/nats-service.js:140:28
2024-02-07 00:30:36     at AISuggestions.<anonymous> (/usr/local/api-gateway/node_modules/@guardian/common/dist/mq/nats-service.js:55:33)
2024-02-07 00:30:36     at Generator.next (<anonymous>)
2024-02-07 00:30:36     at fulfilled (/usr/local/api-gateway/node_modules/@guardian/common/dist/mq/nats-service.js:5:58)
2024-02-07 00:30:36     at runMicrotasks (<anonymous>)
2024-02-07 00:30:36     at processTicksAndRejections (node:internal/process/task_queues:96:5)

Requirements

Remove the "Search with AI" tab if AI search is not enabled in the backend.

Definition of done

Users can see "Search with AI" tab and use that function only if the backend is correctly configured to use the OpenAI APIs.

Acceptance criteria

The fix is present in a new Guardian release.

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

3 participants