diff options
| author | Dhravya <[email protected]> | 2024-07-04 11:13:38 -0500 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-07-04 11:13:38 -0500 |
| commit | 7f76aa31354003f62fd0754fa89541ae56255c99 (patch) | |
| tree | d226e04d148c51e05c01c8b44212bbf1eeab602c /apps | |
| parent | merged (diff) | |
| download | supermemory-7f76aa31354003f62fd0754fa89541ae56255c99.tar.xz supermemory-7f76aa31354003f62fd0754fa89541ae56255c99.zip | |
use cloudflare AI gateway
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/cf-ai-backend/src/helper.ts | 6 |
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; |