code: def test_generator_endpoints_type_annotations(endpoint):
      class InputDocument(BaseDoc):
          input: str
          n: int
  
      class OutputDocument(BaseDoc):
          output: str
  
      class GeneratorExecutor(Executor):
          @requests(on="/task1", response_schema=OutputDocument)
          async def task1(self, doc: InputDocument, **kwargs):
              yield OutputDocument(text="hello world")
  
          @requests(on="/task2")
          async def task2(
              self, doc: InputDocument, **kwargs
          ) -> OutputDocument:
              yield OutputDocument(text="hello world")
  
          @requests(on="/task3")
          async def task3(
              self, doc: InputDocument, **kwargs
          ) -> Generator[OutputDocument, None, None]:
              yield OutputDocument(text="hello world")
  
          @requests(on="/task4")
          async def task4(
              self, doc: InputDocument, **kwargs
          ) -> AsyncGenerator[OutputDocument, None]:
              yield OutputDocument(text="hello world")
  
          @requests(on="/task5")
          async def task5(
              self, doc: InputDocument, **kwargs
          ) -> Iterator[OutputDocument]:
              yield OutputDocument(text="hello world")
  
          @requests(on="/task6")
          async def task6(
              self, doc: InputDocument, **kwargs
          ) -> AsyncIterator[OutputDocument]:
              yield OutputDocument(text="hello world")
  
      assert (
          GeneratorExecutor.requests_by_class["GeneratorExecutor"][
              f"/{endpoint}"
          ].request_schema
          == InputDocument
      )
      assert (
          GeneratorExecutor.requests_by_class["GeneratorExecutor"][
              f"/{endpoint}"
          ].response_schema
          == OutputDocument
      )
  
imports: import os
  import time
  from typing import Any, AsyncGenerator, AsyncIterator, Dict, Generator, Iterator, List, Optional, Union
  import numpy
  import pytest
  from docarray import BaseDoc, DocList
  from docarray.documents import ImageDoc, TextDoc
  from docarray.documents.legacy import LegacyDocument
  from docarray.typing import AnyTensor, ImageUrl, NdArray
  from jina import Client, Deployment, Executor, Flow, dynamic_batching, requests
  from jina.excepts import RuntimeFailToStart
  from jina.helper import random_port
  import uuid
label_desc: Use image node_id 5 for calling a global function with example usage: test_generator_endpoints_type_annotations(endpoint) without return types