Coder Social home page Coder Social logo

Comments (8)

lukaszbk avatar lukaszbk commented on May 29, 2024

@mukkah, could you please provide some more info on how you use Dialogflow?

from python-dialogflow.

mukkah avatar mukkah commented on May 29, 2024

Hi @lukaszbk ,

I'm using Standard, on a GCP Free trial for now (I think to change I first need to setup an Organization, right?).
I've installed the client library dialogflow-0.2.0 (I attempted with 0.1.0, same issue). Agent is using version 2.
Traffic is coming from server. I can send you the IP in particular if needed.

From Curl I got a different error, complaining about a wrong project.
I`ve attempted to setup the GCLOUD_PROJECT env variable with my project (as possible solution from ticket: #47), but no success. It insists on unknown project 32555940559:
{code}
curl -H "Authorization: Bearer "$(gcloud auth print-access-token) -H "Content-Type: application/json; charset=utf-8" --data "{
'query_input': {
'text': {
'text': 'pontos na carteira',
'language_code': 'pt-BR'
}
}
}" "https://dialogflow.googleapis.com/v2/projects/detran-teste-202815/agent/sessions/123456789:detectIntent"
{
"error": {
"code": 403,
"message": "Dialogflow API has not been used in project 32555940559 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dialogflow.googleapis.com/overview?project=32555940559 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/dialogflow.googleapis.com/overview?project=32555940559"
}
]
}
]
}
}
{code}

Any idea?

Thanks a lot!

from python-dialogflow.

lukaszbk avatar lukaszbk commented on May 29, 2024

It looks like you may have set up authentication incorrectly. Did you set GOOGLE_APPLICATION_CREDENTIALS environment variable correctly? You can find instructions on how to set up auth here:

from python-dialogflow.

mukkah avatar mukkah commented on May 29, 2024

Hi,

After running "gcloud auth activate-service-account --key-file=service-account-key-file" with the project key, the Curl worked and returned a valid connection an result but the clientsession method is still returning 401.
It was working even passing the key.json as parameter like this:
[code]
from google.oauth2 import service_account
...
credentials = service_account.Credentials.from_service_account_file(key.json)
session_client = dialogflow.SessionsClient(credentials=credentials)
[code]
Now even explicitly using the env variable GOOGLE_APPLICATION_CREDENTIALS, with empty parameter on SessionsClient, it is not working...

Other problem here is that some days ago it was enough to have my account as active credential, now I need to set the active credential associated to the specific project (and as each agent must to be associated to a project, I wouldn't be able to use it without changing it manually every time) what is a problem if I need to use more agents at same time at same server.

Is there a way I can concentrate the authentication in only one service account?

However, still with the problem of 401 when using your the python library (latest version installed)...
Any idea how to move forward?

Thanks,

from python-dialogflow.

lukaszbk avatar lukaszbk commented on May 29, 2024

@lukesneeringer, could you please advise on how to tackle the problem with auth in Python library?

from python-dialogflow.

lukaszbk avatar lukaszbk commented on May 29, 2024

As for the question about auth for multiple agents - you can grant a single service account access to multiple GCP projects. That way you can authenticate calls to many different agents using the same credentials.

from python-dialogflow.

mukkah avatar mukkah commented on May 29, 2024

Hi @lukesneeringer ,

Thanks a lot for your answer.
I was able to manage the 401 issue. My mistake, sorry.
About the single service account access to multiple GCP projects, I'll double check it, thank you too.

But what about the one by one relation project/agent? What happens if I have hundreds of agents? Will google be ok with me creating hundreds of projects?

Thanks!

from python-dialogflow.

babujipa avatar babujipa commented on May 29, 2024

Currently there is a 1:1 relationship between Dialogflow agent and Google Project

from python-dialogflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.