You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ pip install substrate
24
24
## Usage
25
25
26
26
```python
27
-
from substrate import Substrate, GenerateText, sb
27
+
from substrate import Substrate, ComputeText, sb
28
28
```
29
29
30
30
Initialize the Substrate client.
@@ -33,16 +33,16 @@ Initialize the Substrate client.
33
33
substrate = Substrate(api_key=SUBSTRATE_API_KEY)
34
34
```
35
35
36
-
Generate a story using the [`GenerateText`](https://www.substrate.run/nodes#GenerateText) node.
36
+
Generate a story using the [`ComputeText`](https://www.substrate.run/nodes#ComputeText) node.
37
37
38
38
```python
39
-
story =GenerateText(prompt="tell me a story")
39
+
story =ComputeText(prompt="tell me a story")
40
40
```
41
41
42
-
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.
42
+
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.
43
43
44
44
```python
45
-
summary =GenerateText(prompt=sb.concat("summarize this story in one sentence: ", story.future.text))
45
+
summary =ComputeText(prompt=sb.concat("summarize this story in one sentence: ", story.future.text))
46
46
```
47
47
48
48
Run the graph chaining `story` → `summary` by passing the terminal node to `substrate.run`.
0 commit comments