MyShell 백서

MyShell

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 64쪽

ame": "Sherlock", "Password": "password4", "Phone Number": "15909098787" } ] } ``` {% endcode %} {% endtab %} {% endtabs %} ### Obtain the Column Names <mark style="color:green;">`action`</mark> `query_schema` **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>URL of the public database</td><td><a href="https://myshellai.notion.site/7f0dc468d15a4810ac9a1caa7799da7a?v=a8830827ab584b70b939015d9e76bbb2&#x26;pvs=4">default_url</a></td><td>true</td></tr><tr><td>action</td><td><code>string</code></td><td>The action you want to perform</td><td>query_schema</td><td>true</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---- | ------- | -------------------------------- | --------- | | data | `array` | The column names of the database | | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { "data": [ "Phone Number", "Age", "Password", "Name" ] } ``` {% endcode %} {% endtab %} {% endtabs %} ### Query All Values of a Specific Column <mark style="color:green;">`action`</mark> `query_column` **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>URL of the public database</td><td><a href="https://myshellai.notion.site/7f0dc468d15a4810ac9a1caa7799da7a?v=a8830827ab584b70b939015d9e76bbb2&#x26;pvs=4">default_url</a></td><td>true</td></tr><tr><td>action</td><td><code>string</code></td><td>The action you want to perform</td><td>query_column</td><td>true</td></tr><tr><td>column_name</td><td><code>string</code></td><td>Colume name to query</td><td></td><td>true</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---- | ------- | ---------------------------------- | --------- | | data | `array` | The values under a specific column | | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { "data": [ "Jack", "Taylor", "Harry", "Sherlock" ] } ``` {% endcode %} {% endtab %} {% endtabs %} ### Query The Database with SQL <mark style="color:green;">`action`</mark> `query_sql` This action provides an advanced query with SQL. The table name is defined as `DATA` **Input Parameters** <table><thead><tr><th>Name</th><th width="40">Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>URL of the public database</td><td><a href="https://myshellai.notion.site/7f0dc468d15a4810ac9a1caa7799da7a?v=a8830827ab584b70b939015d9e76bbb2&#x26;pvs=4">default_url</a></td><td>true</td></tr><tr><td>action</td><td><code>string</code></td><td>The action you want to perform</td><td>query_sql</td><td>true</td></tr><tr><td>sql_str</td><td><code>string</code></td><td>SQL string to query, please use it like 'SELECT * FROM database'</td><td>SELECT * FROM DATA WHERE Age &#x3C; 18</td><td>true</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---- | ------- | ----------------------------------------------- | --------- | | data | `array` | The query results of the public Notion database | | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { "data": [ { "Age": "15", "Name": "Jack", "Password": "password1", "Phone Number": "13033331111" }, { "Age": "17", "Name": "Harry", "Password": "password3", "Phone Number": "13888883333" } ] } ``` {% endcode %} {% endtab %} {% endtabs %} ### Add Rows <mark style="color:green;">`action`</mark> `add_rows` This action provides a interface to add rows to a public notion database **Input Parameters** <table><thead><tr><th>Name</th><th width="40">Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>URL of the public database</td><td><a href="https://myshellai.notion.site/7f0dc468d15a4810ac9a1caa7799da7a?v=a8830827ab584b70b939015d9e76bbb2&#x26;pvs=4">default_url</a></td><td>true</td></tr><tr><td>action</td><td><code>string</code></td><td>The action you want to perform</td><td>add_rows</td><td>true</td></tr><tr><td>rows_info</td><td><code>string</code></td><td>Rows information to add</td><td>[{}]</td><td>true</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---- | ------- | ----------------------------------------------- | --------- | | data | `array` | The query results of the public Notion database | | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { "data": [ { "result": "success" } ] } ``` {% endcode %} {% endtab %} {% endtabs %} ## Detailed Guidelines In notion, we can type `/database` to create a database. Then click the `open as full page` as below: <figure><img src="https://content.gitbook.com/content/ltA4oqsKoJ26g4ArBpEA/blobs/UT7ZKgqEEXXFzfoeVpnv/image%20(1).png" alt=""><figcaption></figcaption></figure> click the share button and copy the url to feed into your Notion Database widget: <figure><img src="https://content.gitbook.com/content/ltA4oqsKoJ26g4ArBpEA/blobs/1oRsMvodrJcWY0zCwkEu/image%20(26).png" alt=""><figcaption></figcaption></figure> If you want to add information to the notion, you can use the`add_rows`action. The json format should follow the format like ``` [{"Name": "Jack", "Phone Number": "13033331111", "Password": "password1"}] ``` However, f you want to use it in pro config use values of variables, please note that the`"`symbols should be escaped like ```json [{\"Name\": \"{{name}}\", \"Phone Number\": \"{{phone_number}}\", \"Password\": \"{{password}}\"}] ``` The sturcture of proconfig may looks like ```json { "id": "notion_add_rows_template", "initial": "home_state", "states": { "home_state": { "inputs": { "url": { "type": "text", "description":"URL of the public database", "user_input": true }, "name": { "type": "text", "user_input": true }, "phone_number": { "type": "text", "user_input": true }, "password": { "type": "text", "user_input": true } }, "tasks": [ { "name": "any_module_example_task", "module_type": "AnyWidgetModule", "module_config": { "widget_id": "1782389035948912640", "url":"{{url}}", // this field will received value from user input "action":"add_rows", // The action you want to perform "rows_info":"[{\"Name\": \"{{name}}\", \"Phone Number\": \"{{phone_number}}\", \"Password\": \"{{password}}\"}]", // Rows information to add "output_name": "result" } } ], "render": { "text": "{{JSON.stringify(result)}}", // this widget will output a map, you can first run it and know what its type is. "buttons": [ { "content":"Try Again", "description":"", "on_click":"try_again" } ] }, "transitions": { "try_again": "home_state" } } } } ``` # OCR Given a image containing text. return the text in the images ## Try it in the Widget Center Click this [url](https://app.myshell.ai/robot-workshop/widget/1781991441343897600) to try this widget and copy the Pro Config template. ## Usage \<TODO: enter description here, and remove useless inputs> **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>URL of the jpg, this image contains text information that you want to use OCR to recognize</td><td></td><td>true</td></tr><tr><td>language</td><td><code>string</code></td><td>Main language of the content in the input image, specify the correct language will improve the ocr performance. Choose from ['EN', 'ZH', 'KR', 'JP', 'GE', 'FR']</td><td></td><td>false</td></tr><tr><td>return_image</td><td><code>boolean</code></td><td>Besides the returned list of text, return the annotated image as well</td><td>False</td><td>false</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ------ | -------- | -------------------------------------------------- | --------- | | url | `string` | The annotated ocr image url | `image` | | result | `array` | The result of ocr. A list, each element is a word. | | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { // input https://replicate.delivery/pbxt/KZczgVh1gAp7xfPP79GdZoGdKEoekcLPiqSqE6bEgM5pThGD/example_1.jpg "result": [ "R\u0026D QUALITY IMPROVEMENT", "SUGGESTION/SOLUTION FORM", "Name/Phone Ext.:M.Hamann.P.Harper.P.Martinez", "Date:", "9/3/92", "Supervisor/Manager:L.S.Wigand", "R\u0026D Group_Licensee", "Suggestion:", "Discontinue coal retention analyses on licensee submitted", "product samples.", "Note Coal Retention testing is not", "performed by most licensees. Other B\u0026w physical", "measurements as ends stability and inspection for soft", "spots in cigarettes are thought to be sufficient measures", "to assure cigarette physical integrity.", "The proposed", "action will increase laboratory productivity.)", "Suggested Solutions: Delete coal retention from the list of standard", "analyses performed on licensee submitted", "product samples. Special requests for coal", "retention testing could still be submitted on", "an exception basis.", "Have you contacted your Manager/Supervisor?", "ves", "No", "Manager Comments: Nanager, please contact suggester and forward", "comments to the Quality Council.", "dmdyb", "597005708" ], "url": "https://image.myshell.ai/image/chat/embed_obj/40295/20240423/8fd1b3ede8be4c91ace2f67ecb783ccf.jpg" // if return_image is check } ``` {% endcode %} {% endtab %} {% tab title="fail" %} {% code fullWidth="false" %} ```json Http error ``` {% endcode %} {% endtab %} {% endtabs %} ## Detailed Guidelines # Pdf to Markdown Turn pdf file into text ## Try it in the Widget Center Click this [url](https://app.myshell.ai/robot-workshop/widget/1781991889463336960) to try this widget and copy the Pro Config template. ## Usage Convert the input PDF file into markdown string **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>document</td><td><code>string</code></td><td>Provide your input file (PDF, EPUB, MOBI, XPS, FB2). Note that there should be no blank pages in the PDF.</td><td></td><td>true</td></tr><tr><td>page_range</td><td><code>integer</code></td><td>The last page you want to parse. default to -1, means all pages.</td><td>-1</td><td>false</td></tr><tr><td>parallel_factor</td><td><code>integer</code></td><td>Provide the parallel factor to use for OCR.</td><td>1</td><td>false</td></tr><tr><td>lang</td><td><code>string</code></td><td>Provide the language to use for OCR.</td><td>English</td><td>false</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---------------- | -------- | -------------------------------- | --------- | | markdown\_string | `string` | The markdown that was generated. | | | metadata\_string | `string` | The metadata of the pdf file. | | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { "markdown_string": "\n## An H1 Header\n\nParagraphs are separated by a blank line.\n\n2nd paragraph. Italic, **bold**, and monospace. Itemized lists look like:\nthis one that one the other one Note that - not considering the asterisk - the actual text content starts at 4- columns in.\n\nBlock quotes are written like so. They can span multiple paragraphs, if you like.\n\nUse 3 dashes for an em-dash. Use 2 dashes for ranges (ex., “it’s all in chapters 12– 14”). Three dots … will be converted to an ellipsis. Unicode is supported. ☺\n\n## An H2 Header\n\nHere’s a numbered list:\n\n1. first item 2. second item 3. third item\nNote again how the actual text starts at 4 columns in (4 characters from the left side). Here’s a code sample:\n# Let me re-iterate ... for i in 1 .. 10 { do-something(i) }\nAs you probably guessed, indented 4 spaces. By the way, instead of indenting the block, you can use delimited blocks, if you like:\ndefine foobar() {\n print \"Welcome to flavor country!\"; }\n(which makes copying \u0026 pasting easier). You can optionally mark the delimited block for Pandoc to syntax highlight it:\nimport time\n# Quick, count to ten!\n\nfor i in range(10): # (but not *too* quick) time.sleep(0.5) print i\n\n## An H3 Header\n\nNow a nested list:\n1. First, get these ingredients:\ncarrots celery lentils\n\n2. Boil some water. 3. Dump everything in the pot and follow this algorithm:\nfind wooden spoon uncover pot stir cover pot balance wooden spoon precariously on pot handle wait 10 minutes goto first step (or shut off burner when done)\nDo not bump wooden spoon or it will fall.\n\nNotice again how text always lines up on 4-space indents (including that last line which continues item 3 above). Here’s a link to a website, to a local doc, and to a section heading in the current doc. Here’s a footnote 1.\n\nTables can look like this:\nShoes, their sizes, and what they’re made of size material color\n9\nleather brown\n10\nhemp canvas natural\n11\nglass transparent\n(The above is the caption for the table.) Pandoc also supports multi-line tables:\n\n| keyword |\n|---------------------------|\n| red |\n| Sunsets, apples, and |\n| other red or reddish |\n| things. |\n| green |\n| Leaves, grass, frogs |\n| and other things it’s not |\n| easy being. |\n\nA horizontal rule follows. Here’s a definition list: apples Good for making applesauce. oranges Citrus! tomatoes There’s no “e” in tomatoe.\n\nAgain, text is indented 4 spaces. (Put a blank line between each term/definition pair to spread things out more.) Here’s a “line block”: Line one Line too Line tree and images can be specified like so:\n\n## Example Image\n\nInline math equations go in like so: ω = dϕ/dt. Display math should get its own line and be put in in double-dollarsigns:\n\n## I = ∫Ρr2Dv\n\nAnd note that you can backslash-escape any punctuation characters which you wish to be displayed literally, ex.: `foo`, *bar*, etc.\n\n1. Footnote text goes here.↩︎", "metadata_string": "{\"language\": \"English\", \"filetype\": \"pdf\", \"toc\": [[1, \"An h1 header\", 1], [2, \"An h2 header\", 1], [3, \"An h3 header\", 1]], \"pages\": 3, \"ocr_stats\": {\"ocr_pages\": 0, \"ocr_failed\": 0, \"ocr_success\": 0}, \"block_stats\": {\"header_footer\": 0, \"code\": 0, \"table\": 1, \"equations\": {\"successful_ocr\": 0, \"unsuccessful_ocr\": 0, \"equations\": 0}}, \"postprocess_stats\": {\"edit\": {}}}" } ``` {% endcode %} {% endtab %} {% endtabs %} # RMBG RMBG, automatic background removal, helps with image background removal ## Try it in the Widget Center Click this [url](https://app.myshell.ai/robot-workshop/widget/1781992261456158720) to try this widget and copy the Pro Config template. ## Usage Remove the background of the given image **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th width="149">Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>image</td><td><code>string</code></td><td>HTTP URL. Input image for RMBG. We will earse the background from the image. We hope this is an image with both foreground and background.</td><td><a href="https://hips.hearstapps.com/goodhousekeeping/assets/16/15/neapolitan-mastiff.jpg">default_url</a></td><td>true</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---- | -------- | ------------------------------------------------------------------------------------------------------------------------ | --------- | | url | `string` | The image that was generated has been saved as an online URL. This link is temporary, so please save it for your own use | `image` | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { "url": "https://image.myshell.ai/image/chat/embed_obj/38145/20240423/147c7f35f67049f4b849cc93d7a968ff.png" } ``` {% endcode %} {% endtab %} {% endtabs %} ## Detailed Guidelines # Stabel-Video-Diffusion Stable-video-diffusion takes an input image and other adjustment parameters to generate a dynamic video based on a static image. ## Try it in the Widget Center Click this [url](https://app.myshell.ai/robot-workshop/widget/1782009031462813696) to try this widget and copy the Pro Config template. ## Usage \<TODO: enter description here, and remove useless inputs> **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>image</td><td><code>string</code></td><td>HTTP url. Input image for stable-video-diffusion.</td><td></td><td>true</td></tr><tr><td>seed</td><td><code>integer</code></td><td>Random seed for generation process. -1 means random seed</td><td>-1</td><td>false</td></tr><tr><td>decode_chunk_size</td><td><code>integer</code></td><td>Number of frames decoded at a time! This eats most VRAM. Reduce if necessary.</td><td>5</td><td>false</td></tr><tr><td>fps</td><td><code>integer</code></td><td>Number of frames per second</td><td>7</td><td>false</td></tr><tr><td>motion_bucket_id</td><td><code>integer</code></td><td>overall motion, default to 127</td><td>127</td><td>false</td></tr><tr><td>noise_aug_strength</td><td><code>number</code></td><td>Noice augmentation strength to condition</td><td>0.02</td><td>false</td></tr></tbody></table> **Output Parameters** | Name | Type | Description | File Type | | ---- | -------- | ------------------------------------------------------------------------------------------------------------------------ | --------- | | url | `string` | The video that was generated has been saved as an online URL. This link is temporary, so please save it for your own use | `video` | **Output Example** {% tabs %} {% tab title="success" %} {% code fullWidth="false" %} ```json { // input https://image.myshell.ai/image/chat/embed_obj/40295/20240423/8555c664f6934cdeb2ef497ba4bf5d88.jpg "url": "https://cdn.myshell.ai/video/chat/embed_obj/40295/20240423/556e7792f1d143d0aa1379f8c5c85348.mp4" } ``` {% endcode %} {% endtab %} {% tab title="fail" %} {% code fullWidth="false" %} ```json { "results": "<the example results of this widget>" } ``` {% endcode %} {% endtab %} {% endtabs %} ## Detailed Guidelines # Stable Diffusion Inpaint Use any diffusion model on Civitai to inpaint the mask region of your image! ## Try it in the Widget Center Click this [url](https://app.myshell.ai/robot-workshop/widget/1782399147535691776) to try this widget and copy the Pro Config template. ## Usage Utilize diffusion model to fill in the masked region of your image! **Input Parameters** <table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>image</td><td><code>string</code></td><td>The input image, can be a url or base64 sting</td><td></td><td>true</td></tr><tr><td>mask</td><td><code>string</code></td><td>The correspond mask, can be a url or base64 sting. 1 for mask region</td><td></td><td>true</td></tr><tr><td>model</td><td><code>string</code></td><td>The model id from civitai (SD1.5, SDXL 1.0, PlaygroundV2). How to get it? Click on a model page on civitai, and copy the series number within the download link.</td><td>64094</td><td>true</td></tr><tr><td>prompt</td><td><code>string</code></td><td>The text prompt for image transformation. Add lora? add `` to your prompt. `$id` is the series number and `$weight` is the lora weight you want (always set to 1.0). You can use multi
프로젝트로 돌아가기