Skip to content

Commit 06431dc

Browse files
committed
fix(core/agent): add overload typings for agent_wrapper()
1 parent 90b5eec commit 06431dc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

npiai/core/agent/agent.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from typing import List
2+
from typing import List, overload
33

44
from litellm.types.completion import ChatCompletionMessageParam
55

@@ -151,6 +151,16 @@ async def chat(
151151
return await self._call_llm(messages)
152152

153153

154+
@overload
155+
def agent_wrapper(app: App, llm: LLM = None) -> Agent:
156+
...
157+
158+
159+
@overload
160+
def agent_wrapper(app: BrowserApp, llm: LLM = None) -> BrowserAgent:
161+
...
162+
163+
154164
def agent_wrapper(app: App | BrowserApp, llm: LLM = None) -> Agent | BrowserAgent:
155165
if isinstance(app, App):
156166
return Agent(app, llm)

0 commit comments

Comments
 (0)