Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def explainable_decision(llm_agent, input_data, decision_context):
- decision = llm_agent.make_decision(input_data, decision_context)
- explanation_prompt = f"""
- Explain the reasoning behind the following decision:
- Decision: {decision}
- Input data: {input_data}
- Context: {decision_context}
- Provide:
- 1. Key factors influencing the decision
- 2. Alternative options considered
- 3. Potential risks and mitigations
- 4. Confidence level in the decision (Low, Medium, High)
- """
- explanation = llm_agent.generate(explanation_prompt)
- return {
- "decision": decision,
- "explanation": explanation,
- "confidence": llm_agent.extract_confidence(explanation)
- }
- # Usage
- result = explainable_decision(executive_llm_agent,
- "Q3 sales data and market projections",
- "Strategic decision on expanding product line")
Advertisement
Add Comment
Please, Sign In to add comment