AgentsSkillBase

update_skill_data

View as MarkdownOpen in Claude

Write this skill instance’s namespaced state into a FunctionResult via update_global_data().

Parameters

result
FunctionResultRequired

The FunctionResult to add the global_data update to.

data
dict[str, Any]Required

Skill state dictionary to store under the skill’s namespace.

Returns

FunctionResult — The result, for method chaining.

Example

1from signalwire import FunctionResult
2
3def _handle_increment(self, args, raw_data):
4 state = self.get_skill_data(raw_data)
5 count = state.get("count", 0) + 1
6 result = FunctionResult(f"Count is now {count}")
7 self.update_skill_data(result, {"count": count})
8 return result