Skip to content

Commit

Permalink
Fixing overload
Browse files Browse the repository at this point in the history
  • Loading branch information
josead committed Jan 2, 2025
1 parent e8f798e commit 01ab9f4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions pydantic_ai_slim/pydantic_ai/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,21 +536,7 @@ def system_prompt(self, func: Callable[[], str], /) -> Callable[[], str]: ...
def system_prompt(self, func: Callable[[], Awaitable[str]], /) -> Callable[[], Awaitable[str]]: ...

@overload
def system_prompt(
self, func: _system_prompt.SystemPromptFunc[AgentDeps] | None = None, /, *, dynamic: bool = False
) -> Any:
if func is None:

def decorator(
func_: _system_prompt.SystemPromptFunc[AgentDeps],
) -> _system_prompt.SystemPromptFunc[AgentDeps]:
self._system_prompt_functions.append(_system_prompt.SystemPromptRunner(func_, dynamic=dynamic))
return func_

return decorator
else:
self._system_prompt_functions.append(_system_prompt.SystemPromptRunner(func, dynamic=dynamic))
return func
def system_prompt(self, /, *, dynamic: bool = False) -> Any: ...

def system_prompt(
self,
Expand Down

0 comments on commit 01ab9f4

Please sign in to comment.