@mozaik-ai/core 4.0.4 → 4.0.6
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ var ModelContext = class _ModelContext {
|
|
|
11
11
|
this.items.push(...contextItems);
|
|
12
12
|
return this;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
addContextItem(item) {
|
|
15
15
|
this.items.push(item);
|
|
16
16
|
return this;
|
|
17
17
|
}
|
|
@@ -401,7 +401,7 @@ var Agent = class _Agent extends Participant {
|
|
|
401
401
|
const memory = Memory.create();
|
|
402
402
|
const manifest = { id, name, capabilities, role: "agent" };
|
|
403
403
|
const developerMessage = DeveloperMessageItem.create(instruction);
|
|
404
|
-
memory.getContext().
|
|
404
|
+
memory.getContext().addContextItem(developerMessage);
|
|
405
405
|
return new _Agent(manifest, instruction, tools, memory, handlers);
|
|
406
406
|
}
|
|
407
407
|
getTools() {
|
|
@@ -771,6 +771,7 @@ var InferenceToModelMessageRule = class {
|
|
|
771
771
|
if (!modelMessageItem) {
|
|
772
772
|
throw new Error("Expected inference model-message output");
|
|
773
773
|
}
|
|
774
|
+
execution.input.context.addContextItem(modelMessageItem);
|
|
774
775
|
return {
|
|
775
776
|
nextStateId: "model_message",
|
|
776
777
|
input: {
|
|
@@ -2088,7 +2089,10 @@ var DefaultFunctionCallRunner = class {
|
|
|
2088
2089
|
async run(input, tool) {
|
|
2089
2090
|
try {
|
|
2090
2091
|
const result = await tool.invoke(JSON.parse(input.args));
|
|
2091
|
-
return FunctionCallOutputItem.create(
|
|
2092
|
+
return FunctionCallOutputItem.create(
|
|
2093
|
+
input.callId,
|
|
2094
|
+
typeof result === "string" ? result : JSON.stringify(result)
|
|
2095
|
+
);
|
|
2092
2096
|
} catch (error) {
|
|
2093
2097
|
return FunctionCallOutputItem.create(input.callId, `Error calling tool: ${error}`);
|
|
2094
2098
|
}
|