aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-07-04 11:13:38 -0500
committerDhravya <[email protected]>2024-07-04 11:13:38 -0500
commit7f76aa31354003f62fd0754fa89541ae56255c99 (patch)
treed226e04d148c51e05c01c8b44212bbf1eeab602c /apps
parentmerged (diff)
downloadsupermemory-7f76aa31354003f62fd0754fa89541ae56255c99.tar.xz
supermemory-7f76aa31354003f62fd0754fa89541ae56255c99.zip
use cloudflare AI gateway
Diffstat (limited to 'apps')
-rw-r--r--apps/cf-ai-backend/src/helper.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/cf-ai-backend/src/helper.ts b/apps/cf-ai-backend/src/helper.ts
index 44dba383..db3ab2d3 100644
--- a/apps/cf-ai-backend/src/helper.ts
+++ b/apps/cf-ai-backend/src/helper.ts
@@ -30,6 +30,8 @@ export async function initQuery(
case "claude-3-opus":
const anthropic = createAnthropic({
apiKey: c.env.ANTHROPIC_API_KEY,
+ baseURL:
+ "https://gateway.ai.cloudflare.com/v1/47c2b4d598af9d423c06fc9f936226d5/supermemory/anthropic",
});
selectedModel = anthropic.chat("claude-3-opus-20240229");
console.log("Selected model: ", selectedModel);
@@ -37,6 +39,8 @@ export async function initQuery(
case "gemini-1.5-pro":
const googleai = createGoogleGenerativeAI({
apiKey: c.env.GOOGLE_AI_API_KEY,
+ baseURL:
+ "https://gateway.ai.cloudflare.com/v1/47c2b4d598af9d423c06fc9f936226d5/supermemory/google-vertex-ai",
});
selectedModel = googleai.chat("models/gemini-1.5-pro-latest");
console.log("Selected model: ", selectedModel);
@@ -45,6 +49,8 @@ export async function initQuery(
default:
const openai = createOpenAI({
apiKey: c.env.OPENAI_API_KEY,
+ baseURL:
+ "https://gateway.ai.cloudflare.com/v1/47c2b4d598af9d423c06fc9f936226d5/supermemory/openai",
});
selectedModel = openai.chat("gpt-4o");
break;