Ejemplo n.º 1
0
    def find_id(self, image_id=None):
        """Retrieve image by ID or custom ID

        Args:
            image_id (int): Image's ID or custom ID which is you were assigned

        Returns:

        """

        return Connector(self.token, model_type="images", path="projects/images/").send(
            method='GET',
            doc_id=image_id)
Ejemplo n.º 2
0
    def list(self, params=None):
        """Retrieve list of conversation

        Args:
            page (int): Page of data
            per_page (int): Limit of date per page

        Returns:
            dict: The value containt in Response class as dict

         """

        return Connector(self.token, model_type='texts', path='text/text_categories/').send(method='GET', data=params)
Ejemplo n.º 3
0
    def find_id(self, image_id=None):
        """Retrieve image by ID or custom ID

        Args:
            image_id (int): Text's ID or custom ID which is you were assigned

        Returns:
            dict: The value containt in Response class as dict

        """
        return Connector(self.token, model_type="ai",
                         path="projects/images/").send(method='GET',
                                                       doc_id=image_id)
Ejemplo n.º 4
0
    def find_id(self, doc_id=None):
        """Retrieve image by ID or custom ID

        Args:
            image_id (int): Image's ID or custom ID which is you were assigned

        Returns:

        """

        return Connector(self.token,
                         model_type="docs",
                         path="images/document_verifications/").send(
                             method='GET', doc_id=doc_id)
Ejemplo n.º 5
0
    def find_id(self, video_id=None):
        """Retrieve video by ID or custom ID

        Args:
            video_id (int): Video's ID or custom ID which is you were assigned

        Returns:
           dict: The value containt in Response class as dict

        """

        return Connector(self.token,
                         model_type="videos",
                         path="videos/closed_questions/").send(method='GET',
                                                               doc_id=video_id)
Ejemplo n.º 6
0
    def list(self, params=None):
        """Retrieve list of image choices

        Args:
            page (int): Page of data
            per_page (int): Limit of date per page

        Returns:
            dict: The value containt in Response class as dict

         """

        return Connector(self.token, model_type="images", path="images/choices/").send(
            method='GET',
            data=params)
Ejemplo n.º 7
0
    def find_id(self, text_id=None):
        """Retrieve text by ID or custom ID

        Args:
            text_id (int): Text's ID or custom ID which is you were assigned

       Returns:
            dict: The value containt in Response class as dict

        """

        return Connector(self.token,
                         model_type='texts',
                         path='text/text_closed_questions/').send(
                             method='GET', doc_id=text_id, query_str=True)
Ejemplo n.º 8
0
    def list(self, params=None):
        """Retrieve list of video closed question

        Args:
            page (int): Page of data
            per_page (int): Limit of date per page

        Returns:
           dict: The value containt in Response class as dict

         """

        return Connector(self.token,
                         model_type="videos",
                         path="videos/closed_questions/").send(method='GET',
                                                               data=params)
Ejemplo n.º 9
0
    def create(self, params=None):
        """Create categroy conversation classification

        Args:
            conversation (arr of dict): Example: { "name": "username or indicator as you wish", "message": "message use to classify" }
            title (str): Title of conversation
            postback_url (str): URL for callback
            postback_method (str): Configuration HTTP method GET POST PUT PATCH
            custom_id (str): Custom ID that used for search
            allow_empty (bool) : Answer can be empty

        Returns:
            dict: The value containt in Response class as dict

        """
        headers = {'Content-Type': 'application/json'}
        return Connector(self.token, model_type='texts', path='text/text_categories/', headers=headers).send(method='POST', data=params)
Ejemplo n.º 10
0
    def create(self, params=None):
        """Create image messages

        Args:
            instruction (str): Tell moderator what answer you expected and what image is
            data (str): URL of image
            postback_url (str): URL for answer callback once image has been checked
            postback_method (str): Configuration HTTP method GET POST PUT PATCH
            custom_id (str): Custom ID that used for search

        Returns:
            dict: The value containt in Response class as dict

        """
        return Connector(self.token, model_type="images", path="images/messages/").send(
            method='POST',
            data=params)
