@ax-llm/ax 11.0.1 → 11.0.2
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/index.cjs +9 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +10 -2
- package/index.d.ts +10 -2
- package/index.js +9 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -6094,6 +6094,7 @@ var AxAgent = class {
|
|
|
6094
6094
|
program;
|
|
6095
6095
|
functions;
|
|
6096
6096
|
agents;
|
|
6097
|
+
disableSmartModelRouting;
|
|
6097
6098
|
name;
|
|
6098
6099
|
description;
|
|
6099
6100
|
subAgentList;
|
|
@@ -6109,6 +6110,7 @@ var AxAgent = class {
|
|
|
6109
6110
|
this.ai = ai;
|
|
6110
6111
|
this.agents = agents;
|
|
6111
6112
|
this.functions = functions;
|
|
6113
|
+
this.disableSmartModelRouting = options?.disableSmartModelRouting;
|
|
6112
6114
|
this.signature = new AxSignature(signature);
|
|
6113
6115
|
this.signature.setDescription(description);
|
|
6114
6116
|
if (!name || name.length < 5) {
|
|
@@ -6135,7 +6137,7 @@ var AxAgent = class {
|
|
|
6135
6137
|
func: () => this.forward
|
|
6136
6138
|
};
|
|
6137
6139
|
const mm = ai?.getModelList();
|
|
6138
|
-
if (mm) {
|
|
6140
|
+
if (mm && !this.disableSmartModelRouting) {
|
|
6139
6141
|
this.func.parameters = addModelParameter(this.func.parameters, mm);
|
|
6140
6142
|
}
|
|
6141
6143
|
}
|
|
@@ -6175,11 +6177,16 @@ var AxAgent = class {
|
|
|
6175
6177
|
func: wrappedFunc
|
|
6176
6178
|
};
|
|
6177
6179
|
}
|
|
6180
|
+
getFeatures() {
|
|
6181
|
+
return {
|
|
6182
|
+
canConfigureSmartModelRouting: this.ai !== void 0
|
|
6183
|
+
};
|
|
6184
|
+
}
|
|
6178
6185
|
init(parentAi, options) {
|
|
6179
6186
|
const ai = this.ai ?? parentAi;
|
|
6180
6187
|
const mm = ai?.getModelList();
|
|
6181
6188
|
const agentFuncs = this.agents?.map((a) => a.getFunction())?.map(
|
|
6182
|
-
(f) => mm ? { ...f, parameters: addModelParameter(f.parameters, mm) } : f
|
|
6189
|
+
(f) => mm && !this.disableSmartModelRouting && this.agents?.find((a) => a.getFunction().name === f.name)?.getFeatures().canConfigureSmartModelRouting ? { ...f, parameters: addModelParameter(f.parameters, mm) } : f
|
|
6183
6190
|
);
|
|
6184
6191
|
const functions = [
|
|
6185
6192
|
...options?.functions ?? this.functions ?? [],
|