Skip to content

Commit a53f363

Browse files
committed
add annotations false
1 parent 81b88da commit a53f363

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

build-all.mts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,5 @@ for (const name of builtNames) {
185185
`;
186186
fs.writeFileSync(hashedHtmlPath, html, { encoding: "utf8" });
187187
fs.writeFileSync(liveHtmlPath, html, { encoding: "utf8" });
188-
console.log(`${hashedHtmlPath} (generated live HTML)`);
189-
console.log(`${liveHtmlPath} (generated live HTML)`);
188+
console.log(`${liveHtmlPath}`);
190189
}

pizzaz_server_node/src/server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ const tools: Tool[] = widgets.map((widget) => ({
153153
inputSchema: toolInputSchema,
154154
title: widget.title,
155155
_meta: widgetMeta(widget),
156+
// To disable the approval prompt for the widgets
157+
annotations: {
158+
destructiveHint: false,
159+
openWorldHint: false,
160+
readOnlyHint: true,
161+
},
156162
}));
157163

158164
const resources: Resource[] = widgets.map((widget) => ({

pizzaz_server_python/main.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,7 @@ def _tool_meta(widget: PizzazWidget) -> Dict[str, Any]:
138138
"openai/toolInvocation/invoking": widget.invoking,
139139
"openai/toolInvocation/invoked": widget.invoked,
140140
"openai/widgetAccessible": True,
141-
"openai/resultCanProduceWidget": True,
142-
"annotations": {
143-
"destructiveHint": False,
144-
"openWorldHint": False,
145-
"readOnlyHint": True,
146-
}
141+
"openai/resultCanProduceWidget": True
147142
}
148143

149144

@@ -168,6 +163,12 @@ async def _list_tools() -> List[types.Tool]:
168163
description=widget.title,
169164
inputSchema=deepcopy(TOOL_INPUT_SCHEMA),
170165
_meta=_tool_meta(widget),
166+
# To disable the approval prompt for the tools
167+
annotations={
168+
"destructiveHint": False,
169+
"openWorldHint": False,
170+
"readOnlyHint": True,
171+
},
171172
)
172173
for widget in widgets
173174
]
@@ -276,7 +277,7 @@ async def _call_tool_request(req: types.CallToolRequest) -> types.ServerResult:
276277
)
277278
],
278279
structuredContent={"pizzaTopping": topping},
279-
_meta=meta,
280+
_meta=meta
280281
)
281282
)
282283

0 commit comments

Comments
 (0)