Repository: gradio-app/gradio

Issue:
Add gr.update to docs
- [x] I have searched to see if a similar issue already exists.


**Is your feature request related to a problem? Please describe.**  
As a gradio user, I wish the `gr.update` function was documented on the website. It would be most helpful if the documentation explained the difference between the standalone function and the `update` class method. 

**Describe the solution you'd like**  
A clear and concise description of what you want to happen.

**Additional context**  
Add any other context or screenshots about the feature request here.



Discussion:

Resolving patch:
diff --git a/demo/blocks_essay_update/run.py b/demo/blocks_essay_update/run.py
new file mode 100644
--- /dev/null
+++ b/demo/blocks_essay_update/run.py
@@ -0,0 +1,23 @@
+import gradio as gr
+
+
+def change_textbox(choice):
+    if choice == "short":
+        return gr.update(lines=2, visible=True)
+    elif choice == "long":
+        return gr.update(lines=8, visible=True)
+    else:
+        return gr.update(visible=False)
+
+
+with gr.Blocks() as demo:
+    radio = gr.Radio(
+        ["short", "long", "none"], label="What kind of essay would you like to write?"
+    )
+    text = gr.Textbox(lines=2, interactive=True)
+
+    radio.change(fn=change_textbox, inputs=radio, outputs=text)
+
+
+if __name__ == "__main__":
+    demo.launch()
\ No newline at end of file
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -192,11 +192,24 @@ def __get__(self, instance, type_):
         return descr_get(instance, type_)
 
 
+@document()
 def update(**kwargs) -> dict:
     """
-    Updates component parameters
-    @param kwargs: Updating component parameters
-    @return: Updated component parameters
+    Updates component parameters.
+    This is a shorthand for using the update method on a component.
+    For example, rather than using gr.Number.update(...) you can just use gr.update(...).
+
+    Demos: blocks_update, blocks_essay_update
+
+    Parameters:
+        kwargs: Key-word arguments used to update the component's properties.
+    Example:
+        import gradio as gr
+        with gr.Blocks() as demo:
+            radio = gr.Radio([1, 2, 4], label="Set the value of the number")
+            number = gr.Number(value=2, interactive=True)
+            radio.change(fn=lambda value: gr.update(value=value), inputs=radio, outputs=number)
+        demo.launch()
     """
     kwargs["__type__"] = "generic_update"
     return kwargs
diff --git a/gradio/documentation.py b/gradio/documentation.py
--- a/gradio/documentation.py
+++ b/gradio/documentation.py
@@ -57,7 +57,9 @@ def document_fn(fn):
     description_doc = " ".join(description)
     parameter_docs = []
     for param_name, param in signature.parameters.items():
-        if param_name.startswith("_") or param_name == "kwargs":
+        if param_name.startswith("_"):
+            continue
+        if param_name == "kwargs" and param_name not in parameters:
             continue
         parameter_doc = {
             "name": param_name,
@@ -128,7 +130,8 @@ def generate_documentation():
     for mode, class_list in classes_to_document.items():
         documentation[mode] = []
         for cls, fns in class_list:
-            _, parameter_doc, return_doc, _ = document_fn(cls.__init__)
+            fn_to_document = cls if inspect.isfunction(cls) else cls.__init__
+            _, parameter_doc, return_doc, _ = document_fn(fn_to_document)
             cls_description, cls_tags, cls_example = document_cls(cls)
             cls_documentation = {
                 "class": cls,


Test patch: