vatsrahul1001 commented on code in PR #74380:
URL: https://github.com/apache/airflow/pull/74380#discussion_r4203151982


##########
providers/common/ai/src/airflow/providers/common/ai/toolsets/hook.py:
##########
@@ -181,6 +181,12 @@ async def get_tools(self, ctx: RunContext[Any]) -> 
dict[str, ToolsetTool[Any]]:
                 if param_name in json_schema.get("properties", {}):
                     json_schema["properties"][param_name]["description"] = 
param_desc
             _drop_properties(json_schema, self._pinned)
+            # The validator accepts the pinned names, with any value, so a 
model that sends one
+            # anyway is told it is fixed rather than given a generic 
extra-input or type error.
+            args_schema = {
+                **json_schema,
+                "properties": {**json_schema["properties"], 
**dict.fromkeys(self._pinned, {})},

Review Comment:
   nit: `dict.fromkeys(self._pinned, {})` points every pinned key at the same 
`{}` object. It's read only here so it's harmless, but `{name: {} for name in 
self._pinned}` reads a bit clearer about the intent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to