Skip to content

Commit

Permalink
chore: use mintlify
Browse files Browse the repository at this point in the history
Signed-off-by: Adithya Krishna <[email protected]>
  • Loading branch information
adithyaakrishna committed Jul 23, 2024
1 parent eda2c5f commit fcd2a90
Show file tree
Hide file tree
Showing 109 changed files with 5,483 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Mintlify Starter Kit

Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including

- Guide pages
- Navigation
- Customizations
- API Reference pages
- Use of popular components

### Development

Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command

```
npm i -g mintlify
```

Run the following command at the root of your documentation (where mint.json is)

```
mintlify dev
```

### Publishing Changes

Install our Github App to auto propagate changes from your repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard.

#### Troubleshooting

- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
11 changes: 11 additions & 0 deletions docs/_app.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "../styles.css";
import { GoogleAnalytics } from "nextjs-google-analytics";

export default function Nextra({ Component, pageProps }) {
return (
<>
<GoogleAnalytics trackPageViews />
<Component {...pageProps} />
</>
);
}
20 changes: 20 additions & 0 deletions docs/_document.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import { SkipNavLink } from "nextra-theme-docs";

class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Head />
<body>
<SkipNavLink styled />
<Main />
<NextScript />
</body>
</Html>
);
}
}

export default MyDocument
50 changes: 50 additions & 0 deletions docs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"index": {
"title": "Introduction",
"type": "page",
"display": "hidden",
"theme": {
"typesetting": "article",
"sidebar": false,
"toc": false
}
},
"docs": {
"title": "Getting Started",
"type": "page"
},
"cli_ui": {
"title": "CLI & UI",
"type": "page"
},
"apis": {
"title": "APIs",
"type": "page"
},
"extractors": {
"title": "Extractors",
"type": "page"
},
"usecases": {
"title": "Use Cases",
"type": "page"
},
"integrations": {
"title": "LLM Frameworks",
"type": "page"
},
"operations": {
"title": "Deployment & Operations",
"type": "page"
},
"examples": {
"title": "Examples",
"type": "page"
},
"contact": {
"title": "Get in touch ↗",
"type": "page",
"href": "https://dub.sh/diptanu-calendly",
"newWindow": true
}
}
4 changes: 4 additions & 0 deletions docs/api-reference/endpoint/create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Create Plant'
openapi: 'POST /plants'
---
4 changes: 4 additions & 0 deletions docs/api-reference/endpoint/delete.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Delete Plant'
openapi: 'DELETE /plants/{id}'
---
4 changes: 4 additions & 0 deletions docs/api-reference/endpoint/get.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Get Plants'
openapi: 'GET /plants'
---
33 changes: 33 additions & 0 deletions docs/api-reference/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: 'Introduction'
description: 'Example section for showcasing API endpoints'
---

<Note>
If you're not looking to build API reference documentation, you can delete
this section by removing the api-reference folder.
</Note>

## Welcome

There are two ways to build API documentation: [OpenAPI](https://mintlify.com/docs/api-playground/openapi/setup) and [MDX components](https://mintlify.com/docs/api-playground/mdx/configuration). For the starter kit, we are using the following OpenAPI specification.

<Card
title="Plant Store Endpoints"
icon="leaf"
href="https://github.com/mintlify/starter/blob/main/api-reference/openapi.json"
>
View the OpenAPI specification file
</Card>

## Authentication

All API endpoints are authenticated using Bearer tokens and picked up from the specification file.

```json
"security": [
{
"bearerAuth": []
}
]
```
1 change: 1 addition & 0 deletions docs/api-reference/openapi.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions docs/apis/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"--": {
"type": "separator",
"title": "APIs"
},
"install_clients": "Install",
"extraction_graphs": "Extraction Graphs",
"content_ingestion": "Content Ingestion",
"retrieval": "Retrieval"
}
162 changes: 162 additions & 0 deletions docs/apis/content_ingestion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Content Ingestion

We provide APIs to upload raw text and any files from which you might want to extract information and build indexes.

Import the language specific clients
=== "Python"

```python
from indexify import IndexifyClient
extraction_graph_spec = """
name: 'myextractiongraph'
extraction_policies:
- extractor: 'tensorlake/minilm-l6'
name: 'minilml6'
"""
extraction_graph = ExtractionGraph.from_yaml(extraction_graph_spec)
client.create_extraction_graph(extraction_graph)
```
=== "TypeScript"

```typescript
import { IndexifyClient, ExtractionGraph } from "getindexify";

const client = await IndexifyClient.createClient();
const graph = ExtractionGraph.fromYaml(`
name: 'myextractiongraph'
extraction_policies:
- extractor: 'minilm-l6'
name: 'minilml6'
`);
await client.createExtractionGraph(graph);
```

## Upload File

=== "Python"

```python
content = client.upload_file(extraction_graphs="myextractiongraph",path="/path/to/file")
```

=== "TypeScript"

```typescript
await client.uploadFile("myextractiongraph", `files/test.txt`);
```

## Upload Raw Text
=== "Python"

```python
client.add_documents("myextractiongraph", [
"Indexify is amazing!",
"Indexify is a retrieval service for LLM agents!",
"Kevin Durant is the best basketball player in the world."
])
```
=== "TypeScript"

```typescript
await client.addDocuments("myextractiongraph", [
"Indexify is amazing!",
"Indexify is a retrieval service for LLM agents!",
"Kevin Durant is the best basketball player in the world."
]);
```

## Namespaces

Namespaces are used to isolate content uploaded by applications or from extractors that chunk or transform content.

!!! note

A default namespace, named `default` is created when Indexify is started.

## Create or Update a Namespace
A namespace can be created by specifying a unique name, and any additional labels or extraction policies.

=== "python"

```python
from indexify import IndexifyClient, ExtractionPolicy

IndexifyClient.create_namespace(
name="research",
extraction_graphs=[],
labels={"sensitive": "true"},
)
```

=== "TypeScript"

```typescript
import { IndexifyClient, IExtractionPolicy } from "getindexify";

IndexifyClient.createNamespace({
name:"research",
extractionGraphs:[],
labels:{"sensitive":"true"}});
```

=== "curl"

```shell
curl -X POST http://localhost:8900/namespaces \
-H 'Content-Type: application/json' \
-d '
{
"name": "research",
"extraction_graphs": [],
"labels": {"sensitive": "true"}
}
'
```

## List Namespaces
=== "python"

```python
namespaces = IndexifyClient.namespaces()
```

=== "TypeScript"

```typescript
const namespaces = await IndexifyClient.namespaces();
```

=== "curl"

```shell
curl -X GET http://localhost:8900/namespaces
```
??? abstract "output"

```json
{
"namespaces" : [
{
"extraction_graphs" : [
{
"extraction_policies" : [
{
"content_source" : "",
"extractor" : "tensorlake/minilm-l6",
"filters_eq" : {},
"graph_name" : "sportsknowledgebase",
"id" : "f4ac72a165927ada",
"input_params" : null,
"name" : "minilml6"
}
],
"id" : "default",
"name" : "sportsknowledgebase",
"namespace" : "default"
}
],
"name" : "default"
},
]
}
```
Loading

0 comments on commit fcd2a90

Please sign in to comment.