You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers-ai/tutorials/using-bigquery-with-workers-ai.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ You will be needing:
35
35
36
36
## Step 1 - Setting up your Cloudflare Worker
37
37
38
-
In order to ingest the data into Cloudflare and feed it into Workers AI, you will be using a [Cloudflare Worker](/workers/). If you haven’t created one yet, please feel free to review our [tutorial on how to get started](/workers/get-started/).
38
+
In order to ingest the data into Cloudflare and feed it into Workers AI, you will be using a [Cloudflare Worker](/workers/). If you haven't created one yet, please feel free to review our [tutorial on how to get started](/workers/get-started/).
39
39
40
40
After following the steps to create a Worker, you should have the following code in your new Worker project:
41
41
@@ -55,7 +55,7 @@ If the Worker project has successfully been created, you should also be able to
55
55
56
56
Open a browser tab at `http://localhost:8787/` to see your deployed Worker. Please note that the port `8787` may be a different one in your case.
57
57
58
-
You should be seeing 'Hello World!' in your browser:
58
+
You should be seeing `Hello World!` in your browser:
59
59
60
60
```sh
61
61
Hello World!
@@ -192,7 +192,7 @@ To verify that the installation succeeded, you can run `npm list`, which list li
192
192
193
193
## Step 4 - Generate JSON Web Token
194
194
195
-
Now that you have installed the `jose` library, it’s time to import it and add a function to your code that generates a signed JWT:
195
+
Now that you have installed the `jose` library, it's time to import it and add a function to your code that generates a signed JWT:
196
196
197
197
```javascript
198
198
import*asjosefrom'jose';
@@ -234,11 +234,11 @@ export default {
234
234
235
235
```
236
236
237
-
Now that you have created a JWT, it’s time to do an API call to BigQuery to fetch some data.
237
+
Now that you have created a JWT, it's time to do an API call to BigQuery to fetch some data.
238
238
239
239
## Step 5 - Making authenticated requests to Google BigQuery
240
240
241
-
With the JWT token created in the previous step, issue an API request to BigQuery’s API to retrieve data from a table.
241
+
With the JWT token created in the previous step, issue an API request to BigQuery's API to retrieve data from a table.
242
242
243
243
You will now query the table that you already have created in BigQuery as part of the prerequisites of this tutorial. This example uses a sampled version of the [Hacker News Corpus](https://www.kaggle.com/datasets/hacker-news/hacker-news-corpus) that was used under its MIT licence and uploaded to BigQuery.
244
244
@@ -277,7 +277,7 @@ Having the raw row data from BigQuery means that you can now format it in a JSON
277
277
278
278
## Step 6 - Formatting results from the query
279
279
280
-
Now that you have retrieved the data from BigQuery, it’s time to note that a BigQuery API response looks something like this:
280
+
Now that you have retrieved the data from BigQuery, it's time to note that a BigQuery API response looks something like this:
281
281
282
282
```json
283
283
{
@@ -656,7 +656,7 @@ This will create a public endpoint that you can use to access the Worker globall
656
656
657
657
## Conclusion
658
658
659
-
In this tutorial, you’ve learnt how to integrate Google BigQuery and Cloudflare Workers by creating a GCP service account key and storing part of it as Worker Secrets. This was later imported in the code and by using the `jose` npm library, you created a JSON Web Token to authenticate the API query to BigQuery.
659
+
In this tutorial, you've learnt how to integrate Google BigQuery and Cloudflare Workers by creating a GCP service account key and storing part of it as Worker Secrets. This was later imported in the code and by using the `jose` npm library, you created a JSON Web Token to authenticate the API query to BigQuery.
660
660
661
661
Once you obtained the results, some formatting was applied to them to later be passed to generative AI models via Workers AI to generate tags and to perform sentiment analysis on the extracted data.
0 commit comments