Skip to content

Commit

Permalink
refactor(playground): Simplify execution API by removing graphUrl param
Browse files Browse the repository at this point in the history
Removes the graphUrl parameter from execution flow since it's now fetched
directly from the database using agentId. This simplifies the API and
prevents potential URL manipulation.

- Remove graphUrl parameter from ExecutionProvider interface
- Update execute function signature in page component
- Remove unnecessary graphUrl passing in execution context
  • Loading branch information
toyamarinyon committed Dec 11, 2024
1 parent 0186af0 commit cce94aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/(playground)/p/[agentId]/canary/contexts/execution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ interface ExecutionProviderProps {
children: ReactNode;
executeAction: (
artifactId: ArtifactId,
graphUrl: string,
nodeId: NodeId,
) => Promise<StreamableValue<TextArtifactObject, unknown>>;
}
Expand Down Expand Up @@ -56,9 +55,9 @@ export function ExecutionProvider({
},
});
setTab("Result");
const latestGraphUrl = await flush();
await flush();
try {
const stream = await executeAction(artifactId, latestGraphUrl, nodeId);
const stream = await executeAction(artifactId, nodeId);

let textArtifactObject: TextArtifactObject = {
type: "text",
Expand Down
6 changes: 1 addition & 5 deletions app/(playground)/p/[agentId]/canary/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ export default async function Page({
return agentName;
}

async function execute(
artifactId: ArtifactId,
graphUrl: string,
nodeId: NodeId,
) {
async function execute(artifactId: ArtifactId, nodeId: NodeId) {
"use server";
return await action(artifactId, agentId, nodeId);
}
Expand Down

0 comments on commit cce94aa

Please sign in to comment.