Comments (8)
@mukkah, could you please provide some more info on how you use Dialogflow?
- Are you on Standard or Enterprise edition?
- Do you use one of our client libraries (https://cloud.google.com/dialogflow-enterprise/docs/reference/libraries)? If so, which one?
- Where do you send your traffic from? Mobile App, Web App (browser), Server, Cloud Function?
- Could you please provide an exemplary request and response (or error message)?
from python-dialogflow.
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.
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:
- For command line: https://cloud.google.com/dialogflow-enterprise/docs/quickstart
- For client libraries: https://cloud.google.com/dialogflow-enterprise/docs/quickstart-client-libraries
from python-dialogflow.
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.
@lukesneeringer, could you please advise on how to tackle the problem with auth in Python library?
from python-dialogflow.
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.
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.
Currently there is a 1:1 relationship between Dialogflow agent and Google Project
from python-dialogflow.
Related Issues (20)
- Exporting Agent Bytes Then Fails to Import HOT 13
- Migrate to main branch
- samples.snippets.participant_management_test: test_analyze_content_text failed HOT 11
- samples.snippets.participant_management_test: test_analyze_content_text failed HOT 1
- Dependency Dashboard
- samples.snippets.create_document_test: test_create_document failed HOT 5
- samples.snippets.create_knowledge_base_test: test_create_knowledge_base failed HOT 5
- participant_management.py test failed.
- Segmentation fault with multiprocessing HOT 2
- Increase code coverage from 99% to 100% HOT 1
- No DesignTimeAgent found for project `python-docs-samples-*` HOT 2
- AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key' HOT 9
- Resolve sphinx docs warnings and enable warnings as errors HOT 1
- seminar HOT 1
- Warning: a recent release failed
- AttributeError: module 'google.cloud.dialogflow_v2' has no attribute 'Entity' HOT 1
- Add sample code for StreamingAnalyzeContent with audio live transcription HOT 1
- Add Code Snippet for Pulling Session ID from WebhookRequests HOT 1
- AttributeError: 'dict' object has no attribute 'index' HOT 2
- unable to import name "common_pb2" from "google.cloud.dialogflow_v2.types" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-dialogflow.