Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d4d418

Browse filesBrowse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 24a3679 + 7673fb8 commit 5d4d418
Copy full SHA for 5d4d418

File tree

Expand file treeCollapse file tree

1 file changed

+8
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-5
lines changed
Open diff view settings
Collapse file

‎BQ_RemoteFunction_Sample/README.md‎

Copy file name to clipboardExpand all lines: BQ_RemoteFunction_Sample/README.md
+8-5Lines changed: 8 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ This README provides instructions for setting up a BigQuery Remote Function that
66
- [BQ Remote function Doc](https://cloud.google.com/bigquery/docs/remote-functions)
77
- [Create Cloud Function Doc](https://cloud.google.com/functions/docs/create)
88

9-
## Required Access
9+
# Required Access
1010
1. Developer needs to have the following roles:
1111
- Cloud Run Developer
1212
- Vertex AI User
1313
- BigQuery User
1414
2. Grant Service Accounts IDs access between different services (see Step 2)
1515

16-
## Step 1: Create Cloud Function using the [Create Cloud Function Doc](https://cloud.google.com/functions/docs/create)
16+
## Step 1: Enable Vertex AI API and Enable Claude Models on Vertex AI
17+
You can follow this documentation: [Link to Claude On Vertex AI Doc](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude#before_you_begin_)
18+
19+
## Step 2: Create Cloud Function using the [Create Cloud Function Doc](https://cloud.google.com/functions/docs/create)
1720
You can use the provided Sample Code below or in the /CloudFunction folder in this folder
1821
### requirements.txt
1922
```
@@ -70,18 +73,18 @@ def claude_http(request: flask.Request) -> flask.Response:
7073
}
7174
```
7275

73-
## Step 2: Create BQ Remote Function Connection
76+
## Step 3: Create BQ Remote Function Connection
7477
Follow the [documentation](https://cloud.google.com/bigquery/docs/remote-functions#create_a_connection) to create a BigQuery Remote Function Connection and set up proper IAM access. Additionally, grant Cloud Run access to the Vertex AI user role.
7578

76-
## Step 3: Create BQ Remote Function
79+
## Step 4: Create BQ Remote Function
7780
```sql
7881
CREATE OR REPLACE FUNCTION
7982
`[yourproject].[yourdataset].claude35Sonnet`(prompt STRING) RETURNS STRING
8083
REMOTE WITH CONNECTION `[yourproject].us.llm_connection`
8184
OPTIONS (endpoint = 'https://[YOUR Function URI....]', max_batching_rows = 1);
8285
```
8386

84-
## Step 4: Query the Function
87+
## Step 5: Query the Function
8588
```sql
8689
SELECT
8790
title,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.