-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
Consider the example code presented.
Ideally, this should return true so that we can support Callable Classes.
Feel free to reject this if it's an anti-pattern.
Example Code
from pydantic_ai import RunContext
from pydantic_ai._function_schema import _takes_ctx
# Create a concrete implementation for testing
class TestProcessor:
def __call__(self, ctx: RunContext, messages: list):
return messages
def process(self, messages):
return messages
def post_process(self, messages):
return messages
if __name__ == "__main__":
processor = TestProcessor()
result = _takes_ctx(processor)
print(f"_takes_ctx result: {result}") # returns FalsePython, Pydantic AI & LLM client version
Python 3.11.12
pydantic-ai 1.0.6
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working