@blaxel/vercel 0.2.10 → 0.2.11-dev.89

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.
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/dist/tools.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { Tool } from "ai";
2
- export declare const blTool: (name: string) => Promise<Record<string, Tool>>;
3
- export declare const blTools: (names: string[]) => Promise<Record<string, Tool>>;
2
+ export declare const blTool: (name: string, ms?: number) => Promise<Record<string, Tool>>;
3
+ export declare const blTools: (names: string[], ms?: number) => Promise<Record<string, Tool>>;
package/dist/tools.js CHANGED
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.blTools = exports.blTool = void 0;
4
4
  const core_1 = require("@blaxel/core");
5
5
  const ai_1 = require("ai");
6
- const blTool = async (name) => {
6
+ const blTool = async (name, ms) => {
7
7
  try {
8
8
  const toolFormated = {};
9
- const blaxelTool = await (0, core_1.getTool)(name);
9
+ const blaxelTool = await (0, core_1.getTool)(name, ms);
10
10
  for (const t of blaxelTool) {
11
11
  const toolInstance = (0, ai_1.tool)({
12
12
  description: t.description,
@@ -23,8 +23,8 @@ const blTool = async (name) => {
23
23
  }
24
24
  };
25
25
  exports.blTool = blTool;
26
- const blTools = async (names) => {
27
- const toolArrays = await Promise.all(names.map(exports.blTool));
26
+ const blTools = async (names, ms) => {
27
+ const toolArrays = await Promise.all(names.map((n) => (0, exports.blTool)(n, ms)));
28
28
  const toolFormated = {};
29
29
  for (const toolServer of toolArrays) {
30
30
  for (const toolName in toolServer) {
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.89",
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.89"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@eslint/js": "^9.26.0",