Skip to content

Commit

Permalink
Revert "Fixing breaking changes"
Browse files Browse the repository at this point in the history
  • Loading branch information
lucgagan authored Jul 9, 2024
1 parent 5db16bc commit 9215b30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function runTask(
snapshot: await getSnapshot(page),
options: options
? {
model: options.model ?? "gpt-4o",
model: options.model ?? "gpt-4-1106-preview",
debug: options.debug ?? false,
openaiApiKey: options.openaiApiKey,
openaiBaseUrl: options.openaiBaseUrl,
Expand Down
8 changes: 3 additions & 5 deletions src/completeTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const completeTask = async (

const runner = openai.beta.chat.completions
.runTools({
model: task.options?.model ?? "gpt-4o",
model: task.options?.model ?? "gpt-4-1106-preview",
messages: [{ role: "user", content: prompt(task) }],
tools: Object.values(actions).map((action) => ({
type: "function",
Expand All @@ -39,11 +39,9 @@ export const completeTask = async (

if (
message.role === "assistant" &&
message.tool_calls &&
message.tool_calls.length > 0 &&
message.tool_calls[0].function.name.startsWith("result")
message.function_call?.name.startsWith("result")
) {
lastFunctionResult = JSON.parse(message.tool_calls[0].function.arguments);
lastFunctionResult = JSON.parse(message.function_call.arguments);
}
});

Expand Down

0 comments on commit 9215b30

Please sign in to comment.