from agentx import AgentX
from crewai import Agent, Task, Crew
client = AgentX.from_env()
support_agent = Agent(
role="Support Specialist",
goal="Resolve customer questions accurately and concisely",
backstory="You are an experienced customer support specialist.",
)
def crewai_agent(case):
task = Task(
description=case.query,
expected_output="A clear, accurate answer to the customer's question.",
agent=support_agent,
)
crew = Crew(agents=[support_agent], tasks=[task])
result = crew.kickoff()
return {"output": str(result)}
run_context = (
client.evaluations
.run(dataset_id="...", subject={"kind": "custom_agent", "displayName": "Support Crew", "framework": "crewai"})
.execute(crewai_agent)
.finalize()
)
print(f"Average rating: {run_context.average_rating:.2f}")