open-agents-ai 0.135.0 → 0.136.0
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/index.js +35 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33396,6 +33396,9 @@ ${activitySummary}
|
|
|
33396
33396
|
|
|
33397
33397
|
// packages/cli/dist/tui/model-picker.js
|
|
33398
33398
|
import { totalmem as totalmem2 } from "node:os";
|
|
33399
|
+
function isImageGenModel(name, family) {
|
|
33400
|
+
return IMAGE_GEN_PATTERNS.some((p) => p.test(name) || family && p.test(family));
|
|
33401
|
+
}
|
|
33399
33402
|
async function fetchOllamaModels(baseUrl) {
|
|
33400
33403
|
const url = `${normalizeBaseUrl(baseUrl)}/api/tags`;
|
|
33401
33404
|
const resp = await fetch(url, {
|
|
@@ -33406,15 +33409,20 @@ async function fetchOllamaModels(baseUrl) {
|
|
|
33406
33409
|
}
|
|
33407
33410
|
const data = await resp.json();
|
|
33408
33411
|
const models = data.models ?? [];
|
|
33409
|
-
const result = models.map((m) =>
|
|
33410
|
-
|
|
33411
|
-
|
|
33412
|
-
|
|
33413
|
-
|
|
33414
|
-
|
|
33415
|
-
|
|
33416
|
-
|
|
33417
|
-
|
|
33412
|
+
const result = models.map((m) => {
|
|
33413
|
+
const family = m.details?.family;
|
|
33414
|
+
return {
|
|
33415
|
+
name: m.name,
|
|
33416
|
+
size: formatBytes(m.size),
|
|
33417
|
+
sizeBytes: m.size,
|
|
33418
|
+
modified: formatRelativeTime(m.modified_at),
|
|
33419
|
+
parameterSize: m.details?.parameter_size,
|
|
33420
|
+
contextLength: void 0,
|
|
33421
|
+
caps: void 0,
|
|
33422
|
+
isImageGen: isImageGenModel(m.name, family),
|
|
33423
|
+
family
|
|
33424
|
+
};
|
|
33425
|
+
}).sort((a, b) => b.sizeBytes - a.sizeBytes);
|
|
33418
33426
|
const normalized = normalizeBaseUrl(baseUrl);
|
|
33419
33427
|
const showResults = await Promise.allSettled(result.map((m) => fetch(`${normalized}/api/show`, {
|
|
33420
33428
|
method: "POST",
|
|
@@ -33914,10 +33922,21 @@ function formatRelativeTime(iso) {
|
|
|
33914
33922
|
const months = Math.floor(days / 30);
|
|
33915
33923
|
return `${months}mo ago`;
|
|
33916
33924
|
}
|
|
33925
|
+
var IMAGE_GEN_PATTERNS;
|
|
33917
33926
|
var init_model_picker = __esm({
|
|
33918
33927
|
"packages/cli/dist/tui/model-picker.js"() {
|
|
33919
33928
|
"use strict";
|
|
33920
33929
|
init_dist();
|
|
33930
|
+
IMAGE_GEN_PATTERNS = [
|
|
33931
|
+
/flux/i,
|
|
33932
|
+
/z-image/i,
|
|
33933
|
+
/stable-diffusion/i,
|
|
33934
|
+
/sdxl/i,
|
|
33935
|
+
/dall/i,
|
|
33936
|
+
/kandinsky/i,
|
|
33937
|
+
/midjourney/i,
|
|
33938
|
+
/imagen/i
|
|
33939
|
+
];
|
|
33921
33940
|
}
|
|
33922
33941
|
});
|
|
33923
33942
|
|
|
@@ -42692,6 +42711,13 @@ async function switchModel(query, ctx, local = false) {
|
|
|
42692
42711
|
return;
|
|
42693
42712
|
}
|
|
42694
42713
|
}
|
|
42714
|
+
if (match.isImageGen || isImageGenModel(match.name, match.family)) {
|
|
42715
|
+
renderWarning(`"${match.name}" is an image generation model, not a chat/code model.`);
|
|
42716
|
+
renderInfo("Image gen models use /api/generate with width/height/steps parameters.");
|
|
42717
|
+
renderInfo("They cannot be used as the primary chat backend for tool-calling tasks.");
|
|
42718
|
+
renderInfo("Use a text model instead (e.g., qwen3.5, nemotron, devstral).");
|
|
42719
|
+
return;
|
|
42720
|
+
}
|
|
42695
42721
|
let finalModel = match.name;
|
|
42696
42722
|
if (ctx.config.backendType === "ollama") {
|
|
42697
42723
|
const result = await ensureExpandedContext(match.name, ctx.config.backendUrl);
|
package/package.json
CHANGED