Skip to content

Commit ac295f3

Browse files
authored
Merge pull request #199 from stackql/feature/doc-updates
added openai microsite
2 parents 832424a + 025a18a commit ac295f3

File tree

63 files changed

+2488
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2488
-3
lines changed

.github/workflows/build-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
if [ $PROVIDER == "root" ]; then
7979
echo "adding vanity url redirects to _redirects file.."
8080
touch ./build/_redirects
81-
array=( aws azure azure-extras azure-isv azure-stack digitalocean firebase github google googleadmin k8s linode netlify okta sumologic vercel godaddy pagerduty homebrew datadog )
81+
array=( aws azure azure-extras azure-isv azure-stack digitalocean firebase github openai google googleadmin k8s linode netlify okta sumologic vercel godaddy pagerduty homebrew datadog )
8282
for i in "${array[@]}"
8383
do
8484
echo "adding redirects for $i"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This repository contains documentation for StackQL providers, which is published
2727
| Netlify Deploy Datadog | [![Netlify Status](https://api.netlify.com/api/v1/badges/9e76122d-09bd-4938-a50f-3b4196e94f0c/deploy-status)](https://app.netlify.com/sites/stackql-datadog-docs/deploys) | [datadog-docs.stackql.io](https://datadog-docs.stackql.io)<br/>[datadog.stackql.io](https://datadog.stackql.io) |
2828
| Netlify Deploy Azure ISV | [![Netlify Status](https://api.netlify.com/api/v1/badges/35fc840c-0494-462f-9b3f-cbd3418a3c78/deploy-status)](https://app.netlify.com/sites/stackql-azure-isv-docs/deploys) | [azure-isv-docs.stackql.io](https://azure-isv-docs.stackql.io)<br/>[azure-isv.stackql.io](https://azure-isv.stackql.io) |
2929
| Netlify Deploy Azure Stack | [![Netlify Status](https://api.netlify.com/api/v1/badges/53abcb20-0194-41dd-b466-4d933cfffcad/deploy-status)](https://app.netlify.com/sites/stackql-azure-stack-docs/deploys) | [azure-stack-docs.stackql.io](https://azure-stack-docs.stackql.io)<br/>[azure-stack.stackql.io](https://azure-stack.stackql.io) |
30-
30+
| Netlify Deploy OpenAI | [![Netlify Status](https://api.netlify.com/api/v1/badges/6df5743b-8c5d-4949-866e-eda4ca3f74d0/deploy-status)](https://app.netlify.com/sites/stackql-openai-docs/deploys) | [openai-docs.stackql.io](https://openai-docs.stackql.io)<br/>[openai.stackql.io](https://openai.stackql.io) |
3131

3232
## Adding Docs for a New Provider
3333

ci-scripts/get-providers-to-deploy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const allProviders = [
1414
'azure_stack',
1515
'digitalocean',
1616
'firebase',
17-
'github',
17+
'github',
18+
'openai',
1819
'google',
1920
'googleadmin',
2021
'k8s',

docs/openai-docs/index.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: openai
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- openai
7+
- stackql
8+
- infrastructure-as-code
9+
- configuration-as-data
10+
- cloud inventory
11+
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
12+
custom_edit_url: null
13+
image: /img/providers/openai/stackql-openai-provider-featured-image.png
14+
id: openai-doc
15+
slug: /providers/openai
16+
---
17+
18+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
19+
20+
AI models for natural language processing and content generation.
21+
22+
:::info Provider Summary (v24.10.00267)
23+
24+
<div class="row">
25+
<div class="providerDocColumn">
26+
<span>total services:&nbsp;<b>17</b></span><br />
27+
<span>total methods:&nbsp;<b>94</b></span><br />
28+
</div>
29+
<div class="providerDocColumn">
30+
<span>total resources:&nbsp;<b>35</b></span><br />
31+
<span>total selectable resources:&nbsp;<b>23</b></span><br />
32+
</div>
33+
</div>
34+
35+
:::
36+
37+
See also:
38+
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
39+
* * *
40+
41+
## Installation
42+
43+
To pull the latest version of the `openai` provider, run the following command:
44+
45+
```bash
46+
REGISTRY PULL openai;
47+
```
48+
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).
49+
50+
## Authentication
51+
52+
The following system environment variables are used for authentication by default:
53+
54+
- <CopyableCode code="OPENAI_API_KEY" /> - OpenAI API key (see <a href="https://platform.openai.com/account/api-keys">How to Create an OpenAI API Key</a>)
55+
56+
These variables are sourced at runtime (from the local machine or as CI variables/secrets).
57+
58+
<details>
59+
60+
<summary>Using different environment variables</summary>
61+
62+
To use different environment variables (instead of the defaults), use the `--auth` flag of the `stackql` program. For example:
63+
64+
```bash
65+
66+
AUTH='{ "openai": { "type": "bearer", "credentialsenvvar": "OPENAI_API_KEY" }}'
67+
stackql shell --auth="${AUTH}"
68+
69+
```
70+
or using PowerShell:
71+
72+
```powershell
73+
74+
$Auth = "{ 'openai': { 'type': 'bearer', 'credentialsenvvar': 'OPENAI_API_KEY' }}"
75+
stackql.exe shell --auth=$Auth
76+
77+
```
78+
</details>
79+
80+
## Services
81+
<div class="row">
82+
<div class="providerDocColumn">
83+
<a href="/providers/openai/assistants/">assistants</a><br />
84+
<a href="/providers/openai/audio/">audio</a><br />
85+
<a href="/providers/openai/audit_logs/">audit_logs</a><br />
86+
<a href="/providers/openai/batch/">batch</a><br />
87+
<a href="/providers/openai/chat/">chat</a><br />
88+
<a href="/providers/openai/completions/">completions</a><br />
89+
<a href="/providers/openai/embeddings/">embeddings</a><br />
90+
<a href="/providers/openai/files/">files</a><br />
91+
<a href="/providers/openai/fine_tuning/">fine_tuning</a><br />
92+
</div>
93+
<div class="providerDocColumn">
94+
<a href="/providers/openai/images/">images</a><br />
95+
<a href="/providers/openai/invites/">invites</a><br />
96+
<a href="/providers/openai/models/">models</a><br />
97+
<a href="/providers/openai/moderations/">moderations</a><br />
98+
<a href="/providers/openai/projects/">projects</a><br />
99+
<a href="/providers/openai/uploads/">uploads</a><br />
100+
<a href="/providers/openai/users/">users</a><br />
101+
<a href="/providers/openai/vector_stores/">vector_stores</a><br />
102+
</div>
103+
</div>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: assistants
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- assistants
7+
- assistants
8+
- openai
9+
- stackql
10+
- infrastructure-as-code
11+
- configuration-as-data
12+
- cloud inventory
13+
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
14+
custom_edit_url: null
15+
image: /img/providers/openai/stackql-openai-provider-featured-image.png
16+
---
17+
18+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
19+
20+
21+
22+
23+
## Overview
24+
<table><tbody>
25+
<tr><td><b>Name</b></td><td><code>assistants</code></td></tr>
26+
<tr><td><b>Type</b></td><td>Resource</td></tr>
27+
<tr><td><b>Id</b></td><td><CopyableCode code="openai.assistants.assistants" /></td></tr>
28+
</tbody></table>
29+
30+
## Fields
31+
| Name | Datatype | Description |
32+
|:-----|:---------|:------------|
33+
| <CopyableCode code="id" /> | `string` | The identifier, which can be referenced in API endpoints. |
34+
| <CopyableCode code="name" /> | `string` | The name of the assistant. The maximum length is 256 characters.<br /> |
35+
| <CopyableCode code="description" /> | `string` | The description of the assistant. The maximum length is 512 characters.<br /> |
36+
| <CopyableCode code="created_at" /> | `integer` | The Unix timestamp (in seconds) for when the assistant was created. |
37+
| <CopyableCode code="instructions" /> | `string` | The system instructions that the assistant uses. The maximum length is 256,000 characters.<br /> |
38+
| <CopyableCode code="metadata" /> | `object` | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.<br /> |
39+
| <CopyableCode code="model" /> | `string` | ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.<br /> |
40+
| <CopyableCode code="object" /> | `string` | The object type, which is always `assistant`. |
41+
| <CopyableCode code="response_format" /> | `` | Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models/gpt-4o), [GPT-4 Turbo](/docs/models/gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.<br /><br />Setting to `&#123; "type": "json_schema", "json_schema": &#123;...&#125; &#125;` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).<br /><br />Setting to `&#123; "type": "json_object" &#125;` enables JSON mode, which ensures the message the model generates is valid JSON.<br /><br />**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.<br /> |
42+
| <CopyableCode code="temperature" /> | `number` | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.<br /> |
43+
| <CopyableCode code="tool_resources" /> | `object` | A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.<br /> |
44+
| <CopyableCode code="tools" /> | `array` | A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.<br /> |
45+
| <CopyableCode code="top_p" /> | `number` | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.<br /><br />We generally recommend altering this or temperature but not both.<br /> |
46+
## Methods
47+
| Name | Accessible by | Required Params |
48+
|:-----|:--------------|:----------------|
49+
| <CopyableCode code="get_assistant" /> | `SELECT` | <CopyableCode code="assistant_id" /> |
50+
| <CopyableCode code="list_assistants" /> | `SELECT` | |
51+
| <CopyableCode code="create_assistant" /> | `INSERT` | <CopyableCode code="data__model" /> |
52+
| <CopyableCode code="delete_assistant" /> | `DELETE` | <CopyableCode code="assistant_id" /> |
53+
| <CopyableCode code="modify_assistant" /> | `UPDATE` | <CopyableCode code="assistant_id" /> |
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: assistants
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- assistants
7+
- openai
8+
- stackql
9+
- infrastructure-as-code
10+
- configuration-as-data
11+
- cloud inventory
12+
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
13+
custom_edit_url: null
14+
image: /img/providers/openai/stackql-openai-provider-featured-image.png
15+
---
16+
17+
Build Assistants That Can Call Models And Use Tools.
18+
19+
:::info Service Summary
20+
21+
<div class="row">
22+
<div class="providerDocColumn">
23+
<span>total resources:&nbsp;<b>5</b></span><br />
24+
<span>total selectable resources:&nbsp;<b>5</b></span><br />
25+
<span>total methods:&nbsp;<b>23</b></span><br />
26+
</div>
27+
</div>
28+
29+
:::
30+
31+
## Overview
32+
<table><tbody>
33+
<tr><td><b>Name</b></td><td><code>openai.assistants</code></td></tr>
34+
<tr><td><b>Type</b></td><td>Service</td></tr>
35+
<tr><td><b>Title</b></td><td>OpenAI API - Assistants</td></tr>
36+
<tr><td><b>Description</b></td><td>Build Assistants That Can Call Models And Use Tools.</td></tr>
37+
<tr><td><b>Id</b></td><td><code>assistants:v24.10.00267</code></td></tr>
38+
</tbody></table>
39+
40+
## Resources
41+
<div class="row">
42+
<div class="providerDocColumn">
43+
<a href="/providers/openai/assistants/assistants/">assistants</a><br />
44+
<a href="/providers/openai/assistants/messages/">messages</a><br />
45+
<a href="/providers/openai/assistants/run_steps/">run_steps</a><br />
46+
</div>
47+
<div class="providerDocColumn">
48+
<a href="/providers/openai/assistants/runs/">runs</a><br />
49+
<a href="/providers/openai/assistants/threads/">threads</a><br />
50+
</div>
51+
</div>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: messages
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- messages
7+
- assistants
8+
- openai
9+
- stackql
10+
- infrastructure-as-code
11+
- configuration-as-data
12+
- cloud inventory
13+
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
14+
custom_edit_url: null
15+
image: /img/providers/openai/stackql-openai-provider-featured-image.png
16+
---
17+
18+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
19+
20+
21+
22+
23+
## Overview
24+
<table><tbody>
25+
<tr><td><b>Name</b></td><td><code>messages</code></td></tr>
26+
<tr><td><b>Type</b></td><td>Resource</td></tr>
27+
<tr><td><b>Id</b></td><td><CopyableCode code="openai.assistants.messages" /></td></tr>
28+
</tbody></table>
29+
30+
## Fields
31+
| Name | Datatype | Description |
32+
|:-----|:---------|:------------|
33+
| <CopyableCode code="id" /> | `string` | The identifier, which can be referenced in API endpoints. |
34+
| <CopyableCode code="assistant_id" /> | `string` | If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. |
35+
| <CopyableCode code="attachments" /> | `array` | A list of files attached to the message, and the tools they were added to. |
36+
| <CopyableCode code="completed_at" /> | `integer` | The Unix timestamp (in seconds) for when the message was completed. |
37+
| <CopyableCode code="content" /> | `array` | The content of the message in array of text and/or images. |
38+
| <CopyableCode code="created_at" /> | `integer` | The Unix timestamp (in seconds) for when the message was created. |
39+
| <CopyableCode code="incomplete_at" /> | `integer` | The Unix timestamp (in seconds) for when the message was marked as incomplete. |
40+
| <CopyableCode code="incomplete_details" /> | `object` | On an incomplete message, details about why the message is incomplete. |
41+
| <CopyableCode code="metadata" /> | `object` | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.<br /> |
42+
| <CopyableCode code="object" /> | `string` | The object type, which is always `thread.message`. |
43+
| <CopyableCode code="role" /> | `string` | The entity that produced the message. One of `user` or `assistant`. |
44+
| <CopyableCode code="run_id" /> | `string` | The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. |
45+
| <CopyableCode code="status" /> | `string` | The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. |
46+
| <CopyableCode code="thread_id" /> | `string` | The [thread](/docs/api-reference/threads) ID that this message belongs to. |
47+
## Methods
48+
| Name | Accessible by | Required Params |
49+
|:-----|:--------------|:----------------|
50+
| <CopyableCode code="get_message" /> | `SELECT` | <CopyableCode code="message_id, thread_id" /> |
51+
| <CopyableCode code="list_messages" /> | `SELECT` | <CopyableCode code="thread_id" /> |
52+
| <CopyableCode code="create_message" /> | `INSERT` | <CopyableCode code="thread_id, data__content, data__role" /> |
53+
| <CopyableCode code="delete_message" /> | `DELETE` | <CopyableCode code="message_id, thread_id" /> |
54+
| <CopyableCode code="modify_message" /> | `UPDATE` | <CopyableCode code="message_id, thread_id" /> |
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: run_steps
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- run_steps
7+
- assistants
8+
- openai
9+
- stackql
10+
- infrastructure-as-code
11+
- configuration-as-data
12+
- cloud inventory
13+
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
14+
custom_edit_url: null
15+
image: /img/providers/openai/stackql-openai-provider-featured-image.png
16+
---
17+
18+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
19+
20+
21+
22+
23+
## Overview
24+
<table><tbody>
25+
<tr><td><b>Name</b></td><td><code>run_steps</code></td></tr>
26+
<tr><td><b>Type</b></td><td>Resource</td></tr>
27+
<tr><td><b>Id</b></td><td><CopyableCode code="openai.assistants.run_steps" /></td></tr>
28+
</tbody></table>
29+
30+
## Fields
31+
| Name | Datatype | Description |
32+
|:-----|:---------|:------------|
33+
| <CopyableCode code="id" /> | `string` | The identifier of the run step, which can be referenced in API endpoints. |
34+
| <CopyableCode code="assistant_id" /> | `string` | The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. |
35+
| <CopyableCode code="cancelled_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step was cancelled. |
36+
| <CopyableCode code="completed_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step completed. |
37+
| <CopyableCode code="created_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step was created. |
38+
| <CopyableCode code="expired_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. |
39+
| <CopyableCode code="failed_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step failed. |
40+
| <CopyableCode code="last_error" /> | `object` | The last error associated with this run step. Will be `null` if there are no errors. |
41+
| <CopyableCode code="metadata" /> | `object` | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.<br /> |
42+
| <CopyableCode code="object" /> | `string` | The object type, which is always `thread.run.step`. |
43+
| <CopyableCode code="run_id" /> | `string` | The ID of the [run](/docs/api-reference/runs) that this run step is a part of. |
44+
| <CopyableCode code="status" /> | `string` | The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. |
45+
| <CopyableCode code="step_details" /> | `object` | The details of the run step. |
46+
| <CopyableCode code="thread_id" /> | `string` | The ID of the [thread](/docs/api-reference/threads) that was run. |
47+
| <CopyableCode code="type" /> | `string` | The type of run step, which can be either `message_creation` or `tool_calls`. |
48+
| <CopyableCode code="usage" /> | `object` | Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. |
49+
## Methods
50+
| Name | Accessible by | Required Params |
51+
|:-----|:--------------|:----------------|
52+
| <CopyableCode code="get_run_step" /> | `SELECT` | <CopyableCode code="run_id, step_id, thread_id" /> |
53+
| <CopyableCode code="list_run_steps" /> | `SELECT` | <CopyableCode code="run_id, thread_id" /> |

0 commit comments

Comments
 (0)