| name | add-sdk-method |
| description | Use when adding a new method, function, or API endpoint to the SDK. Ensures consistent implementation across all SDKs (Python, TypeScript, Java, Rust CLI) with proper types, tests, and naming conventions. |
Add SDK Method
Adds a new method to all SDKs (Python, TypeScript, Java, Rust CLI) with consistent implementation.
Usage
/add-sdk-method <method-name> <description>
Checklist
-
Understand the Method
-
Python SDK (python/src/ai_sdk/)
-
TypeScript SDK (typescript/src/)
-
Java SDK (java/src/main/java/io/metadata/ai/)
-
Rust CLI (cli/src/)
-
Verify
Patterns to Follow
Python
async def new_method(self, param: str) -> ResponseModel:
"""Short description.
Args:
param: Description of param
Returns:
ResponseModel with the result
"""
response = await self._client._request("POST", f"/path/{param}")
return ResponseModel.model_validate(response)
TypeScript
async newMethod(param: string): Promise<ResponseModel> {
const response = await this.client.request('POST', `/path/${param}`);
return response as ResponseModel;
}
Java
public ResponseModel newMethod(String param) throws AISdkException {
return httpClient.post("/path/" + param, ResponseModel.class);
}
DO NOT
- Add method to only some SDKs (all must be updated)
- Skip tests
- Use different naming conventions across SDKs (camelCase in TS/Java, snake_case in Python/Rust)
- Add dependencies without justification