Skip to main content
Loading navigation
Back to prompt library

Multi-LLM Verification with Claude Opus 4.1

Linked challenge: Global Tax & Legal Compliance Advisor Agent

Prompt source

implementation18 lines4 sectionsNo variables1 code block
Extend your agent's workflow. After GPT-4o generates an initial compliance advice using 'query_legal_database', introduce a step where a separate call to Claude Opus 4.1 is made. Claude's role is to critically review GPT-4o's advice for potential biases or inaccuracies, especially regarding complex legal interpretations. Describe the prompt you would use for Claude Opus 4.1 and how you would integrate this verification step programmatically using the OpenAI Agents SDK's conversational flow.

```python
import anthropic
# client = anthropic.Anthropic(api_key="YOUR_CLAUDE_API_KEY")

def verify_advice_with_claude(gpt4o_advice: str, query: str) -> str:
    prompt = f"Critically review the following legal advice provided by another AI for potential inaccuracies, biases, or omissions. Focus on clarity and legal correctness.\nOriginal query: {query}\nAdvice to review: {gpt4o_advice}\nYour assessment:"
    # response = client.messages.create(
    #     model="claude-3-opus-20240229", # Or Opus 4.1 if available
    #     max_tokens=500,
    #     messages=[
    #         {"role": "user", "content": prompt}
    #     ]
    # )
    # return response.content[0].text
    return "Claude's verified assessment."

# Integrating this into the OpenAI Assistant's thread logic would involve a custom callback 
# or explicit function call after GPT-4o's initial response, managing the multi-turn.
```