python-docs-samples
python-docs-samples copied to clipboard
feat(alloydb): PoC create basic sample for 'Vector Search'
Description
- Validate Kokoro CI test environment
- Preparation for Vector Search Demo Web App on Flask. Based on Perform a vector search.
Checklist
- [x] I have followed Sample Guidelines from AUTHORING_GUIDE.MD
- [ ] README is updated to include all relevant information -> WIP
- [x] Tests pass:
nox -s py-3.9(see Test Environment Setup) - [x] Lint pass:
nox -s lint(see Test Environment Setup) - [ ] These samples need a new/updated env vars in testing projects set to pass (let us know which ones) -> Maybe
- [ ] Please merge this PR for me once it is approved
This PR requires new permissions for the google_ml_integration as in Grant Vertex AI user permission to AlloyDB service agent
Kokoro CI - Python 3.9 Log:
pg8000.exceptions.DatabaseError:
{
'S': 'ERROR',
'V': 'ERROR',
'C': 'GAV07',
'M': 'Permission denied on the resource.',
'D': 'Prediction request failed with \n HTTPError[403]: {\n "error": {\n "code": 403,\n "message": "Permission \'aiplatform.endpoints.predict\' denied on resource \'//[aiplatform.googleapis.com/projects/1012616486416/locations/us-central1/publishers/google/models/text-embedding-005\](http://aiplatform.googleapis.com/projects/1012616486416/locations/us-central1/publishers/google/models/text-embedding-005%5C)' (or it may not exist).",\n "status": "PERMISSION_DENIED",\n "details": [\n {\n "@type": "[type.googleapis.com/google.rpc.ErrorInfo](http://type.googleapis.com/google.rpc.ErrorInfo)",\n "reason": "IAM_PERMISSION_DENIED",\n "domain": "[aiplatform.googleapis.com](http://aiplatform.googleapis.com/)",\n "metadata": {\n "resource": "projects/1012616486416/locations/us-central1/publishers/google/models/text-embedding-005",\n "permission": "aiplatform.endpoints.predict"\n }\n }\n ]\n }\n}\n',
'H': 'Verify and set required permissions to secret manager, Vertex AI endpoint and/ or third party models.',
'W': 'SQL statement "SELECT ml_predict_row(FORMAT(\'publishers/google/models/%s\', model_id), json_build_object(\'instances\', json_build_array(json_build_object(\'content\', content))))"\nPL/pgSQL function google_ml._call_vertex_embedding(text,text) line 6 at SQL statement\nPL/pgSQL function embedding(text,text) line 13 at RETURN',
'F': 'google_ml_integration.cc',
'L': '397',
'R': 'ml_predict_row_impl'
}