From 63045b66f8fe92a3a2a8414b1aee580703d1fd91 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 28 Dec 2024 19:36:23 -0800 Subject: [PATCH] Update index.mdx --- docs/features/plugin/migration/index.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/features/plugin/migration/index.mdx b/docs/features/plugin/migration/index.mdx index c7f8907..0ba71dd 100644 --- a/docs/features/plugin/migration/index.mdx +++ b/docs/features/plugin/migration/index.mdx @@ -41,6 +41,21 @@ Choose the approach that best fits your use case! 4. **Updated Function Signatures.** - Function signatures now adhere to a new format, requiring a `request` object. + - The `request` object can be obtained using the `__request__` parameter in the function signature. Below is an example: + +```python +class Pipe: + def __init__(self): + pass + + async def pipe( + self, + body: dict, + __user__: dict, + __request__: Request, # New parameter + ) -> str: + # Write your function here +``` 📌 **Why did we make these changes?** - To simplify the codebase, making it easier to extend and maintain.