Skip to content

Commit

Permalink
Improve search github file documentation (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevenannn authored Feb 3, 2025
1 parent 5158815 commit e6aee5a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions search_github_files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ This recipe demonstrates how to create embeddings for GitHub files and perform v
## Prerequisites

- Ensure you have the Spice CLI installed. Follow the [Getting Started](https://docs.spiceai.org/getting-started) if you haven't done so.
- Populate `.env`.
- Populate `.env` in the `cookbook/search_github_files` directory.
- `GITHUB_TOKEN`: With a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).
- `SPICE_OPENAI_API_KEY`: A valid OpenAI API key (or equivalent).

## SQL Search

1. Execute a Basic SQL Query to perform keyword searches within your dataset:
1. Start spice runtime:

```shell
git clone https://github.com/spiceai/cookbook # Skip if already cloned
cd cookbook/search_github_files
spice run
```

2. Execute a Basic SQL Query to perform keyword searches within your dataset:

```shell
spice sql
Expand Down Expand Up @@ -111,7 +119,7 @@ curl -XPOST http://localhost:8090/v1/search \

Result:

```json
````json
{
"matches": [
{
Expand Down Expand Up @@ -139,7 +147,7 @@ Result:
],
"duration_ms": 48
}
```
````

4. Rerun the search, and retrieve the full document (as an entry in `additional_coluumns`).

Expand All @@ -157,7 +165,7 @@ curl -XPOST http://localhost:8090/v1/search \

Result:

```json
````json
{
"matches": [
{
Expand Down Expand Up @@ -187,7 +195,7 @@ Result:
],
"duration_ms": 45
}
```
````

## Pre-existing embeddings

Expand Down Expand Up @@ -216,7 +224,7 @@ curl -XPOST http://localhost:8091/v1/search \

Result:

```json
````json
{
"matches": [
{
Expand Down Expand Up @@ -244,4 +252,4 @@ Result:
],
"duration_ms": 48
}
```
````

0 comments on commit e6aee5a

Please sign in to comment.