weavel-ai / Ape

Your first AI prompt engineer
https://docs.weavel.ai/sdk-reference/ape-common
MIT License
331 stars 13 forks source link

[bug fix] Change isinstance to issubclass for response_format check #47

Closed aschung01 closed 5 days ago

aschung01 commented 5 days ago

Update the condition in Prompt class to use issubclass instead of isinstance when checking self.response_format against BaseModel. This allows for proper handling of subclasses of BaseModel.

Notes: The user clarified that self.response_format can be a subclass of BaseModel, not just an instance. This change ensures that the code correctly identifies and processes response formats that inherit from BaseModel.