Skip to content

Commit

Permalink
Change GenerateText -> ComputeText
Browse files Browse the repository at this point in the history
  • Loading branch information
liamgriffiths committed Jul 19, 2024
1 parent b0f3956 commit 1a516b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pip install substrate
## Usage

```python
from substrate import Substrate, GenerateText, sb
from substrate import Substrate, ComputeText, sb
```

Initialize the Substrate client.
Expand All @@ -33,16 +33,16 @@ Initialize the Substrate client.
substrate = Substrate(api_key=SUBSTRATE_API_KEY)
```

Generate a story using the [`GenerateText`](https://www.substrate.run/nodes#GenerateText) node.
Generate a story using the [`ComputeText`](https://www.substrate.run/nodes#ComputeText) node.

```python
story = GenerateText(prompt="tell me a story")
story = ComputeText(prompt="tell me a story")
```

Summarize the output of the `story` node using another `GenerateText` node. Because `story` has not yet been run, we use `sb.concat` to work with its future output.
Summarize the output of the `story` node using another `ComputeText` node. Because `story` has not yet been run, we use `sb.concat` to work with its future output.

```python
summary = GenerateText(prompt=sb.concat("summarize this story in one sentence: ", story.future.text))
summary = ComputeText(prompt=sb.concat("summarize this story in one sentence: ", story.future.text))
```

Run the graph chaining `story``summary` by passing the terminal node to `substrate.run`.
Expand Down

0 comments on commit 1a516b7

Please sign in to comment.