We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This example is never formatted correctly
from typing import Union from pydantic_ai import RunContext, Tool from pydantic_ai.tools import ToolDefinition async def only_if_42( ctx: RunContext[int], tool_def: ToolDefinition ) -> Union[ToolDefinition, None]: if ctx.deps == 42: return tool_def def hitchhiker(ctx: RunContext[int], answer: str) -> str: return f'{ctx.deps} {answer}' hitchhiker = Tool(hitchhiker, prepare=only_if_42)
Because ruff and black disagree.
Black error:
ruff failed: pydantic_ai_slim/pydantic_ai/tools.py:103:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from typing import Union 2 | | 3 | | from pydantic_ai import RunContext, Tool 4 | | from pydantic_ai.tools import ToolDefinition 5 | | 6 | | async def only_if_42( | |_^ I001 7 | ctx: RunContext[int], tool_def: ToolDefinition 8 | ) -> Union[ToolDefinition, None]: | = help: Organize imports Found 1 error. [*] 1 fixable with the `--fix` option.
The text was updated successfully, but these errors were encountered:
I001
No branches or pull requests
This example is never formatted correctly
Because ruff and black disagree.
Black error:
The text was updated successfully, but these errors were encountered: