Skip to content

Commit 79f66ad

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

File tree

15 files changed

+139
-441
lines changed

15 files changed

+139
-441
lines changed

docs/_quarto.yml

Lines changed: 7 additions & 3 deletions
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.

docs/concepts/attachments.qmd

Lines changed: 43 additions & 0 deletions
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

Lines changed: 10 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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

Lines changed: 25 additions & 0 deletions
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

Lines changed: 12 additions & 0 deletions
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+
```

0 commit comments

Comments
 (0)