Skip to content

Commit

Permalink
compose everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuyz0112 committed Dec 21, 2023
1 parent 141951d commit 4045b1a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: denoland/setup-deno@v1
with:
deno-version: 1.38.3
- name: Dump Env
- name: generate UI
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: deno run -A prompts/ui-gen.ts
39 changes: 35 additions & 4 deletions prompts/ui-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,41 @@ async function main() {
issue,
pr
);
console.log({
prompt,
images,
});
const commitMsg = JSON.stringify(
{
prompt,
images,
},
null,
2
);
console.log(commitMsg);

const { code, usage } = await getCode(
[
{
role: "system",
content: systemPrompt,
},
{
role: "user",
content: prompt,
},
],
"gpt-4-vision-preview"
);
console.log(JSON.stringify(usage, null, 2));

await applyPR(
owner,
repo,
issue.number,
branch,
{
"preview-ui/src/Preview.jsx": code,
},
`${vxDevPrefix} prompt:\r\n${commitMsg}`
);
}

main();

0 comments on commit 4045b1a

Please sign in to comment.