-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from GoogleCloudPlatform/dev (2.1 release)
- Loading branch information
Showing
89 changed files
with
1,097 additions
and
2,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# GenAI for Marketing - Backend APIs | ||
|
||
We developed a comprehensive set of APIs, utilizing Python and FastAI, which encapsulate all features available in the GenAI for Marketing repository. This implementation paves the way for streamlined data interactions and enhanced functionality, enabling you to deploy the solution in your environment. | ||
This information is developers working directly with the backend APIs. See the root [README](../README.md) for information on deploying the solution (including the backend). | ||
|
||
We developed a comprehensive set of APIs, utilizing Python and FastAPI, which encapsulate all features available in the GenAI for Marketing repository. This implementation paves the way for streamlined data interactions and enhanced functionality, enabling you to deploy the solution in your environment. | ||
|
||
You are empowered to extend these APIs, intertwining them with your specific policies pertaining to security, access, and authentication to bolster a secure, seamless, and individualized interaction with the data and services available. Our offering merges practicality with customization, ensuring that your specific requirements are catered to with precision and reliability. | ||
|
||
## List of APIs developed in this repository | ||
## List of APIs Developed in This Repository | ||
|
||
**Campaign Creation and Generating the brief assets (POST)** (path="/campaigns") | ||
- Create Campaing and Generate text with PaLM API (text-bison) latest or 001. | ||
**Campaign Creation and Generating the Brief Assets (POST)** (path="/campaigns") | ||
- Create Campaign and Generate text with Gemini. | ||
|
||
**List all Campaigns created by user (GET)** (path="/campaigns") | ||
**List All Campaigns Created by User (GET)** (path="/campaigns") | ||
- List of Campaigns and there details. | ||
|
||
**Update Campaign (PUT)** (path="/campaigns/{campaign_id}") | ||
|
@@ -18,40 +20,37 @@ You are empowered to extend these APIs, intertwining them with your specific pol | |
**Delete Campaign (DELETE)** (path="/campaigns/{campaign_id}") | ||
- List of Campaigns and there details. | ||
|
||
**Text generation with Vertex AI PaLM API (text-bison)** (path="/generate-text") | ||
- Generate text with PaLM API (text-bison) latest or 001. | ||
|
||
**Image generation with Vertex Imagen API** (path="/generate-image") | ||
**Image Generation with Vertex Imagen API** (path="/generate-image") | ||
- Generate images with the Vertex Imagen API. | ||
|
||
**Image editing with Vertex Imagen API** (path="/edit-image") | ||
**Image Editing with Vertex Imagen API** (path="/edit-image") | ||
- Edit images with a prompt and a mask. | ||
|
||
**Get top search terms from Google Trends** (path="/get-top-search-terms") | ||
- Retrieve top search terms from Google trends | ||
**Get Top Search Terms from Google Trends** (path="/get-top-search-terms") | ||
- Retrieve top search terms from Google trends. | ||
|
||
**Summarize news articles related to keywords** (path="/post-summarize-news") | ||
**Summarize News Articles Related to Keywords** (path="/post-summarize-news") | ||
- Retrieve N news articles with keyword(s) using the GDELT API and summarize them. | ||
|
||
**From natural language to SQL** (path="/post-audiences") | ||
**From Natural Language to SQL** (path="/post-audiences") | ||
- Transform a question using natural language to SQL and query BigQuery. | ||
|
||
**Query sample data** (path="/get-dataset-sample") | ||
**Query Sample Data** (path="/get-dataset-sample") | ||
- Query BigQuery and return 3 lines of a given table | ||
|
||
**Query Vertex AI Search** (path="/post-consumer-insights") | ||
- Query Vertex AI Search with using input and return to 10 results. | ||
|
||
**Upload file to Google Drive** (path="/post-upload-file-drive") | ||
**Upload File to Google Drive** (path="/post-upload-file-drive") | ||
- Given an uploaded file using a form, upload it to Google Drive. | ||
|
||
**Create Brief document and upload to Drive** (path="/creative-brief-create-upload") | ||
**Create Brief Document and Upload to Drive** (path="/creative-brief-create-upload") | ||
- Create a folder in Drive with correct permissions, copy the Creative Brief to Drive and update its contents with the generated text. | ||
|
||
**Create Slides and populate with Charts** (path="/creative-slides-upload") | ||
**Create Slides and Populate with Charts** (path="/creative-slides-upload") | ||
- Create a Google Slides from a template and populate with information from Google Sheets. | ||
|
||
**Translate Text using Google Translation API** (path="/translate") | ||
**Translate Text Using Google Translation API** (path="/translate") | ||
- Translate Text using Google Translation API. | ||
|
||
**Content-Generation API for Email/Webpost/SocialMedia/AssetGroup**(path="/generate-content") | ||
|
@@ -65,11 +64,11 @@ Connect your app to your Firebase project, do so from the [Firebase console](htt | |
- Add a Web App to project by going to Project Setting, it will generate the credentials. | ||
- Store credentialds in [Secret Manager](https://cloud.google.com/secret-manager/docs/create-secret-quickstart) and add secret_name in config.toml | ||
|
||
## Workspace integration | ||
## Workspace Integration | ||
|
||
Follow the steps below to setup the Workspace integration with this demonstration. | ||
|
||
#### Create a service account | ||
### Create a Service Account | ||
- Create a Service Account (SA) in the same project you are deploying the demo and download the JSON API Key. This SA doesn't need any roles / permissions. | ||
- Follow this [documentation](https://cloud.google.com/iam/docs/service-accounts-create) to create the service account. Take note of the service account address; it will look like this: `[email protected]`. | ||
- Follow this [documentation](https://cloud.google.com/iam/docs/keys-create-delete#creating) to download the key JSON file with the service account credentials. | ||
|
@@ -78,7 +77,7 @@ Follow the steps below to setup the Workspace integration with this demonstratio | |
- When you deploy the app to AppEngine, the JSON file will be copied inside the docker image. | ||
- **IMPORTANT**: For security reasons, DON'T push this credentials to a public Github repository. | ||
|
||
#### Google Drive | ||
### Google Drive | ||
- Navigate to [Google Drive](https://drive.google.com/) and create a folder. | ||
- This folder will be used to host the templates and assets created in the demo. | ||
- Share this folder with the service account address you created in the previous step. Give "Editor" rights to the service account. The share will look like this: | ||
|
@@ -88,7 +87,7 @@ Follow the steps below to setup the Workspace integration with this demonstratio | |
- Open the configuration file [app_config.toml - line 558](/app/app_config.toml) and change to your folder ID. | ||
- **IMPORTANT**: Also share this folder with people who will be using the code. | ||
|
||
## How to deploy this APIs to Google Cloud Run | ||
## How to Deploy the APIs to Google Cloud Run | ||
|
||
Using the same Vertex AI managed notebook you created in this [README](../README.md) file, follow the steps below: | ||
- Open the JupyterLab environment | ||
|
@@ -120,4 +119,4 @@ You will find detailed intructions in this [README](../README.md) file, speciall | |
> gcloud run deploy genai-marketing-apis --image gcr.io/**"YOUR PROJECT ID"**/genai-marketing-apis --allow-unauthenticated --region us-central1 | ||
Replace **"YOUR PROJECT ID"** with the id of your project. | ||
This is just one example on how to deploy this container to Cloud Run on an endpoint that accepts unauthenticated requests. Change to your requirements. | ||
This is just one example on how to deploy this container to Cloud Run on an endpoint that accepts unauthenticated requests. Change to your requirements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.