Skip to content

Commit 79f66ad

Browse files
rework docs (#43)
* rework docs * more justfile
1 parent d78d664 commit 79f66ad

15 files changed

+139
-441
lines changed

docs/_quarto.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ website:
5353
#- sidebar:how-to
5454
#- sidebar:reference
5555

56-
right:
57-
- posts.qmd
56+
# right:
57+
#- posts.qmd
5858
#- release_notes.md # TODO: release notes
5959
#- sidebar:contribute
6060

@@ -74,7 +74,11 @@ website:
7474
collapse-level: 2
7575
contents:
7676
- why.qmd
77-
- auto: concepts/*.qmd
77+
- concepts/bots.qmd
78+
- concepts/messages.qmd
79+
- concepts/attachments.qmd
80+
- concepts/flows.qmd
81+
- concepts/tasks.qmd
7882
- id: how-to
7983
title: "How-to"
8084
style: "docked"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/concepts/attachments.qmd

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Attachments
2+
3+
Ibis Birdbrain passes Python objects as `Attachments` to [`Messages`](./messages.qmd). This allows the user, itself, and (eventually) other bots to interact with data, code, and more.
4+
5+
6+
## Usage
7+
8+
```{python}
9+
from ibis_birdbrain.attachments import Attachment, Attachments
10+
11+
a1 = Attachment(content="Hello, world!")
12+
a1
13+
```
14+
15+
## TableAttachment
16+
17+
A `TableAttachment` contains an Ibis table:
18+
19+
```{python}
20+
import ibis
21+
22+
from ibis_birdbrain.attachments import TableAttachment
23+
24+
ibis.options.interactive = True
25+
26+
t = ibis.examples.penguins.fetch()
27+
28+
a2 = TableAttachment(content=t)
29+
a2
30+
```
31+
32+
Notice the name, description (schema), and preview are automatically populated.
33+
34+
## CodeAttachment
35+
36+
A `CodeAttachment` contains code -- typically Python or SQL:
37+
38+
```{python}
39+
from ibis_birdbrain.attachments import CodeAttachment
40+
41+
a3 = CodeAttachment(content="select 1 as id", language="sql")
42+
a3
43+
```

docs/concepts/bots.qmd

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Bots
2+
3+
Ibis Birdbrain implements a `Bot` calss that can be used to instantiate one or more bots that automate various tasks.
4+
5+
## Usage
6+
7+
```{python}
8+
from ibis_birdbrain import Bot
9+
Bot
10+
```

docs/concepts/flows.qmd

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Flows
2+
3+
Ibis Birdbrain's [`Bot`](./bot.qmd) chooses a `Flow` to execute based on [`Messages`](./messages.qmd).
4+
5+
A Flow takes Messages as input and returns Messages as output. The details of a given Flow are specific to itself, running a series of [`Tasks`](./tasks.qmd) to accomplish its goal.
6+
7+
## Usage
8+
9+
```{python}
10+
from ibis_birdbrain.flows import Flow, Flows
11+
12+
flow = Flow()
13+
flow
14+
```

docs/concepts/messages.qmd

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Messages
2+
3+
Ibis Birdbrain communicates with the user, itself, and (eventually) other bots through `Messages`. A `Message` is a simple wrapper around text with metadata and optional [`Attachments`](./attachments.qmd).
4+
5+
6+
## Usage
7+
8+
```{python}
9+
from ibis_birdbrain.messages import Message, Messages, Email
10+
11+
m1 = Message("Hello, world!")
12+
m1
13+
```
14+
15+
## Emails
16+
17+
Currently, the only implementation of `Message` that is viewable as a proper string is `Email`.
18+
19+
```{python}
20+
e1 = Email("Hello")
21+
e2 = Email(", world!")
22+
23+
messages = Messages([e1, e2])
24+
messages
25+
```

docs/concepts/tasks.qmd

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Tasks
2+
3+
Ibis Birdbrain's [`Flow`](./flow.qmd) executes one or more `Tasks` to accomplish its goal. A `Task` is a single unit of work that takes a [`Message`](./message.qmd) as input and returns a `Message` as output.
4+
5+
## Usage
6+
7+
```{python}
8+
from ibis_birdbrain.tasks import Task, Tasks
9+
10+
task = Task()
11+
task
12+
```

docs/index.qmd

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Ibis Birdbrain"
3-
description: "the portable Python AI-powered data bot"
3+
description: "the portable Python LM-powered data bot"
44
repo-actions: false
55
code-annotations: hover
66
format:
@@ -13,22 +13,22 @@ about:
1313
links:
1414
- icon: info-circle
1515
text: Why Ibis Birdbrain?
16-
href: /ibis-birdbrain/why
16+
href: why.qmd
1717
- icon: download
1818
text: Installation
19-
href: /ibis-birdbrain/install
19+
href: install.qmd
2020
- icon: book
2121
text: "Tutorial: getting started"
22-
href: /ibis-birdbrain/tutorials/cli
22+
href: tutorials/python.qmd
2323
- icon: github
2424
text: GitHub
2525
href: https://github.com/ibis-project/ibis-birdbrain
2626
- icon: slack
2727
text: Chat
2828
href: https://ibis-project.zulipchat.com
29-
- icon: rss
30-
text: RSS
31-
href: https://ibis-project.github.io/ibis-birdbrain/posts.xml
29+
# - icon: rss
30+
# text: RSS
31+
# href: https://ibis-project.github.io/ibis-birdbrain/posts.xml
3232
---
3333

3434
::: {#about}

docs/tutorials/cli.qmd

+3-39
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,17 @@
22

33
## Prerequisites
44

5-
- [Install Ibis Birdbrain](/install.qmd)
5+
1. [Install Ibis Birdbrain](/install.qmd)
66

77
## Overview
88

9-
With Ibis Birdbrain installed, you can use the `birdbrain` command-line interface (CLI):
9+
With Ibis Birdbrain installed, you can use the `birdbrain` command-line
10+
interface (CLI):
1011

1112
```bash
1213
$ birdbrain
1314
```
1415

15-
```html
16-
Usage: birdbrain [OPTIONS] COMMAND [ARGS]...
17-
18-
╭─ Options ──────────────────────────────────────────────────────────────────────╮
19-
│ --version Show version. │
20-
│ --install-completion Install completion for the current shell. │
21-
│ --show-completion Show completion for the current shell, to copy │
22-
│ it or customize the installation. │
23-
│ --help Show this message and exit. │
24-
╰────────────────────────────────────────────────────────────────────────────────╯
25-
╭─ Commands ─────────────────────────────────────────────────────────────────────╮
26-
│ ipy ipy │
27-
│ test test │
28-
╰────────────────────────────────────────────────────────────────────────────────╯
29-
```
30-
31-
## Starting an interactive Python session
32-
33-
You can use the `ipy` subcommand to start an interactive Python session with Ibis Birdbrain ready to use:
34-
35-
```bash
36-
$ birdbrain ipy
37-
```
38-
39-
```html
40-
access to: birdbrain
41-
model: azure_openai/gpt-4-32k
42-
Python 3.11.5 (main, Sep 14 2023, 13:17:51) [Clang 14.0.3 (clang-1403.0.22.14.1)]
43-
Type 'copyright', 'credits' or 'license' for more information
44-
IPython 8.16.0 -- An enhanced Interactive Python. Type '?' for help.
45-
46-
[ins] In [1]: birdbrain
47-
Out[1]: <Bot: birdbrain>
48-
49-
[ins] In [2]:
50-
```
51-
5216
## Next steps
5317

5418
[Learn how to work with Ibis Birdbrain in Python](/tutorials/python.qmd).

0 commit comments

Comments
 (0)