Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb6b17b2

Browse files
committed
Update gif_path for BrowserUse
1 parent05282ba commitb6b17b2

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

‎patchwork/steps/BrowserUse/BrowserUse.py‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ def __init__(self, inputs):
5050
api_key=self.inputs["anthropic_api_key"],
5151
)
5252

53-
gifs_base_path=os.path.join(os.path.dirname(__file__),"../../../tmp/gifs")
54-
ifnotos.path.exists(gifs_base_path):
55-
os.makedirs(gifs_base_path)
56-
5753
# Configure GIF generation for debugging/visualization
58-
self.generate_gif= (
59-
f"{gifs_base_path}/agent_history_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.gif"
60-
if ("generate_gif"inself.inputsandself.inputs["generate_gif"])
61-
or ("debug"inself.inputsandself.inputs["debug"])
54+
self.gif_path= (
55+
self.inputs.get("gif_path",None)
56+
if"gif_path"inself.inputs
57+
elseos.path.join(os.getcwd(),f"agent_history_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.gif")
58+
if ("debug"inself.inputsandself.inputs["debug"])
6259
elseFalse
6360
)
6461

@@ -91,7 +88,7 @@ def run(self) -> dict:
9188
controller=controller,
9289
task=mustache_render(self.inputs["task"],self.inputs["task_value"]),
9390
llm=self.llm,
94-
generate_gif=self.generate_gif,
91+
generate_gif=self.gif_path,
9592
validate_output=True,
9693
initial_actions=self.inputs.get("initial_actions",None),
9794
use_vision=self.inputs.get("use_vision",True),
@@ -117,7 +114,7 @@ def run(self) -> dict:
117114
return {
118115
"history":self.history,
119116
"result":self.history.final_result(),
120-
"generated_gif":self.generate_gif,
117+
"generated_gif":self.gif_path,
121118
}
122119

123120
def__format_history_as_json(self):

‎patchwork/steps/BrowserUse/typed.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BrowserUseInputs(__BrowserUseInputsRequired, total=False):
1313
openai_api_key:Annotated[str,StepTypeConfig(or_op=["google_api_key","anthropic_api_key"])]
1414
anthropic_api_key:Annotated[str,StepTypeConfig(or_op=["google_api_key","openai_api_key"])]
1515
google_api_key:Annotated[str,StepTypeConfig(or_op=["openai_api_key","anthropic_api_key"])]
16-
generate_gif:Optional[bool]
16+
gif_path:Optional[str]
1717
headless:Optional[bool]
1818
initial_actions:Optional[List[Dict[str,Dict[str,Any]]]]
1919
downloads_path:Optional[str]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp