Skip to content

Commit

Permalink
Refactor poet tool to remove asynchronous call and return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Sep 19, 2024
1 parent 73a4a11 commit 726f6cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/sample/genaisrc/nested-poets.genai.mts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
defTool("poet", "Writes 4 line poems", {}, async () => {
const result = await prompt`Write a ${4} line poem`.options({
defTool("poet", "Writes 4 line poems", {}, () =>
prompt`Write a ${4} line poem`.options({
model: "openai:gpt-4o",
label: "Poem writer",
})
return result.text
})
)

script({
description: "Writes poems using the poet tool.",
Expand Down

0 comments on commit 726f6cb

Please sign in to comment.