chore: import upstream snapshot with attribution
Validate YAML Workflows / Validate YAML Configuration Files (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:37:51 +08:00
commit d0e4308def
614 changed files with 74458 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
"""Provider-agnostic tool specification dataclasses."""
from dataclasses import dataclass, field
from typing import Any, Dict
@dataclass
class ToolSpec:
"""Generic representation of a callable tool."""
name: str
description: str = ""
parameters: Dict[str, Any] = field(default_factory=dict)
metadata: Dict[str, Any] = field(default_factory=dict)
def to_openai_dict(self) -> Dict[str, Any]:
"""Convert to OpenAI Responses API function schema."""
return {
"type": "function",
"name": self.name,
"description": self.description,
"parameters": self.parameters or {"type": "object", "properties": {}},
}
def to_gemini_function(self) -> Dict[str, Any]:
"""Convert to Gemini FunctionDeclaration schema."""
return {
"name": self.name,
"description": self.description,
"parameters": self.parameters or {"type": "object", "properties": {}},
}