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

[New Plugin] Medical Advice Detection #688

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

Akshay-66
Copy link

Plugin Name: Medical Advice Detection
Plugin Description: Detects Medical Advice in the generated response and flags a warning whenever the LLM provides a medical advice.


Core logic:

  • A simple keyword-based detection mechanism is used in both the request and response stages. If any predefined medical keywords are found, the plugin flags a warning.
  • detectMedicalAdvice(): Scans the response for medical keywords.
  • detectMedicalRequest(): Scans the request for medical-related queries.
  • BeforeRequestHook: Detects whether a user query is likely to lead to medical advice (e.g., checking for keywords like "symptoms" or "diagnose").
  • AfterRequestHook: Detects medical advice in the LLM's generated response by scanning for medical-related keywords (e.g., "prescribe," "treatment," "medication")

Related Issues:


Finally all unit tests pass by running

image

@Akshay-66
Copy link
Author

@b4s36t4 @vrushankportkey
Request for Review / Changes / Approval.

Copy link
Contributor

@narengogi narengogi left a comment

Choose a reason for hiding this comment

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

Interesting take on a plugin implementation.
I guess this could be called a generic plugin instead of a medicalkeywords plugin. Because this plugin just invokes a function which is expected to be user defined,

imo, this should not be in the default plugin category.

@Akshay-66
Copy link
Author

Thank you @narengogi for your opinion on this,
It's a great idea to make it as customizable for users for various purposes like medical ,legal and some other privacy / sensitive content / advice (By just changing the keywords given [using it as a template]).

Yes, It just invokes a function, but I'm not aware of more complex logic's and I'm super excited to work on that, can you provide me even more details to improve, like what will be the expectation and result.

Hope you will guide me in the following way.

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 this pull request may close these issues.

2 participants