I have a practice project given to me by an advisor that asks me to write a python script to access a model I trained with the Prediction API using the API Explorer. I have two questions regarding this,
The guidelines specify that I should not check in my credentials in the Python script and I am not exactly sure what that means, it also leads to question...
When I follow the documentation to call the "predict" method of "trainedmodels" (to predict the language of a text using a trained model)
from apiclient import discovery service = discovery.build('prediction','v1.6') x = service.trainedmodels().predict(project='My First Project', id='my_project_id', body={"input":{"csvInstance":['bonjour!']}})
This is the return value
<googleapiclient.http.HttpRequest object at 0x1031996d0>
Because I am not too aware of what is meant by "not checking in my credentials", I am unclear as to how to proceed in resolving this problem.
Thank you in advance.
There are at least ways to achieve that:
Here's a snippet showing how to access the credentials from within Python: