Skip to content

Commit 405d022

Browse files
Copilotgkorland
andcommitted
Add missing API documentation to README
Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com>
1 parent 4a5bc02 commit 405d022

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,103 @@ For example:
4141
curl -X POST http://127.0.0.1:5000/analyze_folder -H "Content-Type: application/json" -d '{"path": "/Users/roilipman/Dev/GraphRAG-SDK", "ignore": ["./.github", "./build"]}' -H "Authorization: OpenSesame"
4242
```
4343

44+
## API Reference
45+
46+
### Retrieve a graph
47+
48+
Fetch graph entities from a repository:
49+
50+
```bash
51+
curl -X GET "http://127.0.0.1:5000/graph_entities?repo=<REPO_NAME>" -H "Authorization: <.ENV_SECRET_TOKEN>"
52+
```
53+
54+
For example:
55+
56+
```bash
57+
curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: OpenSesame"
58+
```
59+
60+
Response:
61+
```json
62+
{
63+
"status": "success",
64+
"entities": {
65+
"nodes": [...],
66+
"edges": [...]
67+
}
68+
}
69+
```
70+
71+
### Send Query
72+
73+
Query your code graph using natural language:
74+
75+
```bash
76+
curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "msg": "<YOUR_QUESTION>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
77+
```
78+
79+
For example:
80+
81+
```bash
82+
curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "GraphRAG-SDK", "msg": "What are the main classes in this project?"}' -H "Authorization: OpenSesame"
83+
```
84+
85+
Response:
86+
```json
87+
{
88+
"status": "success",
89+
"response": "The main classes in this project are..."
90+
}
91+
```
92+
93+
### History change
94+
95+
List all commits in a repository:
96+
97+
```bash
98+
curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
99+
```
100+
101+
For example:
102+
103+
```bash
104+
curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "GraphRAG-SDK"}' -H "Authorization: OpenSesame"
105+
```
106+
107+
Response:
108+
```json
109+
{
110+
"status": "success",
111+
"commits": [
112+
{
113+
"hash": "abc123",
114+
"date": 1234567890,
115+
"author": "John Doe",
116+
"message": "Initial commit"
117+
}
118+
]
119+
}
120+
```
121+
122+
Switch repository to a specific commit:
123+
124+
```bash
125+
curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "commit": "<COMMIT_HASH>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
126+
```
127+
128+
For example:
129+
130+
```bash
131+
curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "GraphRAG-SDK", "commit": "abc123"}' -H "Authorization: OpenSesame"
132+
```
133+
134+
Response:
135+
```json
136+
{
137+
"status": "success"
138+
}
139+
```
140+
44141
## Working with your graph
45142

46143
Once the source code analysis completes your FalkorDB DB will be populated with

0 commit comments

Comments
 (0)