class_docstr: Youtube List Comments  by video id Table implementation
class_docstr_tok: ["Youtube","List","Comments","by","video","id","Table","implementation"]
code: def insert_comment(
      self, text, video_id: str = None, comment_id: str = None
  ):
      # if comment_id is provided, define the request body for a reply and insert it
      if comment_id:
          request_body = {
              "snippet": {"parentId": comment_id, "textOriginal": text}
          }
  
          self.handler.connect().comments().insert(
              part="snippet", body=request_body
          ).execute()
  
      # else if video_id is provided, define the request body for a top-level comment and insert it
      elif video_id:
          request_body = {
              "snippet": {
                  "topLevelComment": {
                      "snippet": {
                          "videoId": video_id,
                          "textOriginal": text,
                      }
                  }
              }
          }
  
          self.handler.connect().commentThreads().insert(
              part="snippet", body=request_body
          ).execute()
  
imports: from typing import List
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.utilities import log
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.handlers.utilities.query_utilities import SELECTQueryParser, SELECTQueryExecutor, INSERTQueryParser
  import pandas
  import re
  from youtube_transcript_api import YouTubeTranscriptApi
  from youtube_transcript_api.formatters import JSONFormatter
label_desc: Use image node_id 3 for calling the YoutubeCommentsTable obj's underlying member method code with example usage: obj.insert_comment(text, video_id, comment_id) without return types