# Define parameters used for required components

To integrate a YouTube document loader from LangChain into GenAI Stack, define a class and inherit the custom component. Each component necessitates a display name, description, and documentation URL that should be appropriately reflected on the user interface (UI).&#x20;

Inside the class, create a `build_config()` method to specify the parameters utilized by the component. In the context of integrating the YouTube loader, user input for the URL and the desired transcription language is essential. For these parameters, construct a Python dictionary and assign the display\_name, is\_list, required, and value as keys that will be updated on the UI. For instance, consider the URL as an example component.

* **display\_name** (str): The component's name, e.g., Video URL
* **is\_list** (bool): Indicates whether the required parameter is a list input
* **required** (bool): Specifies whether the input is mandatory
* **value** (str): The default value, which can be left empty or assigned a default value

These parameters will help define and communicate the necessary information for the YouTube loader within the UI. Once all the essential parameters are defined, utilize the `build(**kwargs)` method to instantiate the custom component with the specified configurations.<br>

```
class YoutubeLoaderComponent(CustomComponent):
    display_name: str = "Youtube Loader"
    description: str = "Downloads the YouTube transcripts and video information."
    documentation: str = (
        "https://python.langchain.com/docs/integrations/providers/youtube"
    )
    beta = False

    def build_config(self):
        return {
            "youtube_url": {
                "display_name": "Video URL",
                "is_list": False,
                "required": True,
                "value": "",
            },
            "language": {
                "display_name": "Language",
                "is_list": False,
                "required": True,
                "value": "en",
                "info": "language code to extract transcript. please check subtitles/cc to know available transcripts.",
            },
     }

    def build(self, youtube_url: str, language: str) -> List[Document]:
        loader_instance = YoutubeLoader.from_youtube_url(
            youtube_url=youtube_url, add_video_info=False, language=language
        )
        return loader_instance.load()


```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aiplanet.com/genai-stack-1/customization/define-parameters-used-for-required-components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
