@blaxel/vercel 0.2.10 → 0.2.11-dev.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/model.js +13 -2
  2. package/package.json +3 -2
package/dist/model.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.blModel = void 0;
4
4
  const anthropic_1 = require("@ai-sdk/anthropic");
5
5
  const cerebras_1 = require("@ai-sdk/cerebras");
6
+ const cohere_1 = require("@ai-sdk/cohere");
6
7
  const google_1 = require("@ai-sdk/google");
7
8
  const groq_1 = require("@ai-sdk/groq");
8
9
  const openai_1 = require("@ai-sdk/openai");
@@ -17,10 +18,13 @@ const blModel = async (model, options) => {
17
18
  const type = modelData?.spec?.runtime?.type || "openai";
18
19
  const modelId = modelData?.spec?.runtime?.model || "gpt-4o";
19
20
  try {
20
- if (type === "google") {
21
+ if (type === "gemini") {
21
22
  return (0, google_1.createGoogleGenerativeAI)({
22
23
  apiKey: core_1.settings.token,
23
- baseURL: `${url}/v1`,
24
+ headers: core_1.settings.headers,
25
+ fetch: (_, options) => {
26
+ return fetch(`${url}/v1beta/models/${modelId}:generateContent`, options);
27
+ },
24
28
  ...options,
25
29
  })(modelId);
26
30
  }
@@ -46,6 +50,13 @@ const blModel = async (model, options) => {
46
50
  ...options,
47
51
  })(modelId);
48
52
  }
53
+ else if (type === "cohere") {
54
+ return (0, cohere_1.createCohere)({
55
+ apiKey: core_1.settings.token,
56
+ baseURL: `${url}/v2`,
57
+ ...options,
58
+ })(modelId);
59
+ }
49
60
  return (0, openai_1.createOpenAI)({
50
61
  apiKey: core_1.settings.token,
51
62
  baseURL: `${url}/v1`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/vercel",
3
- "version": "0.2.10",
3
+ "version": "0.2.11-dev.88",
4
4
  "description": "Blaxel SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",
@@ -55,11 +55,12 @@
55
55
  "dependencies": {
56
56
  "@ai-sdk/anthropic": "^1.2.10",
57
57
  "@ai-sdk/cerebras": "^0.2.13",
58
+ "@ai-sdk/cohere": "^1.2.10",
58
59
  "@ai-sdk/google": "^1.2.14",
59
60
  "@ai-sdk/groq": "^1.2.8",
60
61
  "@ai-sdk/openai": "^1.3.21",
61
62
  "ai": "^4.3.13",
62
- "@blaxel/core": "0.2.10"
63
+ "@blaxel/core": "0.2.11-dev.88"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@eslint/js": "^9.26.0",