-
Notifications
You must be signed in to change notification settings - Fork 1.3k
operator handler #586
New issue
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
operator handler #586
Conversation
🦋 Changeset detectedLatest commit: f2acb14 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
kamath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code generally lgtm from reviewing on my phone, will review properly later
lib/handlers/operatorHandler.ts
Outdated
| private stagehandPage: StagehandPage; | ||
| private logger: (message: LogLine) => void; | ||
| private llmClient: LLMClient; | ||
| messages: ChatMessage[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a fast follow PR, let's use stagehand.history here
miguelg719
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great
| }, | ||
| { | ||
| type: "image_url", | ||
| image_url: { url: `data:image/png;base64,${base64Image}` }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anthropic's format:
messages: [
{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "base64",
"media_type": image_media_type,
"data": image_data,
},
},
...* operator handler * changeset * Update young-dots-fry.md * better task memory & cleaner code * provide extraction result in reasoning * remove action log * make agent config optional * increase max steps * update close logic * add operator example * made handler messages private * update operator (#596) --------- Co-authored-by: Anirudh Kamath <[email protected]>
why
Naturally, we want to provide an agent that uses Staghand's native capabilities. This PR adds a default agent that doesn't utilize computer-use models.
what changed
Added a
StagehandOperatorHandlerclass which provides the logic for action planning and execution.test plan
E2E
TODO
types.AgentResult["message"]field.