File size: 1,944 Bytes
b115d50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from __future__ import annotations

from typing import List, Optional

from steamship.base.request import Request
from steamship.base.response import Response
from steamship.data.block import Block


class GenerateRequest(Request):
    """This class provides the input for a request to a Generator.  There are several ways to specify the input; see below"""

    # Input Specification
    # You must select one of several ways to specify input for a generator. These are exclusive.
    # 1 - A span of Blocks on a File
    # 2 - Raw text
    # 3 - A query for Blocks
    # 4 - (coming soon) A public URL of content
    # 5 - (coming soon) Raw bytes of content

    # Must specify plugin instance to use
    plugin_instance: str = None

    # May specify blocks by their file_id. If so, may specify start and end index
    input_file_id: str = None
    input_file_start_block_index: int = None
    input_file_end_block_index: Optional[
        int
    ] = None  # EXCLUSIVE end index, like most programming languages

    # May specify raw text
    text: Optional[str] = None

    # May specify raw bytes (ex. an image, audio) [Not yet implemented]
    # bytes: Optional[bytes] = None

    # May specify a block query. This may produce input blocks from multiple files.
    block_query: Optional[str] = None

    # May specify a public URL to fetch the data from. [Not yet implemented]
    # url: Optional[str] = None

    # Desired output specification

    # Whether we want the output appended to a file
    append_output_to_file: bool = False

    # May specify a file to which to append the results.  This may be the same file as
    # the input or not.  If appendOutputToFile is true but the outputFileId is not set,
    # create a new file.
    output_file_id: Optional[str] = None

    # Arbitrary runtime options which may be passed to a generator
    options: Optional[dict]


class GenerateResponse(Response):
    blocks: List[Block]