wit-ai / pywit

Python library for Wit.ai
Other
1.45k stars 359 forks source link

More GET methods #160

Closed Sharan-Babu closed 3 years ago

Sharan-Babu commented 3 years ago

Added 4 new functions, 'entity_list', 'entity_info', 'trait_list', 'trait_info'.

Sharan-Babu commented 3 years ago

I also tried implementing one POST method but is not working. I tried the method below and passing ContentType and data separately but did not work on my end. Could you please point where I am going wrong?

def create_intent(self, intent_name, headers=None, verbose=None):
    """    
    Creates a new intent.

    :param intent_name: name of intent to be created.
    """
    params = {}
    headers = headers or {}
    # if intent_name:
    #     params['name'] = intent_name
    if verbose:
        params['verbose'] = True   
    endpoint = '/intents/name=' + intent_name    
    resp = req(self.logger, self.access_token, 'POST', endpoint, params, headers=headers)
    return resp
Sharan-Babu commented 3 years ago

When I fetch upstream, make new changes and create a new pull request, it shows that the previous commits are also to be merged. I mean, the PR reads 'Sharan-Babu wants to merge 12 commits...' even though I only introduced 4 new commits. Is this something to be fixed? Thanks.

chessai commented 3 years ago

When I fetch upstream, make new changes and create a new pull request, it shows that the previous commits are also to be merged. I mean, the PR reads 'Sharan-Babu wants to merge 12 commits...' even though I only introduced 4 new commits. Is this something to be fixed? Thanks.

It means that git is being used improperly. For now you probably want to rebase and squash, then force push.

For future reference, you should be checking out a new branch for these features, rather than your own master branch. That's probably contributing to this problem.

Sharan-Babu commented 3 years ago

When I fetch upstream, make new changes and create a new pull request, it shows that the previous commits are also to be merged. I mean, the PR reads 'Sharan-Babu wants to merge 12 commits...' even though I only introduced 4 new commits. Is this something to be fixed? Thanks.

It means that git is being used improperly. For now you probably want to rebase and squash, then force push.

For future reference, you should be checking out a new branch for these features, rather than your own master branch. That's probably contributing to this problem.

Could you merge the PR this time? I can make sure it doesn't happen from the next time. Also, I believe there are 2 options 'squash and merge' and 'rebase and merge' on your end. Would they help with the issue?

Sharan-Babu commented 3 years ago

I also tried implementing one POST method but is not working. I tried the method below and passing ContentType and data separately but did not work on my end. Could you please point where I am going wrong?

def create_intent(self, intent_name, headers=None, verbose=None):
    """    
    Creates a new intent.

    :param intent_name: name of intent to be created.
    """
    params = {}
    headers = headers or {}
    # if intent_name:
    #     params['name'] = intent_name
    if verbose:
        params['verbose'] = True   
    endpoint = '/intents/name=' + intent_name    
    resp = req(self.logger, self.access_token, 'POST', endpoint, params, headers=headers)
    return resp

Would also like to have your help with this.

chessai commented 3 years ago

What is the error you are getting?

chessai commented 3 years ago

Why did you close the PR @Sharan-Babu ?

Sharan-Babu commented 3 years ago

I was thinking of creating a new PR such that we do not have the squash and merge issue.

chessai commented 3 years ago

I was thinking of creating a new PR such that we do not have the squash and merge issue.

Sounds good, thanks!