@blaxel/langgraph 0.2.64 → 0.2.65-preview.78
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/model.js +18 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/model.js +18 -1
- package/package.json +2 -2
package/dist/esm/model.js
CHANGED
|
@@ -48,12 +48,29 @@ const authenticatedFetch = () => {
|
|
|
48
48
|
return customFetch;
|
|
49
49
|
};
|
|
50
50
|
export const blModel = async (model, options) => {
|
|
51
|
-
const url = `${settings.runUrl}/${settings.workspace}/models/${model}`;
|
|
52
51
|
const modelData = await getModelMetadata(model);
|
|
53
52
|
if (!modelData) {
|
|
54
53
|
throw new Error(`Model ${model} not found`);
|
|
55
54
|
}
|
|
56
55
|
await authenticate();
|
|
56
|
+
// mk3 models use the direct gateway URL and always speak OpenAI-compatible API
|
|
57
|
+
if (modelData.spec.runtime?.generation === "mk3") {
|
|
58
|
+
const gatewayUrl = modelData.metadata.url;
|
|
59
|
+
if (!gatewayUrl) {
|
|
60
|
+
throw new Error(`Model ${model} is mk3 but has no gateway URL in metadata`);
|
|
61
|
+
}
|
|
62
|
+
return new ChatOpenAI({
|
|
63
|
+
apiKey: "replaced",
|
|
64
|
+
model: model,
|
|
65
|
+
configuration: {
|
|
66
|
+
baseURL: `${gatewayUrl}/v1`,
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
68
|
+
fetch: authenticatedFetch(),
|
|
69
|
+
},
|
|
70
|
+
...options,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const url = `${settings.runUrl}/${settings.workspace}/models/${model}`;
|
|
57
74
|
const type = modelData.spec.runtime?.type || "openai";
|
|
58
75
|
try {
|
|
59
76
|
if (type === "gemini") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/langgraph",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.65-preview.78",
|
|
4
4
|
"description": "Blaxel SDK for TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blaxel, INC (https://blaxel.ai)",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dist"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@blaxel/core": "0.2.
|
|
52
|
+
"@blaxel/core": "0.2.65-preview.78",
|
|
53
53
|
"@google/generative-ai": "^0.24.1",
|
|
54
54
|
"@langchain/anthropic": "^1.1.1",
|
|
55
55
|
"@langchain/cohere": "^1.0.0",
|