Skip to content

Commit 92b5233

Browse files
committed
fix: endpoints
1 parent 7445fc1 commit 92b5233

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ node_modules
33
.vscode
44
.env
55
venv
6-
sources
6+
sources
7+
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The server exposes a POST endpoint at `/`. The endpoint expects a raw text body
4141
Use cURL to test the server, for example:
4242

4343
```bash
44-
curl -X POST -d "How do I create a user?" http://localhost:3000
44+
curl -X POST -H "Content-Type: application/json" -d "{\"prompt\": \"How do I create a new user?\"}" http://localhost:3000/v1/models/assistant/prompt
4545
```
4646

4747
## Contributing

scripts/test-prompts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { writeFile, mkdir } from "fs/promises";
22

3-
const SERVER_URL = "http://localhost:3003/";
3+
const SERVER_URL = "http://localhost:3003/v1/models/assistant/prompt";
44
const PROMPTS = [
55
"How do you add a custom domain in the console?",
66
"Show me how I can set up database collections and documents.",

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const port = 3003;
2424

2525
const SYSTEM_PROMPT = "You are an AI chat bot with information about Appwrite documentation. You need to help developers answer Appwrite related questions only. You will be given an input and you need to respond with the appropriate answer, using information confirmed with Appwrite documentation and reference pages. If applicable, show code examples. Code examples should use the Node and Web Appwrite SDKs unless otherwise specified.";
2626

27-
app.post("/", async (req, res) => {
27+
app.post("/v1/models/assistant/prompt", async (req, res) => {
2828
if (!retriever) {
2929
res.status(500).send("Search index not initialized");
3030
return;
@@ -62,7 +62,7 @@ app.post("/", async (req, res) => {
6262
res.end();
6363
});
6464

65-
app.post("/v1/prompt", async (req, res) => {
65+
app.post("/v1/models/generic/prompt", async (req, res) => {
6666
const decoder = new TextDecoder();
6767
const text = decoder.decode(req.body);
6868

0 commit comments

Comments
 (0)