Skip to content

Commit 18625cf

Browse files
Update custom_views.py
1 parent a6813aa commit 18625cf

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/agent/custom_views.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
from dataclasses import dataclass
88
from typing import Type
9-
from pydantic import BaseModel, ConfigDict, Field, ValidationError, create_model
10-
from browser_use.controller.registry.views import ActionModel
9+
1110
from browser_use.agent.views import AgentOutput
11+
from browser_use.controller.registry.views import ActionModel
12+
from pydantic import BaseModel, ConfigDict, Field, create_model
1213

1314

1415
@dataclass
@@ -43,11 +44,16 @@ class CustomAgentOutput(AgentOutput):
4344
action: list[ActionModel]
4445

4546
@staticmethod
46-
def type_with_custom_actions(custom_actions: Type[ActionModel]) -> Type['CustomAgentOutput']:
47+
def type_with_custom_actions(
48+
custom_actions: Type[ActionModel],
49+
) -> Type["CustomAgentOutput"]:
4750
"""Extend actions with custom actions"""
4851
return create_model(
49-
'AgentOutput',
52+
"AgentOutput",
5053
__base__=CustomAgentOutput,
51-
action=(list[custom_actions], Field(...)), # Properly annotated field with no default
54+
action=(
55+
list[custom_actions],
56+
Field(...),
57+
), # Properly annotated field with no default
5258
__module__=CustomAgentOutput.__module__,
5359
)

0 commit comments

Comments
 (0)