Skip to content

Commit afc009e

Browse files
authored
Update RST File, Block, and Tag references to Autodoc links (#526)
This is a small opportunistic PR to turn some teletype-strings into documentation links
1 parent ac70d38 commit afc009e

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

docs/nextra/agents/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ AgentService
5050
The AgentService class provides a convenient way to deploy an Agent as a Steamship :ref:`Package<Packages>`.
5151

5252
All :class:`steamship.agents.service.agent_service.AgentService` instances contain a ``prompt(self, prompt: str, **kwargs) -> List[Block]`` method from thier base class.
53-
This method is the core ``chat`` loop: it accepts an inbound ``str`` in the form of a user message, and it produces a list of multimodal ``Block`` objects that contain the response.
53+
This method is the core ``chat`` loop: it accepts an inbound ``str`` in the form of a user message, and it produces a list of multimodal :py:class:`Block<steamship.data.block.Block>` objects that contain the response.

docs/nextra/data/blocks.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Blocks
55

66
Blocks are ordered chunks of content within a :ref:`File <Files>`.
77

8-
A ``Block`` may have raw data, plain text, or both. The type of content is indicated by its ``mime_type``.
8+
A :py:class:`Block<steamship.data.block.Block>` may have raw data, plain text, or both. The type of content is indicated by its ``mime_type``.
99
Blocks can store images, videos, audio clips, or any other chunk of data.
1010

1111
This means that different packages and plugins may choose divide files into blocks using different schemes.
@@ -16,14 +16,14 @@ The following divisions of this file into blocks are all perfectly fine:
1616
- Each 10 CSV rows is a block
1717
- The entire CSV file is one block
1818

19-
Metadata and annotations about the content of the ``Block`` added via :ref:`Tags` on the ``Block`` .
19+
Metadata and annotations about the content of the :py:class:`Block<steamship.data.block.Block>` added via :ref:`Tags` on the :py:class:`Block<steamship.data.block.Block>` .
2020

2121
.. _Creating Blocks:
2222

2323
Creating Blocks
2424
---------------
2525

26-
Blocks may be created when creating a ``File`` by passing them in the ``blocks`` parameter, or they can be appended
26+
Blocks may be created when creating a :py:class:`File<steamship.data.file.File>` by passing them in the ``blocks`` parameter, or they can be appended
2727
to an existing file.
2828

2929
Please see ``Block.create()`` and ``File.append_block()``.
@@ -35,7 +35,7 @@ Read the :py:class:`Block PyDoc spec here<steamship.data.block.Block>`.
3535
Making Block Data Public
3636
------------------------
3737

38-
If you want the raw data bytes of a ``Block`` to be publicly accessible, you can set the parameter ``public_data = True`` when calling ``Block.create()``.
38+
If you want the raw data bytes of a :py:class:`Block<steamship.data.block.Block>` to be publicly accessible, you can set the parameter ``public_data = True`` when calling ``Block.create()``.
3939
This is useful if you wish to share a generated image or audio file, or must make the content viewable in a place that cannot
40-
retain your Steamship API key. You can also change the value of the ``public_data`` flag on an existing ``Block`` by calling
40+
retain your Steamship API key. You can also change the value of the ``public_data`` flag on an existing :py:class:`Block<steamship.data.block.Block>` by calling
4141
``Block.set_public_data``.

docs/nextra/data/files.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Files
66
Files are the top-level object for any piece of data in a workspace.
77

88
Files hold bytes of raw data (with a ``mime_type``, and processed data in :ref:`Blocks`.
9-
A ``File`` may also have a list of :ref:`Tags` (annotations).
9+
A :py:class:`File<steamship.data.file.File>` may also have a list of :ref:`Tags` (annotations).
1010

11-
To do work on a ``File``, it needs to be saved and its content must be in :ref:`Blocks`.
11+
To do work on a :py:class:`File<steamship.data.file.File>`, it needs to be saved and its content must be in :ref:`Blocks`.
1212

1313
There are a few ways to accomplish this:
1414

15-
- Create ``File`` and ``Block`` content directly (see below)
15+
- Create :py:class:`File<steamship.data.file.File>` and :py:class:`Block<steamship.data.block.Block>` content directly (see below)
1616
- Add raw data directly, then create ``Blocks`` with a :ref:`blockifier plugin<Blockifiers>`
1717
- Import raw data with a :ref:`File Importer<File Importers>`, then create ``Blocks`` with a :ref:`blockifier plugin<Blockifiers>`
1818

@@ -33,7 +33,7 @@ Read the :py:class:`File PyDoc spec here<steamship.data.file.File>`.
3333
Creating Files Directly
3434
-----------------------
3535

36-
The quickest way to create data is to create Files with ``Block`` content directly:
36+
The quickest way to create data is to create Files with :py:class:`Block<steamship.data.block.Block>` content directly:
3737

3838
.. code-block:: python
3939
@@ -47,7 +47,7 @@ The quickest way to create data is to create Files with ``Block`` content direct
4747
Making File Data Public
4848
------------------------
4949

50-
If you want the raw data bytes of a ``File`` to be publicly accessible, you can set the parameter ``public_data = True`` when calling ``File.create()``.
50+
If you want the raw data bytes of a :py:class:`File<steamship.data.file.File>` to be publicly accessible, you can set the parameter ``public_data = True`` when calling ``File.create()``.
5151
This is useful if you wish to share a generated image or audio file, or must make the content viewable in a place that cannot
52-
retain your Steamship API key. You can also change the value of the ``public_data`` flag on an existing ``File`` by calling
52+
retain your Steamship API key. You can also change the value of the ``public_data`` flag on an existing :py:class:`File<steamship.data.file.File>` by calling
5353
``File.set_public_data``.

docs/nextra/data/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Data Model
55

66
There are only three core concepts you need to know.
77

8-
#. :ref:`Files` are the top level object for storing data. A ``File`` can store raw data and an ordered list of ``Blocks``.
9-
#. :ref:`Blocks` are chunks of content within a ``File``. They can contain raw data and/or text, and an unordered set of ``Tags``.
10-
#. :ref:`Tags` are typed annotations on a ``Block`` or ``File``.
8+
#. :ref:`Files` are the top level object for storing data. A :py:class:`File<steamship.data.file.File>` can store raw data and an ordered list of ``Blocks``.
9+
#. :ref:`Blocks` are chunks of content within a :py:class:`File<steamship.data.file.File>`. They can contain raw data and/or text, and an unordered set of ``Tags``.
10+
#. :ref:`Tags` are typed annotations on a :py:class:`Block<steamship.data.block.Block>` or :py:class:`File<steamship.data.file.File>`.
1111

1212

1313
The following diagram shows how data is created and used within Steamship:

docs/nextra/data/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ But Steamship actually supports two types of tags: **File Tags** and **Block Tag
163163
**Block Tags** annotate text within a :ref:`Block<Blocks>` object:
164164

165165
- They are attached to the :ref:`Block<Blocks>` object (``block.tags``)
166-
- Their ``start_idx`` and ``end_idx`` fields are either both null or both non-null. If both are null, the ``Tag is assumed to apply to the whole ``Block``. They represent offsets into the text that is spanned by that block.
166+
- Their ``start_idx`` and ``end_idx`` fields are either both null or both non-null. If both are null, the ``Tag is assumed to apply to the whole :py:class:`Block<steamship.data.block.Block>`. They represent offsets into the text that is spanned by that block.
167167
- They are referenced via the ``blocktag`` keyword in our :ref:`query system<queries>`.
168168

169169
Notes:

docs/nextra/plugins/developing/generators.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and implement the abstract ``run`` method:
1818
return InvocableResponse(data=RawBlockAndTagPluginOutput(blocks=output_blocks))
1919
2020
21-
For example, an image ``Generator`` could merge the ``text`` from the input blocks and use it to generate an image ``Block``.
21+
For example, an image ``Generator`` could merge the ``text`` from the input blocks and use it to generate an image :py:class:`Block<steamship.data.block.Block>`.
2222

2323
In addition to the input blocks and instance :ref:`configuration <Plugin Accepting Configuration>`, Generators can also receive
2424
arbitrary key/value runtime parameters. These are present in ``request.data.options``.

docs/nextra/plugins/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Taggers
3232
-------
3333
Taggers create :ref:`Tags` (annotations) on :ref:`Files` and :ref:`Blocks`.
3434

35-
*Examples*: A text classifier would attach a classification ``Tag`` to a ``Block``, an image object recognizer would add ``Tags`` to a ``Block`` that identified known objects.
35+
*Examples*: A text classifier would attach a classification :py:class:`Tag<steamship.data.tags.tag.Tag>` to a :py:class:`Block<steamship.data.block.Block>`, an image object recognizer would add ``Tags`` to a :py:class:`Block<steamship.data.block.Block>` that identified known objects.
3636

3737
- :ref:`Using Taggers<Taggers>`
3838
- :ref:`Developing Taggers<DevelopingTaggers>`

docs/nextra/plugins/using/blockifiers/using.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Our currently supported blockifiers are:
5656
Input
5757
-----
5858

59-
The input to a ``blockify`` operation is a ``File`` with no ``Blocks``.
59+
The input to a ``blockify`` operation is a :py:class:`File<steamship.data.file.File>` with no ``Blocks``.
6060

6161
Output
6262
------

docs/nextra/plugins/using/generators/gpt4.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ The GPT-4 ``Generator`` plugin uses OpenAI's GPT-4 to generate text from a text
77
or the continuation of a chat. It can also be used with GPT-3.5 by passing ``"gpt-3.5-turbo"``
88
as the ``model`` configuration parameter.
99

10-
The plugin will treat each ``Block`` of the input as an element of a chat. If a ``Block`` has
11-
a ``Tag`` of kind "role" and name ( "system" | "user" | "assistant" ), the content will be passed
12-
to OpenAI with the corresponding role. If a ``Block`` does not have a role tag, it will
10+
The plugin will treat each :py:class:`Block<steamship.data.block.Block>` of the input as an element of a chat. If a :py:class:`Block<steamship.data.block.Block>` has
11+
a :py:class:`Tag<steamship.data.tags.tag.Tag>` of kind "role" and name ( "system" | "user" | "assistant" ), the content will be passed
12+
to OpenAI with the corresponding role. If a :py:class:`Block<steamship.data.block.Block>` does not have a role tag, it will
1313
be passed with the configured default role, which defaults to "user" (see config params below).
1414

1515
The plugin handles retrying for rate limits and uses Steamship's OpenAI API key by default,
@@ -25,7 +25,7 @@ The simplest possible example is:
2525
task.wait()
2626
joke = task.output.blocks[0].text
2727
28-
To build a chat interaction, you can persist the prompt components to a ``File`` object,
28+
To build a chat interaction, you can persist the prompt components to a :py:class:`File<steamship.data.file.File>` object,
2929
tagging them with their conversational roles:
3030

3131
.. code-block:: python
@@ -51,7 +51,7 @@ tagging them with their conversational roles:
5151
joke = task.output.blocks[0].text
5252
5353
In the example above, in addition to being returned as the result of the ``Task``, the output
54-
``Block`` is appended to ``chat_file``.
54+
:py:class:`Block<steamship.data.block.Block>` is appended to ``chat_file``.
5555

5656
All output ``Blocks`` will be tagged with the "assistant" role to allow more
5757
content to be easily appended and generated.

docs/nextra/plugins/using/generators/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ There are several ways to specify input to a ``Generator``:
3737
3838
generator_task = generator.generate(text="some text")
3939
40-
**Blocks of an existing File** You can pass the generator a ``File`` id to work on, optionally passing a subset of blocks:
40+
**Blocks of an existing File** You can pass the generator a :py:class:`File<steamship.data.file.File>` id to work on, optionally passing a subset of blocks:
4141

4242
.. code-block:: python
4343
@@ -78,8 +78,8 @@ The output to a ``generate`` operation is :ref:`Blocks`. You can always get thes
7878
7979
blocks = generator_task.output.blocks
8080
81-
By default, this output is **not** saved to a ``File``. If you wish the result to be persisted,
82-
you can pass ``append_output_to_file=True`` to the call, and it will be persisted to a **new** ``File``:
81+
By default, this output is **not** saved to a :py:class:`File<steamship.data.file.File>`. If you wish the result to be persisted,
82+
you can pass ``append_output_to_file=True`` to the call, and it will be persisted to a **new** :py:class:`File<steamship.data.file.File>`:
8383

8484
.. code-block:: python
8585
@@ -90,7 +90,7 @@ you can pass ``append_output_to_file=True`` to the call, and it will be persiste
9090
blocks = generator_task.output.blocks
9191
new_file_id = blocks[0].file_id
9292
93-
If you want the output to be appended to an existing ``File``, just pass its id as well:
93+
If you want the output to be appended to an existing :py:class:`File<steamship.data.file.File>`, just pass its id as well:
9494

9595
.. code-block:: python
9696

0 commit comments

Comments
 (0)