mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-27 01:16:23 +02:00
fix rb ai gateway integration
This commit is contained in:
parent
8feb4f1425
commit
ab617e63b5
9 changed files with 165 additions and 81 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { ProviderV2 } from "@ai-sdk/provider";
|
||||
import { createGateway } from "ai";
|
||||
import { createOpenAI } from "@ai-sdk/openai";
|
||||
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
||||
import { createAnthropic } from "@ai-sdk/anthropic";
|
||||
|
|
@ -28,9 +29,9 @@ export async function getProvider(name: string = ""): Promise<ProviderV2> {
|
|||
const { apiKey, baseURL, headers } = providerConfig;
|
||||
switch (providerConfig.flavor) {
|
||||
case "rowboat [free]":
|
||||
providerMap[name] = createOpenAICompatible({
|
||||
name: "rowboat [free]",
|
||||
baseURL: "https://ai-gateway.rowboatlabs.com/v1",
|
||||
providerMap[name] = createGateway({
|
||||
apiKey: "rowboatx",
|
||||
baseURL: "https://ai-gateway.rowboatlabs.com/v1/ai",
|
||||
});
|
||||
break;
|
||||
case "openai":
|
||||
|
|
@ -40,6 +41,13 @@ export async function getProvider(name: string = ""): Promise<ProviderV2> {
|
|||
headers,
|
||||
});
|
||||
break;
|
||||
case "aigateway":
|
||||
providerMap[name] = createGateway({
|
||||
apiKey,
|
||||
baseURL,
|
||||
headers
|
||||
});
|
||||
break;
|
||||
case "anthropic":
|
||||
providerMap[name] = createAnthropic({
|
||||
apiKey,
|
||||
|
|
@ -65,7 +73,7 @@ export async function getProvider(name: string = ""): Promise<ProviderV2> {
|
|||
name,
|
||||
apiKey,
|
||||
baseURL : baseURL || "",
|
||||
headers
|
||||
headers,
|
||||
});
|
||||
break;
|
||||
case "openrouter":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue