Skip to content

Commit c533439

Browse files
authored
docs: README.md
1 parent 6bcb7df commit c533439

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

README.md

+22-10
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,36 @@
2222
## 🔎 The Project
2323
RepoQuery is an early-beta project, that uses recursive [OpenAI function calling](https://platform.openai.com/docs/api-reference/chat/create#chat/create-functions) paired with semantic search using [multi-qa-MiniLM-L6-cos-v1](https://huggingface.co/rawsh/multi-qa-MiniLM-distill-onnx-L6-cos-v1/blob/main/onnx/model_quantized.onnx) to index and answer user queries about public GitHub repositories.
2424

25-
## 📬 Service Endpoints
25+
## 📬 Service Endpoints
2626

2727
> **Note:**
28-
Since the service returns responses as SSEs, a REST client like Postman is recommended. Download it [here](https://www.postman.com/downloads/). The Postman web client doesn't support requests to `localhost`.
28+
> Since the service returns responses as SSEs, a REST client like Postman is recommended. Download it [here](https://www.postman.com/downloads/). The Postman web client doesn't support requests to `localhost`.
2929
3030
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/18073744-276b793e-f5ec-418f-ba0a-9dff94af543e?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D18073744-276b793e-f5ec-418f-ba0a-9dff94af543e%26entityType%3Dcollection%26workspaceId%3D8d8a1363-ad0a-45ad-b036-ef6a37e44ef8)
3131

32-
### 1. `POST /embed`
33-
To generate and store embeddings for a GitHub repository.
32+
| Endpoint | Method | Description |
33+
|----------------------|--------|-----------------------------------------------|
34+
| `/` | GET | Redirects to the configured [redirect URL](https://github.com/open-sauced/repo-query/blob/afc4d19068e7c84a2566dae9598f1500f1191705/src/constants.rs#L12). |
35+
| `/embed` | POST | Generate and store embeddings for a GitHub repository. |
36+
| `/query` | POST | Perform a query on the API with a specific question related to a repository. |
37+
| `/collection` | GET | Check if a repository has been indexed. |
38+
39+
### 1. `/embed`
3440

3541
#### Parameters
42+
3643
The parameters are passed as a JSON object in the request body:
3744

3845
- `owner` (string, required): The owner of the repository.
3946
- `name` (string, required): The name of the repository.
4047
- `branch` (string, required): The name of the branch.
4148

4249
#### Response
43-
The request is processed by the server and responses are sent as [Server-sent events(SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). The event stream will contain the following events with optional data. https://github.com/open-sauced/repo-query/blob/f2f415a4fa9c02d4530624fd7bac2105eea1a77c/src/routes/events.rs#L14-L20
50+
51+
The request is processed by the server and responses are sent as [Server-sent events(SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). The event stream will contain [events](https://github.com/open-sauced/repo-query/blob/afc4d19068e7c84a2566dae9598f1500f1191705/src/routes/events.rs#L14-L21) with optional data.
4452

4553
#### Example
54+
4655
```bash
4756
curl --location 'localhost:3000/embed' \
4857
--header 'Content-Type: application/json' \
@@ -53,10 +62,10 @@ curl --location 'localhost:3000/embed' \
5362
}'
5463
```
5564

56-
### 2. `POST /query`
57-
To perform a query on the API with a specific question related to a repository.
65+
### 2. `/query`
5866

5967
#### Parameters
68+
6069
The parameters are passed as a JSON object in the request body:
6170

6271
- `query` (string, required): The question or query you want to ask.
@@ -66,10 +75,11 @@ The parameters are passed as a JSON object in the request body:
6675
- `branch` (string, required): The name of the branch.
6776

6877
#### Response
69-
The request is processed by the server and responses are sent as [Server-sent events(SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). The event stream will contain the following events with optional data. https://github.com/open-sauced/repo-query/blob/f2f415a4fa9c02d4530624fd7bac2105eea1a77c/src/routes/events.rs#L22-L29
7078

79+
The request is processed by the server and responses are sent as [Server-sent events(SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). The event stream will contain [events](https://github.com/open-sauced/repo-query/blob/afc4d19068e7c84a2566dae9598f1500f1191705/src/routes/events.rs#L23-L32) with optional data.
7180

7281
#### Example
82+
7383
```bash
7484
curl --location 'localhost:3000/query' \
7585
--header 'Content-Type: application/json' \
@@ -83,18 +93,20 @@ curl --location 'localhost:3000/query' \
8393
}'
8494
```
8595

86-
### 3. `GET /collection`
87-
To check if a repository has been indexed.
96+
### 3. `/collection`
8897

8998
#### Parameters
99+
90100
- `owner` (string, required): The owner of the repository.
91101
- `name` (string, required): The name of the repository.
92102
- `branch` (string, required): The name of the branch.
93103

94104
#### Response
105+
95106
This endpoint returns an `OK` status code if the repository has been indexed by the service.
96107

97108
#### Example
109+
98110
```bash
99111
curl --location 'localhost:3000/embed?owner=open-sauced&name=ai&branch=beta'
100112
```

0 commit comments

Comments
 (0)