class_docstr: Numpy Ndarray
  
  Example:
  
  .. code-block:: python
  
      import typing as T
      from pydantic import BaseModel
      from towhee import AutoPipes, api_service
      from towhee.serve.io import TEXT, NDARRAY
  
      service = api_service.APIService(desc="Welcome")
      stn = AutoPipes.pipeline('sentence_embedding')
  
      @service.api(path='/embedding', input_model=TEXT(), output_model=NDARRAY())
      def chat(text: str):
          return stn(text).to_list()[0][0]
class_docstr_tok: ["Numpy","Ndarray","Example",":","..","code-block",":",":","python","import","typing","as","T","from","pydantic","import","BaseModel","from","towhee","import","AutoPipes",",","api_service","from","towhee.serve.io","import","TEXT",",","NDARRAY","service","=","api_service.APIService","(","desc=","''","Welcome","''",")","stn","=","AutoPipes.pipeline","(","'sentence_embedding","'",")","@","service.api","(","path='\/embedding","'",",","input_model=TEXT","(",")",",","output_model=NDARRAY","(",")",")","def","chat","(","text",":","str",")",":","return","stn","(","text",")",".to_list","(",")","[","0","]","[","0","]"]
code: def from_http(self, request: "fastapi.Request") -> "ndarray":
      json_str = asyncio.run(request.body())
      return from_json(json_str)
  
file_path: towhee/towhee/serve/io/ndarray_io.py
imports: import asyncio
  import numpy
  from .base import IOBase, IOType
  from towhee.utils.serializer import to_json, from_json
label_desc: Use image node_id 1 for calling the NDARRAY obj's underlying member method code with example usage: obj.from_http(request) and returns: from_json