from openclaw import Agent
from skills.treeship_skill import TreeshipSkill
agent = Agent(
name="loan-processor",
skills=[TreeshipSkill()]
)
@agent.on("process_application")
async def handle_application(ctx, application_id: str):
# Process the loan
result = await ctx.analyze_creditworthiness(application_id)
decision = await ctx.make_decision(result)
# Attest the decision
verify_url = ctx.skills.treeship.attest(
action=f"Loan decision: {decision.outcome} for #{application_id}",
data={"application_id": application_id, "decision": decision.outcome}
)
return {
"decision": decision,
"verification": verify_url
}