from crewai import Agent, Task, Crew
from crewai_tools import SerperDevTool
from counsel_crewai import VaneObserver
# Set up the observer
observer = VaneObserver(
base_url="https://vane.build",
api_key="counsel_a1b2c3d4...",
agent_id="legal-researcher",
company_id="acme",
)
# Create your crew normally
researcher = Agent(
role="Legal Researcher",
goal="Find relevant legal precedents",
backstory="Expert in EU AI regulation",
tools=[SerperDevTool()],
verbose=True,
)
task = Task(
description="Research EU AI Act compliance requirements for financial services",
agent=researcher,
expected_output="A structured summary of compliance requirements",
)
crew = Crew(agents=[researcher], tasks=[task])
# Wrap the crew — three lines total
crew = observer.wrap(crew)
result = crew.kickoff()
print(result)