import os
from crewai import Agent, Crew, LLM, Process, Task
llm = LLM(
model="openai/z-ai/glm-5.2",
base_url="https://api.redpill.ai/v1",
api_key=os.environ["REDPILL_AI_API_KEY"],
temperature=0,
)
reviewer = Agent(
role="Code reviewer",
goal="Identify correctness and security risks",
backstory="A senior engineer who reports concrete findings.",
llm=llm,
max_iter=3,
)
review = Task(
description="Review the supplied change summary: {change_summary}",
expected_output="A prioritized list of findings with suggested fixes.",
agent=reviewer,
)
crew = Crew(agents=[reviewer], tasks=[review], process=Process.sequential)
result = crew.kickoff(inputs={"change_summary": "Adds token refresh without retry limits."})
print(result)