Skip to content

Commit

Permalink
πŸ“ custom model display example
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jan 27, 2024
1 parent 6716edd commit cd58bfb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions examples/custom_model_display.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from funcchain import chain
from pydantic import BaseModel


class Task(BaseModel):
name: str
description: str
difficulty: int

def __str__(self) -> str:
return f"{self.name}\n - {self.description}\n - Difficulty: {self.difficulty}"


def plan_task(task: Task) -> str:
"""
Based on the task infos, plan the task step by step.
"""
return chain()


if __name__ == "__main__":
task = Task(
name="Do Laundry",
description="Collect and wash all the dirty clothes.",
difficulty=4,
)
print(plan_task(task))

0 comments on commit cd58bfb

Please sign in to comment.