Skip to content

Commit

Permalink
change example to 4-turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
yisding committed Nov 6, 2023
1 parent 8c72500 commit d65397a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/openai.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { OpenAI } from "llamaindex";

(async () => {
const llm = new OpenAI({ model: "gpt-3.5-turbo-1106", temperature: 0.1 });
const llm = new OpenAI({ model: "gpt-4-1106-preview", temperature: 0.1 });

// complete api
const response1 = await llm.complete("How are you?");
console.log(response1.message.content);

// chat api
const response2 = await llm.chat([
{ content: "Tell me a joke!", role: "user" },
{ content: "Tell me a joke.", role: "user" },
]);
console.log(response2.message.content);
})();

0 comments on commit d65397a

Please sign in to comment.