Skip to content

Commit

Permalink
docs(ci): expand linter scope (supabase#30678)
Browse files Browse the repository at this point in the history
Expand linter scope to cover `ai` directory as well.
  • Loading branch information
charislam authored Nov 26, 2024
1 parent 2fb8b9f commit 78d0755
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs-lint-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: 9fd8c8fa7487a3d454a676e6e3d7409af34fc715
key: e23c860111349d8bac17b78b1fe632afe84223f9
- name: install linter
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev 9fd8c8fa7487a3d454a676e6e3d7409af34fc715
run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev e23c860111349d8bac17b78b1fe632afe84223f9
- name: install reviewdog
uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v1.3.0
with:
Expand All @@ -41,4 +41,4 @@ jobs:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
supa-mdx-lint apps/docs/content/guides/getting-started --format rdf | reviewdog -f=rdjsonl -reporter=github-pr-review
supa-mdx-lint apps/docs/content/guides/getting-started apps/docs/content/guides/ai --format rdf | reviewdog -f=rdjsonl -reporter=github-pr-review
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Then initialize a new project:
poetry new aws_bedrock_image_search
```

## Spin up a Postgres Database with pgvector
## Spin up a Postgres database with pgvector

If you haven't already, head over to [database.new](https://database.new) and create a new project. Every Supabase project comes with a full Postgres database and the [pgvector extension](/docs/guides/database/extensions/pgvector) preconfigured.

Expand Down
8 changes: 4 additions & 4 deletions apps/docs/content/guides/ai/integrations/amazon-bedrock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tocVideo: 'A3uND5sgiO0'

This guide will walk you through an example using Amazon Bedrock SDK with `vecs`. We will create embeddings using the Amazon Titan Embeddings G1 – Text v1.2 (amazon.titan-embed-text-v1) model, insert these embeddings into a PostgreSQL database using vecs, and then query the collection to find the most similar sentences to a given query sentence.

## Create an Environment
## Create an environment

First, you need to set up your environment. You will need Python 3.7+ with the `vecs` and `boto3` libraries installed.

Expand All @@ -25,7 +25,7 @@ You'll also need:
- [Credentials to your AWS account](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)
- [A Postgres Database with the pgvector extension](hosting.md)

## Create Embeddings
## Create embeddings

Next, we will use Amazon’s Titan Embedding G1 - Text v1.2 model to create embeddings for a set of sentences.

Expand Down Expand Up @@ -67,7 +67,7 @@ for sentence in dataset:

```

### Store the Embeddings with vecs
### Store the embeddings with vecs

Now that we have our embeddings, we can insert them into a PostgreSQL database using vecs.

Expand All @@ -90,7 +90,7 @@ sentences.upsert(records=embeddings)
sentences.create_index()
```

### Querying for Most Similar Sentences
### Querying for most similar sentences

Now, we query the `sentences` collection to find the most similar sentences to a sample query sentence. First need to create an embedding for the query sentence. Next, we query the collection we created earlier to find the most similar sentences.

Expand Down
17 changes: 15 additions & 2 deletions supa-mdx-lint.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,42 @@ ignore_patterns = ["**/_*.mdx"]
# Words that may be uppercased even if they are not the first word in the sentence.
# Can also specify a regex that is compatible with the [Rust regex crate](https://docs.rs/regex/latest/regex/).
may_uppercase = [
"[A-Z]{3,5}",
"[A-Z0-9]{2,5}",
"Android",
"Angular",
"Apple",
"Auth",
"ChatGPT",
"Content Delivery Network",
"Dart",
"Edge Functions",
"Edge Functions?",
"Flutter",
"GoTrue",
"Google",
"GraphQL",
"Hugging Face",
"I",
"IVFFlat",
"Ionic Angular",
"Ionic React",
"Ionic Vue",
"JavaScript",
"Kotlin",
"Navigable Small World",
"Next.js",
"Nuxt",
"OpenAI",
"Poetry",
"Postgres",
"PostgreSQL",
"PostgREST",
"Python",
"React",
"React Native",
"Reciprocal Ranked Fusion",
"RedwoodJS",
"Retrieval Plugin",
"Roboflow Inference",
"Row Level Security",
"Server-Side Auth",
"Single Sign-On",
Expand All @@ -40,8 +50,11 @@ may_uppercase = [
"SvelteKit",
"Swift",
"SwiftUI",
"TypeScript",
"Xcode",
"Vecs",
"Vue",
"Wrappers",
]
# Words that may be lowercased even if they are the first word in the sentence.
# Can also specify a regex that is compatible with the [Rust regex crate](https://docs.rs/regex/latest/regex/).
Expand Down

0 comments on commit 78d0755

Please sign in to comment.