Skip to content

Commit

Permalink
Update API docs settings (#53)
Browse files Browse the repository at this point in the history
## Summary

* Add API Key page
* Update code snippets to only show curl, python and Node

---
  • Loading branch information
saqadri authored Nov 13, 2024
2 parents 9cb9b1a + 7f86549 commit 439a481
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 2 deletions.
49 changes: 49 additions & 0 deletions website/docs/api-keys.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
id: api-keys
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import constants from "@site/core/tabConstants";

# Manage API keys

## Get your LastMile API Key

- Log in or sign up at https://lastmileai.dev
- Navigate to https://lastmileai.dev/apikeys
- Click `+ New Key`

![LastMile API Key](/img/lastmile-api-key.png)

## Use your LastMile API Key

## Managing External API

### Configure Weights & Biases API token

![PyPI](https://img.shields.io/pypi/v/lastmile?label=lastmile)

The [LastMile Python library](https://pypi.org/project/lastmile/) provides pythonic access to the LastMile REST API from any Python 3.7+ application.

#### Installation

```bash
# install from PyPI
pip install lastmile
```

#### Usage

```python
import os
from lastmile import Lastmile

client = Lastmile(
# This is the default and can be omitted
bearer_token=os.environ.get("LASTMILE_API_TOKEN"),
)

dataset = client.datasets.create()
print(dataset.dataset)
```
18 changes: 18 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,31 @@ const config: Config = {
sidebarOptions: {
groupPathsBy: "tag",
},
baseUrl: "https://lastmileai.dev",
} satisfies OpenApiPlugin.Options,
} satisfies Plugin.PluginOptions,
},
],
],
themes: ["docusaurus-theme-openapi-docs"],
themeConfig: {
languageTabs: [
{
highlight: "curl",
language: "curl",
logoClass: "curl",
},
{
highlight: "python",
language: "python",
logoClass: "python",
},
{
highlight: "javascript",
language: "nodejs",
logoClass: "nodejs",
},
],
navbar: {
logo: {
alt: "LastMile AI",
Expand Down
12 changes: 11 additions & 1 deletion website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,17 @@ const sidebars: SidebarsConfig = {
title: "Overview",
description: "Some mock description text here",
},
items: require("./docs/api/sidebar.js"),
items: [
{
type: "doc",
id: "api-keys",
},
{
type: "doc",
id: "sdk",
},
...require("./docs/api/sidebar.js"),
],
collapsible: true,
collapsed: true,
},
Expand Down
Binary file added website/static/img/lastmile-api-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion website/static/open_api/2/model.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
"description": "LastMile AI API V2: Components",
"version": "2.0"
},
"servers": [],
"options": {
"servers": [
{
"url": "https://lastmileai.dev2",
"description": "REST API surface for the LastMile platform."
}
]
},
"servers": [
{
"url": "https://your-custom-url.com"
}
],
"security": [
{
"BearerAuth": []
Expand Down

0 comments on commit 439a481

Please sign in to comment.