Skip to content

Commit

Permalink
Merge pull request #28 from rajeshdavidbabu/main
Browse files Browse the repository at this point in the history
Use run-tools instead of run-functions as its deprecated
  • Loading branch information
lucgagan authored Jun 7, 2024
2 parents 9c19164 + d67719f commit 54c13ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/completeTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ export const completeTask = async (
const debug = task.options?.debug ?? defaultDebug;

const runner = openai.beta.chat.completions
.runFunctions({
.runTools({
model: task.options?.model ?? "gpt-4-1106-preview",
messages: [{ role: "user", content: prompt(task) }],
functions: Object.values(actions),
tools: Object.values(actions).map((action) => ({
type: "function",
function: action,
})),
})
.on("message", (message) => {
if (debug) {
Expand Down

0 comments on commit 54c13ff

Please sign in to comment.