@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/cjs/model.js
CHANGED
|
@@ -51,12 +51,29 @@ const authenticatedFetch = () => {
|
|
|
51
51
|
return customFetch;
|
|
52
52
|
};
|
|
53
53
|
const blModel = async (model, options) => {
|
|
54
|
-
const url = `${core_1.settings.runUrl}/${core_1.settings.workspace}/models/${model}`;
|
|
55
54
|
const modelData = await (0, core_1.getModelMetadata)(model);
|
|
56
55
|
if (!modelData) {
|
|
57
56
|
throw new Error(`Model ${model} not found`);
|
|
58
57
|
}
|
|
59
58
|
await (0, core_1.authenticate)();
|
|
59
|
+
// mk3 models use the direct gateway URL and always speak OpenAI-compatible API
|
|
60
|
+
if (modelData.spec.runtime?.generation === "mk3") {
|
|
61
|
+
const gatewayUrl = modelData.metadata.url;
|
|
62
|
+
if (!gatewayUrl) {
|
|
63
|
+
throw new Error(`Model ${model} is mk3 but has no gateway URL in metadata`);
|
|
64
|
+
}
|
|
65
|
+
return new openai_1.ChatOpenAI({
|
|
66
|
+
apiKey: "replaced",
|
|
67
|
+
model: model,
|
|
68
|
+
configuration: {
|
|
69
|
+
baseURL: `${gatewayUrl}/v1`,
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
71
|
+
fetch: authenticatedFetch(),
|
|
72
|
+
},
|
|
73
|
+
...options,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const url = `${core_1.settings.runUrl}/${core_1.settings.workspace}/models/${model}`;
|
|
60
77
|
const type = modelData.spec.runtime?.type || "openai";
|
|
61
78
|
try {
|
|
62
79
|
if (type === "gemini") {
|