Skip to content

Latest commit

 

History

History
115 lines (97 loc) · 2.7 KB

README.md

File metadata and controls

115 lines (97 loc) · 2.7 KB

Local Document Server

HTTP API design

Embedding Document/Code CRUD

CREATE: POST /api/embedding-document

{
  "name": "README.md",
  "uri": "file:///path/to/README.md",
  "type": "markdown",
  "content": "..."
}

READ: GET /api/embedding-document/:id

{
  "id": "xxx-xxxx-xxx",
  "uri": "http://localhost:8080/api/embedding-document/xxx-xxxx-xxx",
  "name": "README.md",
  "content": "...",
  "type": "markdown",
  "chunks": [
    {
      "id": "xxx-xxxx-xxx",
      "text": "...",
      "embedding": "..."
    },
    {
      "id": "xxx-xxxx-xxx",
      "text": "...",
      "embedding": "..."
    }
  ]
}

SEARCH: GET /api/embedding-document/search?q=...

{
  "results": [
    {
      "id": "xxx-xxxx-xxx",
      "name": "README.md",
      "uri": "http://localhost:8080/api/embedding-document/xxx-xxxx-xxx",
      "content": "...",
      "type": "markdown",
      "chunks": [
        {
          "id": "xxx-xxxx-xxx",
          "text": "...",
          "embedding": "..."
        },
        {
          "id": "xxx-xxxx-xxx",
          "text": "...",
          "embedding": "..."
        }
      ]
    }
  ]
}

UPDATE: PUT /api/embedding-document/:id

{
  "name": "README.md",
  "uri": "file:///path/to/README.md",
  "content": "..."
}

DELETE: DELETE /api/embedding-document/:id

Web Scrapper

CREATE: POST /api/web-scrapper

{
  "url": "https://www.example.com"
}

returns embedding-document object

DELETE: DELETE /api/web-scrapper/:id

REFRESH: POST /api/web-scrapper/:id/refresh