Conversation
|
Looks fantastic! I tried the guardrails via streamlit chat page. I asked about credit rating for a company. The answer was that LLM could not access real-time info continuing with some general text. Log: Stacktrace: |
|
Oh, I forgot to enforce the function_call and kept it "auto". So it was opt to LLM to follow the instructions or not. I was just lucky it did when I tested it :D |
|
One last note: |
|
I use gpt-4o as a baseline model (it's much cheaper and faster than gpt4). But I think for guardrails and other more primitive use cases GPT-4o-mini which is even more cheaper than 3.5 turbo would be enough. However don't wanna lie, I haven't tried it out. |
|
btw, I've tried gpt-4o-mini for the guardrails. It works. We should avoid using legacy gpt3.5 |
|
I've made some changes to the guardrails. Now it also checks the LLM output. Mostly it controls whether the LLM response actually answers users query. It doesn't check whether the answer is correct, but just the fact that the response is a semantic answer to the query. I also made the decisionmaker to use gpt-4o-mini explicitly. |
I've implemented guardrails using more general DecisionMaker class. Within this class LLM chooses a decision from a finite decision_domain. In case of guardrails it choses from ["The query is not related to ESG topics", "The query contains hateful speech", "The query tries to make a jailbreak", "The query is appropriate"]