-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into examples-ux
- Loading branch information
Showing
44 changed files
with
918 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
bots/migrations/0053_alter_publishedrun_workflow_alter_savedrun_workflow_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Generated by Django 4.2.7 on 2023-12-21 15:25 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("bots", "0052_alter_publishedrun_options_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="publishedrun", | ||
name="workflow", | ||
field=models.IntegerField( | ||
choices=[ | ||
(1, "Doc Search"), | ||
(2, "Doc Summary"), | ||
(3, "Google GPT"), | ||
(4, "Copilot"), | ||
(5, "Lipysnc + TTS"), | ||
(6, "Text to Speech"), | ||
(7, "Speech Recognition"), | ||
(8, "Lipsync"), | ||
(9, "Deforum Animation"), | ||
(10, "Compare Text2Img"), | ||
(11, "Text2Audio"), | ||
(12, "Img2Img"), | ||
(13, "Face Inpainting"), | ||
(14, "Google Image Gen"), | ||
(15, "Compare AI Upscalers"), | ||
(16, "SEO Summary"), | ||
(17, "Email Face Inpainting"), | ||
(18, "Social Lookup Email"), | ||
(19, "Object Inpainting"), | ||
(20, "Image Segmentation"), | ||
(21, "Compare LLM"), | ||
(22, "Chyron Plant"), | ||
(23, "Letter Writer"), | ||
(24, "Smart GPT"), | ||
(25, "AI QR Code"), | ||
(26, "Doc Extract"), | ||
(27, "Related QnA Maker"), | ||
(28, "Related QnA Maker Doc"), | ||
(29, "Embeddings"), | ||
(30, "Bulk Runner"), | ||
(31, "Bulk Evaluator"), | ||
] | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="savedrun", | ||
name="workflow", | ||
field=models.IntegerField( | ||
choices=[ | ||
(1, "Doc Search"), | ||
(2, "Doc Summary"), | ||
(3, "Google GPT"), | ||
(4, "Copilot"), | ||
(5, "Lipysnc + TTS"), | ||
(6, "Text to Speech"), | ||
(7, "Speech Recognition"), | ||
(8, "Lipsync"), | ||
(9, "Deforum Animation"), | ||
(10, "Compare Text2Img"), | ||
(11, "Text2Audio"), | ||
(12, "Img2Img"), | ||
(13, "Face Inpainting"), | ||
(14, "Google Image Gen"), | ||
(15, "Compare AI Upscalers"), | ||
(16, "SEO Summary"), | ||
(17, "Email Face Inpainting"), | ||
(18, "Social Lookup Email"), | ||
(19, "Object Inpainting"), | ||
(20, "Image Segmentation"), | ||
(21, "Compare LLM"), | ||
(22, "Chyron Plant"), | ||
(23, "Letter Writer"), | ||
(24, "Smart GPT"), | ||
(25, "AI QR Code"), | ||
(26, "Doc Extract"), | ||
(27, "Related QnA Maker"), | ||
(28, "Related QnA Maker Doc"), | ||
(29, "Embeddings"), | ||
(30, "Bulk Runner"), | ||
(31, "Bulk Evaluator"), | ||
], | ||
default=4, | ||
), | ||
), | ||
migrations.AddIndex( | ||
model_name="publishedrun", | ||
index=models.Index( | ||
fields=[ | ||
"workflow", | ||
"visibility", | ||
"is_approved_example", | ||
"published_run_id", | ||
], | ||
name="bots_publis_workflo_d3ad4e_idx", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,19 +93,20 @@ def api_example_generator( | |
""" | ||
1. Generate an api key [below👇](#api-keys) | ||
2. Install [curl](https://everything.curl.dev/get) & add the `GOOEY_API_KEY` to your environment variables. | ||
Never store the api key [in your code](https://12factor.net/config). | ||
2. Install [curl](https://everything.curl.dev/get) & add the `GOOEY_API_KEY` to your environment variables. | ||
Never store the api key [in your code](https://12factor.net/config). | ||
```bash | ||
export GOOEY_API_KEY=sk-xxxx | ||
``` | ||
3. Run the following `curl` command in your terminal. | ||
3. Run the following `curl` command in your terminal. | ||
If you encounter any issues, write to us at [email protected] and make sure to include the full curl command and the error message. | ||
```bash | ||
%s | ||
``` | ||
""" | ||
% curl_code.strip() | ||
% curl_code.strip(), | ||
unsafe_allow_html=True, | ||
) | ||
|
||
with python: | ||
|
@@ -157,8 +158,8 @@ def api_example_generator( | |
) | ||
if as_async: | ||
py_code += r""" | ||
from time import sleep | ||
from time import sleep | ||
status_url = response.headers["Location"] | ||
while True: | ||
response = requests.get(status_url, headers={"Authorization": "%(auth_keyword)s " + os.environ["GOOEY_API_KEY"]}) | ||
|
@@ -188,20 +189,21 @@ def api_example_generator( | |
rf""" | ||
1. Generate an api key [below👇](#api-keys) | ||
2. Install [requests](https://requests.readthedocs.io/en/latest/) & add the `GOOEY_API_KEY` to your environment variables. | ||
Never store the api key [in your code](https://12factor.net/config). | ||
2. Install [requests](https://requests.readthedocs.io/en/latest/) & add the `GOOEY_API_KEY` to your environment variables. | ||
Never store the api key [in your code](https://12factor.net/config). | ||
```bash | ||
$ python3 -m pip install requests | ||
$ export GOOEY_API_KEY=sk-xxxx | ||
``` | ||
3. Use this sample code to call the API. | ||
3. Use this sample code to call the API. | ||
If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message. | ||
```python | ||
%s | ||
``` | ||
""" | ||
% py_code | ||
% py_code, | ||
unsafe_allow_html=True, | ||
) | ||
|
||
with js: | ||
|
@@ -276,7 +278,7 @@ def api_example_generator( | |
if (!response.ok) { | ||
throw new Error(response.status); | ||
} | ||
const result = await response.json(); | ||
if (result.status === "completed") { | ||
console.log(response.status, result); | ||
|
@@ -302,18 +304,19 @@ def api_example_generator( | |
r""" | ||
1. Generate an api key [below👇](#api-keys) | ||
2. Install [node-fetch](https://www.npmjs.com/package/node-fetch) & add the `GOOEY_API_KEY` to your environment variables. | ||
Never store the api key [in your code](https://12factor.net/config) and don't use direcly in the browser. | ||
2. Install [node-fetch](https://www.npmjs.com/package/node-fetch) & add the `GOOEY_API_KEY` to your environment variables. | ||
Never store the api key [in your code](https://12factor.net/config) and don't use direcly in the browser. | ||
```bash | ||
$ npm install node-fetch | ||
$ export GOOEY_API_KEY=sk-xxxx | ||
``` | ||
3. Use this sample code to call the API. | ||
3. Use this sample code to call the API. | ||
If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message. | ||
```js | ||
%s | ||
``` | ||
""" | ||
% js_code | ||
% js_code, | ||
unsafe_allow_html=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.