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

Use custom prompt in response_hallucination #263

Open
pradeepdev-1995 opened this issue Mar 11, 2024 · 3 comments
Open

Use custom prompt in response_hallucination #263

pradeepdev-1995 opened this issue Mar 11, 2024 · 3 comments
Assignees

Comments

@pradeepdev-1995
Copy link

How can I use my own domain specific prompt for response hallucination detection function call in langkit?

@FelipeAdachi
Copy link
Contributor

Can you elaborate on your question a bit more? What is exactly that you're trying to do?

@pradeepdev-1995
Copy link
Author

pradeepdev-1995 commented Mar 22, 2024

@FelipeAdachi In my understanding, the hallucination detection works by prompting the LLM with a default prompt inside the langkit library.
My question is shall we use our own custom prompt for this, rather than go with the default prompt?

@FelipeAdachi
Copy link
Contributor

The hallucination detection will call the LLM in two distinct phases:

  1. To generate the additional samples, based on the prompt passed
  2. To perform the consistency check between the answer and generated samples

I'm assuming you want to pass your own custom prompt for the second item, correct? If that's the case, no, we currently don't support it.

Right now, the code expects an output between [Accurate, Minor Inaccurate, Major Inaccurate], and assigns scores for each of these 3 values. To support a custom prompt, we'd need to require the same output, or maybe some sort of mapping of categories to values.

Can you share more details on why do you need a custom prompt for your use case?

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

No branches or pull requests

2 participants