Skip to content
Snippets Groups Projects
Commit d65397a0 authored by yisding's avatar yisding
Browse files

change example to 4-turbo

parent 8c725000
No related branches found
No related tags found
No related merge requests found
import { OpenAI } from "llamaindex"; import { OpenAI } from "llamaindex";
(async () => { (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 // complete api
const response1 = await llm.complete("How are you?"); const response1 = await llm.complete("How are you?");
...@@ -9,7 +9,7 @@ import { OpenAI } from "llamaindex"; ...@@ -9,7 +9,7 @@ import { OpenAI } from "llamaindex";
// chat api // chat api
const response2 = await llm.chat([ const response2 = await llm.chat([
{ content: "Tell me a joke!", role: "user" }, { content: "Tell me a joke.", role: "user" },
]); ]);
console.log(response2.message.content); console.log(response2.message.content);
})(); })();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment