diff options
| author | pablof7z <p@f7z.io> | 2023-07-03 14:33:17 +0200 |
|---|---|---|
| committer | pablof7z <p@f7z.io> | 2023-07-03 14:33:17 +0200 |
| commit | 71803c21a6bdd2413244a47752c129e3c64eaec6 (patch) | |
| tree | f5560cbd6fede10822d4c8fcd9a7d2626718e1d0 | |
| parent | 67e950a2009e81df1b8c91b0a2ade0596e83f168 (diff) | |
Add examples
| -rw-r--r-- | vending-machine.md | 84 |
1 files changed, 82 insertions, 2 deletions
diff --git a/vending-machine.md b/vending-machine.md index 273aa28..a94cd33 100644 --- a/vending-machine.md +++ b/vending-machine.md | |||
| @@ -77,8 +77,8 @@ Specified the input that the job should be executed with. | |||
| 77 | * `<input-type>`: The way this argument should be interpreted | 77 | * `<input-type>`: The way this argument should be interpreted |
| 78 | * Possible values: | 78 | * Possible values: |
| 79 | * `url`: a URL to be fetched | 79 | * `url`: a URL to be fetched |
| 80 | * `event`: a different event ID | 80 | * `event`: a nostr event ID |
| 81 | * `job`: the output of a previous job | 81 | * `job`: the output of a previous job with the specified event ID |
| 82 | * `<marker>`: | 82 | * `<marker>`: |
| 83 | 83 | ||
| 84 | #### `relays` tag | 84 | #### `relays` tag |
| @@ -161,3 +161,83 @@ It's out of scope (and undesirable) to have this NIP address this issue; the mar | |||
| 161 | ### Multitple job acceptance | 161 | ### Multitple job acceptance |
| 162 | * Nothing prevents a user from accepting multiple job results. | 162 | * Nothing prevents a user from accepting multiple job results. |
| 163 | 163 | ||
| 164 | # Appendix 1: Examples | ||
| 165 | |||
| 166 | ## Customer wants to get a transcript of a podcast from second 900 to 930. | ||
| 167 | |||
| 168 | ### `kind:68001`: Job Request | ||
| 169 | ```json | ||
| 170 | { | ||
| 171 | "id": "12345", | ||
| 172 | "pubkey": "abcdef", | ||
| 173 | "content": "I need a transcript of Bitcoin.review", | ||
| 174 | "tags": [ | ||
| 175 | [ "j", "speech-to-text" ], | ||
| 176 | [ "params", "range", "900", "930" ], | ||
| 177 | [ "input", "https://bitcoin.review/episode1.mp3", "url" ], | ||
| 178 | [ "bid", "5000", "9000" ] | ||
| 179 | ] | ||
| 180 | } | ||
| 181 | ``` | ||
| 182 | |||
| 183 | ### `kind:1021`: Job fulfillment | ||
| 184 | ```json | ||
| 185 | { | ||
| 186 | "content": "Person 1: blah blah blah", | ||
| 187 | "tags": [ | ||
| 188 | ["e", "12345"], | ||
| 189 | ["p", "abcdef"], | ||
| 190 | ["status", "success"] | ||
| 191 | ] | ||
| 192 | } | ||
| 193 | ``` | ||
| 194 | |||
| 195 | ## Customer wants to get a summarization of a podcast | ||
| 196 | |||
| 197 | User publishes two job requests at the same time in the order they should be executed. | ||
| 198 | |||
| 199 | ### `kind:68001`: Job Request #1 | ||
| 200 | ```json | ||
| 201 | { | ||
| 202 | "id": "12345", | ||
| 203 | "pubkey": "abcdef", | ||
| 204 | "content": "I need a transcript of Bitcoin.review from second 900 to 930", | ||
| 205 | "tags": [ | ||
| 206 | [ "j", "speech-to-text" ], | ||
| 207 | [ "params", "range", "900", "930" ], | ||
| 208 | [ "input", "https://bitcoin.review/episode1.mp3", "url" ], | ||
| 209 | [ "bid", "5000", "9000" ] | ||
| 210 | ] | ||
| 211 | } | ||
| 212 | ``` | ||
| 213 | |||
| 214 | ### `kind:68001`: Job Request #2 | ||
| 215 | ```json | ||
| 216 | { | ||
| 217 | "id": "12346", | ||
| 218 | "pubkey": "abcdef", | ||
| 219 | "content": "I need a summarization", | ||
| 220 | "tags": [ | ||
| 221 | [ "j", "summarization" ], | ||
| 222 | [ "params", "length", "3 paragraphs" ], | ||
| 223 | [ "input", "12346", "job" ], | ||
| 224 | [ "bid", "300", "900" ] | ||
| 225 | ] | ||
| 226 | } | ||
| 227 | ``` | ||
| 228 | |||
| 229 | ## Customer wants a translation of a note | ||
| 230 | ### `kind:68001`: Job Request #1 | ||
| 231 | ```json | ||
| 232 | { | ||
| 233 | "id": "12346", | ||
| 234 | "pubkey": "abcdef", | ||
| 235 | "content": "", | ||
| 236 | "tags": [ | ||
| 237 | [ "j", "translation" ], | ||
| 238 | [ "input", "<hexid>", "event" ] | ||
| 239 | [ "params", "language", "es_AR" ], | ||
| 240 | [ "bid", "100", "500" ] | ||
| 241 | ] | ||
| 242 | } | ||
| 243 | ``` \ No newline at end of file | ||