Ejemplo n.º 11
0
    def create(self, params=None):
        """Create prediction data

        Args:
            data (str): URL of image
            postback_url (str): URL for callback once image has been checked
            postback_method (str): Config HTTP method GET POST PUT PATCH
            custom_id (str): Custom ID that used for search

        Returns:
            dict: The value containt in Response class as dict

        """
        return Connector(self.token,
                         model_type="ai",
                         path="prime/predictions/").send(method='POST',
                                                         data=params)
Ejemplo n.º 12
0
    def create(self, params=None):
        """Create image choices

        Args:
            data (str): URL of image
            postback_url (str): URL for answer callback once image has been checked
            postback_method (str): Configuration HTTP method GET POST PUT PATCH

        Returns:
            dict: The value containt in Response class as dict

        """
        return Connector(self.token,
                         model_type="docs",
                         path="images/document_verifications/",
                         headers={
                             'Content-Type': 'application/json'
                         }).send(method='POST', data=params)
Ejemplo n.º 13
0
    def create(self, params=None):
        """Create text closed question

        Args:
            data (arr of str): Stream of text to moderate
            postback_url (str): URL for callback
            postback_method (str): Configuration HTTP method GET POST PUT PATCH
            custom_id (str): Custom ID

        Returns:
            dict: The value containt in Response class as dict

        """

        return Connector(self.token,
                         model_type='texts',
                         path='text/text_closed_questions/').send(
                             method='POST', data=params)
Ejemplo n.º 14
0
    def create(self, params=None):
        """Create image closed questions

        Args:
            data (str): URL of image
            postback_url (str): URL for answer callback once image has been checked
            postback_method (str): Configuration HTTP method GET POST PUT PATCH
            custom_id (str): Custom ID that used for search

        Returns:
            dict: The value containt in Response class as dict.

        """

        return Connector(self.token,
                         model_type="images",
                         path="images/closed_questions/").send(method='POST',
                                                               data=params)
Ejemplo n.º 15
0
    def create(self, params=None):
        """Create conversation data

        Args:
            conversation (arr of str): Example: [{ 'name': '...', 'message': '...' }]
            custom_conversation_ids (arr of str): ID or custom ID for each conversation. Example: ['1','2']
            postback_url (str): URL for callback
            postback_method (str): Config HTTP method GET POST PUT PATCH DELETE
            custom_id (str): Custom ID

        Returns:
            dict: The value containt in Response class as dict

        """

        headers = {'Content-Type': 'application/json'}

        return Connector(self.token, model_type='texts', path='text/text_conversations/', headers=headers).send(method='POST', data=params)
Ejemplo n.º 16
0
    def create(self, params=None):
        """Create image choices

        Args:
            instruction (str): Tell moderator what answer you expected and what image is
            categories (str): List of answers that you were expected. sparate by use space
            data (str): URL of image
            postback_url (str): URL for answer callback once image has been checked
            postback_method (str): Configuration HTTP method GET POST PUT PATCH
            multiple (bool): Configuration for multiple selection of category to answer
            allow_empty (bool): Allow answer can be blank
            custom_id (str): Custom ID that used for search

        Returns:
            dict: The value containt in Response class as dict

        """
        return Connector(self.token, model_type="images", path="images/choices/").send(
            method='POST',
            data=params)
Ejemplo n.º 17
0
    def create(self, params=None):
        """Create video closed question

        Args:
            data (str): URL of video
            muted (bool): Mute video on start (default: true)
            allow_seeking (bool): Allow seeking video player
            play_at (float): Setting video start time
            postback_url (str): URL for callback once video has been checked
            postback_method (str): Configuration HTTP method GET POST PUT PATCH
            custom_id (str): Custom ID that used for search

        Returns:
            dict: The value containt in Response class as dict

        """

        return Connector(self.token,
                         model_type="videos",
                         path="videos/closed_questions/").send(method='POST',
                                                               data=params)