@cognipeer/agent-sdk 0.8.8 → 0.8.9
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.cjs +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2481,6 +2481,8 @@ declare class StructuredOutputManager<T> {
|
|
|
2481
2481
|
/**
|
|
2482
2482
|
* Build a nudge message for when the model didn't produce structured output.
|
|
2483
2483
|
* Used by the agent loop when it needs to retry.
|
|
2484
|
+
* User role is intentional: OpenAI-compatible chat templates such as Qwen
|
|
2485
|
+
* reject system messages anywhere except the beginning of the conversation.
|
|
2484
2486
|
*/
|
|
2485
2487
|
buildNudgeMessage(isLastAttempt: boolean): {
|
|
2486
2488
|
role: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2481,6 +2481,8 @@ declare class StructuredOutputManager<T> {
|
|
|
2481
2481
|
/**
|
|
2482
2482
|
* Build a nudge message for when the model didn't produce structured output.
|
|
2483
2483
|
* Used by the agent loop when it needs to retry.
|
|
2484
|
+
* User role is intentional: OpenAI-compatible chat templates such as Qwen
|
|
2485
|
+
* reject system messages anywhere except the beginning of the conversation.
|
|
2484
2486
|
*/
|
|
2485
2487
|
buildNudgeMessage(isLastAttempt: boolean): {
|
|
2486
2488
|
role: string;
|
package/dist/index.mjs
CHANGED
|
@@ -4875,11 +4875,13 @@ var StructuredOutputManager = class {
|
|
|
4875
4875
|
/**
|
|
4876
4876
|
* Build a nudge message for when the model didn't produce structured output.
|
|
4877
4877
|
* Used by the agent loop when it needs to retry.
|
|
4878
|
+
* User role is intentional: OpenAI-compatible chat templates such as Qwen
|
|
4879
|
+
* reject system messages anywhere except the beginning of the conversation.
|
|
4878
4880
|
*/
|
|
4879
4881
|
buildNudgeMessage(isLastAttempt) {
|
|
4880
4882
|
if (this.strategy.kind === "native") {
|
|
4881
4883
|
return {
|
|
4882
|
-
role: "
|
|
4884
|
+
role: "user",
|
|
4883
4885
|
content: [
|
|
4884
4886
|
"A structured output schema is active.",
|
|
4885
4887
|
"You MUST respond with valid JSON matching the schema.",
|
|
@@ -4889,7 +4891,7 @@ var StructuredOutputManager = class {
|
|
|
4889
4891
|
};
|
|
4890
4892
|
}
|
|
4891
4893
|
return {
|
|
4892
|
-
role: "
|
|
4894
|
+
role: "user",
|
|
4893
4895
|
content: [
|
|
4894
4896
|
"A structured output schema is active.",
|
|
4895
4897
|
"You MUST now call tool `response` with the final JSON object that matches the schema.",
|
|
@@ -4907,7 +4909,7 @@ var StructuredOutputManager = class {
|
|
|
4907
4909
|
const fieldIssues = error.fieldErrors.map((f) => `- "${f.path}": ${f.message} (received: ${JSON.stringify(f.received)})`).join("\n");
|
|
4908
4910
|
const action = this.strategy.kind === "native" ? "Please output corrected JSON matching the schema." : "Please call `response` again with corrected values matching the schema.";
|
|
4909
4911
|
return {
|
|
4910
|
-
role: "
|
|
4912
|
+
role: "user",
|
|
4911
4913
|
content: [
|
|
4912
4914
|
"Your previous structured output had validation errors:",
|
|
4913
4915
|
fieldIssues,
|