mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-06 12:26:26 +00:00
Add Gemini option
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
function getChatCompletionsUrl(baseURL) {
|
||||
const root = (baseURL || "https://api.openai.com/v1").replace(/\/+$/, "");
|
||||
return `${root}/chat/completions`;
|
||||
}
|
||||
|
||||
export async function chat({ apiKey, model, messages, tools }) {
|
||||
const res = await fetch("https://api.openai.com/v1/chat/completions", {
|
||||
export async function chat({ apiKey, baseURL, model, messages, tools }) {
|
||||
const res = await fetch(getChatCompletionsUrl(baseURL), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user