π What happened?
The agent does not know which inputs are required for a skill if they are passed as inputs to the skill constructor. It always passes an 'input', ignoring the defined ones.
I think this is the culprit, _in is being set to an empty object instead of the constructor argument inputs:
|
const _in: { [key: string]: ComponentInput } = {}; |
The inputs are recognized only if skill.in() method is used, but it still passes an extran input named input of string type for some reason.
π How to reproduce
import { Agent, Model } from "@smythos/sdk"
const agent = new Agent({
name: "Research Helper",
behavior:
"You are a research helper. Use the Web Search skill to get information for any question before answering.",
model: Model.Groq("openai/gpt-oss-20b"),
})
agent.addSkill({
name: "Web Search",
description: "Search the web for information",
inputs: {
searchQuery: {
type: "Text",
description: "The query to search the web for",
},
},
process: async (input) => {
const { searchQuery } = input
console.log(`Searching the web for ${searchQuery}`, input)
return `Search results for ${searchQuery}: Paris`
},
})
const chat = agent.chat()
const result = await chat.prompt("What is the capital of France?")
console.log(result)
Running the above code will result in something like:
Searching the web for undefined { input: 'capital of France' }
Searching the web for undefined { input: 'capital of France' }
...
Now update the above code with:
const skill = agent.addSkill({
name: "Web Search",
description: "Search the web for information",
inputs: {
searchQuery: {
type: "Text",
description: "The query to search the web for",
},
},
process: async (input) => {
const { searchQuery } = input
console.log(`Searching the web for ${searchQuery}`, input)
return `Search results for ${searchQuery}: Paris`
},
})
skill.in({
searchQuery: {
type: "Text",
description: "The query to search the web for",
},
})
Now the output would be something like:
Searching the web for capital of France { input: 'capital of France', searchQuery: 'capital of France' }
π» Code sample
π₯οΈ Environment
Package: @smythos/sdk 1.3.12
β
Checklist
π What happened?
The agent does not know which inputs are required for a skill if they are passed as
inputsto the skill constructor. It always passes an 'input', ignoring the defined ones.I think this is the culprit,
_inis being set to an empty object instead of the constructor argumentinputs:sre/packages/sdk/src/Components/Skill.ts
Line 55 in ececf70
The inputs are recognized only if
skill.in()method is used, but it still passes an extran input namedinputof string type for some reason.π How to reproduce
Running the above code will result in something like:
Now update the above code with:
Now the output would be something like:
π» Code sample
π₯οΈ Environment
Package: @smythos/sdk 1.3.12
β Checklist