forked from Skyvern-AI/skyvern
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add goto_page action handler and dev changes
new observer thoughts (Skyvern-AI#1442) add workflow run block screenshots (Skyvern-AI#1443) add workflow run block screenshot and observer thought screenshots (Skyvern-AI#1444) do not show metadata thought yet (Skyvern-AI#1445) chore: remove access keys from docker compose
- Loading branch information
1 parent
d03957d
commit d3414c9
Showing
24 changed files
with
891 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
alembic/versions/2024_12_27_1610-d13af1e466fa_new_observer_thoughts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""new observer thoughts | ||
Revision ID: d13af1e466fa | ||
Revises: 835522a23b19 | ||
Create Date: 2024-12-27 16:10:36.555540+00:00 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "d13af1e466fa" | ||
down_revision: Union[str, None] = "835522a23b19" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column("observer_thoughts", sa.Column("observer_thought_type", sa.String(), nullable=True)) | ||
op.add_column("observer_thoughts", sa.Column("observer_thought_scenario", sa.String(), nullable=True)) | ||
op.add_column("observer_thoughts", sa.Column("output", sa.JSON(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("observer_thoughts", "output") | ||
op.drop_column("observer_thoughts", "observer_thought_scenario") | ||
op.drop_column("observer_thoughts", "observer_thought_type") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunBlockScreenshot.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { getClient } from "@/api/AxiosClient"; | ||
import { ArtifactApiResponse, ArtifactType } from "@/api/types"; | ||
import { ZoomableImage } from "@/components/ZoomableImage"; | ||
import { useCredentialGetter } from "@/hooks/useCredentialGetter"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { ReloadIcon } from "@radix-ui/react-icons"; | ||
import { getImageURL } from "@/routes/tasks/detail/artifactUtils"; | ||
|
||
type Props = { | ||
workflowRunBlockId: string; | ||
}; | ||
|
||
function WorkflowRunBlockScreenshot({ workflowRunBlockId }: Props) { | ||
const credentialGetter = useCredentialGetter(); | ||
|
||
const { data: artifacts, isLoading } = useQuery<Array<ArtifactApiResponse>>({ | ||
queryKey: ["workflowRunBlock", workflowRunBlockId, "artifacts"], | ||
queryFn: async () => { | ||
const client = await getClient(credentialGetter); | ||
return client | ||
.get(`/workflow_run_block/${workflowRunBlockId}/artifacts`) | ||
.then((response) => response.data); | ||
}, | ||
refetchInterval: (query) => { | ||
const data = query.state.data; | ||
const screenshot = data?.filter( | ||
(artifact) => artifact.artifact_type === ArtifactType.LLMScreenshot, | ||
)?.[0]; | ||
if (!screenshot) { | ||
return 5000; | ||
} | ||
return false; | ||
}, | ||
}); | ||
|
||
const llmScreenshots = artifacts?.filter( | ||
(artifact) => artifact.artifact_type === ArtifactType.LLMScreenshot, | ||
); | ||
|
||
const screenshot = llmScreenshots?.[0]; | ||
|
||
if (isLoading) { | ||
return ( | ||
<div className="flex h-full items-center justify-center gap-2 bg-slate-elevation1"> | ||
<ReloadIcon className="h-6 w-6 animate-spin" /> | ||
<div>Loading screenshot...</div> | ||
</div> | ||
); | ||
} | ||
|
||
if (!screenshot) { | ||
return ( | ||
<div className="flex h-full items-center justify-center bg-slate-elevation1"> | ||
No screenshot found for this workflow run block. | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<figure className="mx-auto flex max-w-full flex-col items-center gap-2 overflow-hidden rounded"> | ||
<ZoomableImage src={getImageURL(screenshot)} alt="llm-screenshot" /> | ||
</figure> | ||
); | ||
} | ||
|
||
export { WorkflowRunBlockScreenshot }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
skyvern/forge/prompts/skyvern/observer_loop_task_extraction_goal.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The user is trying to achieve a goal the web. Now they've decided to go through a list of values and take the same tasks with each variant in the list. | ||
|
||
Help to user extract this list of values based on what they want to achieve: | ||
Help the user extract a list of values based on what they want to achieve: | ||
``` | ||
{{ plan }} | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.