@dudko.dev/agent-web 0.0.39 → 0.0.40
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/README.md +117 -2
- package/dist/agent-web.js +1 -1
- package/dist/agent-web.js.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +112 -53
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.cts +18 -12
- package/dist/mcp.d.ts +18 -12
- package/dist/mcp.js +109 -50
- package/dist/mcp.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4058,12 +4058,16 @@ var decisionModelFromAiSdk = (model, options = {}) => {
|
|
|
4058
4058
|
decide: async (question, call) => {
|
|
4059
4059
|
const result = await experimental_decide({
|
|
4060
4060
|
model,
|
|
4061
|
-
state
|
|
4061
|
+
// The API refuses an empty state (Google's answers 400 "Missing text in content"), and a
|
|
4062
|
+
// question asked without a context is its own subject.
|
|
4063
|
+
state: question.context?.trim() ? question.context : question.prompt,
|
|
4062
4064
|
questions: {
|
|
4063
4065
|
[QUESTION_KEY]: {
|
|
4064
4066
|
type: "choice",
|
|
4065
4067
|
instructions: question.prompt,
|
|
4066
|
-
criteria: Object.fromEntries(
|
|
4068
|
+
criteria: Object.fromEntries(
|
|
4069
|
+
question.options.map((o) => [o.id, o.description?.trim() ? o.description : o.id])
|
|
4070
|
+
)
|
|
4067
4071
|
}
|
|
4068
4072
|
},
|
|
4069
4073
|
maxRetries: options.maxRetries ?? 0,
|