Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@keegangeorge
Copy link
Member

@keegangeorge keegangeorge commented Dec 10, 2024

🔍 Overview

This feature adds a periodic problem check which periodically checks for issues with LLMs that are in use. Periodically, we will run a test to see if the in use LLMs are still operational. If it is not, the LLM with the problem is surfaced to the admin so they can easily go and update the configuration.

📸 Screenshots

Dashboard Problem Check AI

@keegangeorge keegangeorge marked this pull request as ready for review December 12, 2024 18:58
Comment on lines +11 to +13
def base_path
Discourse.base_path
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why, but calling Discourse.base_path by putting it in a function is the only way I can get it to work without seeing:

Translation missing: en.dashboard.problem.ai_llm_status

Calling Discourse.base_path directly inside try_validate results in the above error.

prompt_message_length: The message %{idx} is over the 1000 character limit.
dashboard:
problem:
ai_llm_status: "The LLM model: %{model_name} is encountering issues. Please check the <a href='%{base_path}/admin/plugins/discourse-ai/ai-llms/%{model_id}'>model's configuration page</a>."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, it's actually recommended to build the URL in Ruby, and have a single %{url} parameter. If the URL ever changes, translators don't need to update their translations.

Copy link
Member Author

@keegangeorge keegangeorge Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gschlager When I change it to that I get this and it no longer works. I'm not sure why it's so finicky

Screenshot 2024-12-13 at 12 17 12

and when I just pass the base_path separately:

I get it showing correctly:
Screenshot 2024-12-13 at 12 23 17

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's the way we cache problem checks? I ran into it earlier in the week when working on encrypt: (internal /t/128444/7)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, @davidtaylorhq, I still consistently see the translation error when using %{url}(even after clearing the admin notice from the database and refreshing to run a new problem check)

@keegangeorge keegangeorge merged commit 90ce942 into main Dec 16, 2024
6 checks passed
@keegangeorge keegangeorge deleted the problem-check-llm branch December 16, 2024 23:00
rescue => e
error_message = parse_error_message(e.message)
message =
"#{I18n.t("dashboard.problem.ai_llm_status", { base_path: base_path, model_name: model.display_name, model_id: model.id })}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Late to the party. This shouldn't really need to be wrapped in an interpolation string? 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

7 participants