Skip to content

Commit

Permalink
Merge pull request #199 from stackql/feature/doc-updates
Browse files Browse the repository at this point in the history
added openai microsite
  • Loading branch information
jeffreyaven authored Oct 25, 2024
2 parents 832424a + 025a18a commit ac295f3
Show file tree
Hide file tree
Showing 63 changed files with 2,488 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
if [ $PROVIDER == "root" ]; then
echo "adding vanity url redirects to _redirects file.."
touch ./build/_redirects
array=( aws azure azure-extras azure-isv azure-stack digitalocean firebase github google googleadmin k8s linode netlify okta sumologic vercel godaddy pagerduty homebrew datadog )
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 )
for i in "${array[@]}"
do
echo "adding redirects for $i"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This repository contains documentation for StackQL providers, which is published
| 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) |
| 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) |
| 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) |

| 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) |

## Adding Docs for a New Provider

Expand Down
3 changes: 2 additions & 1 deletion ci-scripts/get-providers-to-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const allProviders = [
'azure_stack',
'digitalocean',
'firebase',
'github',
'github',
'openai',
'google',
'googleadmin',
'k8s',
Expand Down
103 changes: 103 additions & 0 deletions docs/openai-docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: openai
hide_title: false
hide_table_of_contents: false
keywords:
- openai
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
custom_edit_url: null
image: /img/providers/openai/stackql-openai-provider-featured-image.png
id: openai-doc
slug: /providers/openai
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';

AI models for natural language processing and content generation.

:::info Provider Summary (v24.10.00267)

<div class="row">
<div class="providerDocColumn">
<span>total services:&nbsp;<b>17</b></span><br />
<span>total methods:&nbsp;<b>94</b></span><br />
</div>
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>35</b></span><br />
<span>total selectable resources:&nbsp;<b>23</b></span><br />
</div>
</div>

:::

See also:
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
* * *

## Installation

To pull the latest version of the `openai` provider, run the following command:

```bash
REGISTRY PULL openai;
```
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).
## Authentication

The following system environment variables are used for authentication by default:

- <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>)

These variables are sourced at runtime (from the local machine or as CI variables/secrets).

<details>

<summary>Using different environment variables</summary>

To use different environment variables (instead of the defaults), use the `--auth` flag of the `stackql` program. For example:

```bash

AUTH='{ "openai": { "type": "bearer", "credentialsenvvar": "OPENAI_API_KEY" }}'
stackql shell --auth="${AUTH}"

```
or using PowerShell:

```powershell
$Auth = "{ 'openai': { 'type': 'bearer', 'credentialsenvvar': 'OPENAI_API_KEY' }}"
stackql.exe shell --auth=$Auth
```
</details>

## Services
<div class="row">
<div class="providerDocColumn">
<a href="/providers/openai/assistants/">assistants</a><br />
<a href="/providers/openai/audio/">audio</a><br />
<a href="/providers/openai/audit_logs/">audit_logs</a><br />
<a href="/providers/openai/batch/">batch</a><br />
<a href="/providers/openai/chat/">chat</a><br />
<a href="/providers/openai/completions/">completions</a><br />
<a href="/providers/openai/embeddings/">embeddings</a><br />
<a href="/providers/openai/files/">files</a><br />
<a href="/providers/openai/fine_tuning/">fine_tuning</a><br />
</div>
<div class="providerDocColumn">
<a href="/providers/openai/images/">images</a><br />
<a href="/providers/openai/invites/">invites</a><br />
<a href="/providers/openai/models/">models</a><br />
<a href="/providers/openai/moderations/">moderations</a><br />
<a href="/providers/openai/projects/">projects</a><br />
<a href="/providers/openai/uploads/">uploads</a><br />
<a href="/providers/openai/users/">users</a><br />
<a href="/providers/openai/vector_stores/">vector_stores</a><br />
</div>
</div>
53 changes: 53 additions & 0 deletions docs/openai-docs/providers/openai/assistants/assistants/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: assistants
hide_title: false
hide_table_of_contents: false
keywords:
- assistants
- assistants
- openai
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
custom_edit_url: null
image: /img/providers/openai/stackql-openai-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>assistants</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="openai.assistants.assistants" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="id" /> | `string` | The identifier, which can be referenced in API endpoints. |
| <CopyableCode code="name" /> | `string` | The name of the assistant. The maximum length is 256 characters.<br /> |
| <CopyableCode code="description" /> | `string` | The description of the assistant. The maximum length is 512 characters.<br /> |
| <CopyableCode code="created_at" /> | `integer` | The Unix timestamp (in seconds) for when the assistant was created. |
| <CopyableCode code="instructions" /> | `string` | The system instructions that the assistant uses. The maximum length is 256,000 characters.<br /> |
| <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 /> |
| <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 /> |
| <CopyableCode code="object" /> | `string` | The object type, which is always `assistant`. |
| <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 /> |
| <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 /> |
| <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 /> |
| <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 /> |
| <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 /> |
## Methods
| Name | Accessible by | Required Params |
|:-----|:--------------|:----------------|
| <CopyableCode code="get_assistant" /> | `SELECT` | <CopyableCode code="assistant_id" /> |
| <CopyableCode code="list_assistants" /> | `SELECT` | |
| <CopyableCode code="create_assistant" /> | `INSERT` | <CopyableCode code="data__model" /> |
| <CopyableCode code="delete_assistant" /> | `DELETE` | <CopyableCode code="assistant_id" /> |
| <CopyableCode code="modify_assistant" /> | `UPDATE` | <CopyableCode code="assistant_id" /> |
51 changes: 51 additions & 0 deletions docs/openai-docs/providers/openai/assistants/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: assistants
hide_title: false
hide_table_of_contents: false
keywords:
- assistants
- openai
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
custom_edit_url: null
image: /img/providers/openai/stackql-openai-provider-featured-image.png
---

Build Assistants That Can Call Models And Use Tools.

:::info Service Summary

<div class="row">
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>5</b></span><br />
<span>total selectable resources:&nbsp;<b>5</b></span><br />
<span>total methods:&nbsp;<b>23</b></span><br />
</div>
</div>

:::

## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>openai.assistants</code></td></tr>
<tr><td><b>Type</b></td><td>Service</td></tr>
<tr><td><b>Title</b></td><td>OpenAI API - Assistants</td></tr>
<tr><td><b>Description</b></td><td>Build Assistants That Can Call Models And Use Tools.</td></tr>
<tr><td><b>Id</b></td><td><code>assistants:v24.10.00267</code></td></tr>
</tbody></table>

## Resources
<div class="row">
<div class="providerDocColumn">
<a href="/providers/openai/assistants/assistants/">assistants</a><br />
<a href="/providers/openai/assistants/messages/">messages</a><br />
<a href="/providers/openai/assistants/run_steps/">run_steps</a><br />
</div>
<div class="providerDocColumn">
<a href="/providers/openai/assistants/runs/">runs</a><br />
<a href="/providers/openai/assistants/threads/">threads</a><br />
</div>
</div>
54 changes: 54 additions & 0 deletions docs/openai-docs/providers/openai/assistants/messages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: messages
hide_title: false
hide_table_of_contents: false
keywords:
- messages
- assistants
- openai
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
custom_edit_url: null
image: /img/providers/openai/stackql-openai-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>messages</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="openai.assistants.messages" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="id" /> | `string` | The identifier, which can be referenced in API endpoints. |
| <CopyableCode code="assistant_id" /> | `string` | If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. |
| <CopyableCode code="attachments" /> | `array` | A list of files attached to the message, and the tools they were added to. |
| <CopyableCode code="completed_at" /> | `integer` | The Unix timestamp (in seconds) for when the message was completed. |
| <CopyableCode code="content" /> | `array` | The content of the message in array of text and/or images. |
| <CopyableCode code="created_at" /> | `integer` | The Unix timestamp (in seconds) for when the message was created. |
| <CopyableCode code="incomplete_at" /> | `integer` | The Unix timestamp (in seconds) for when the message was marked as incomplete. |
| <CopyableCode code="incomplete_details" /> | `object` | On an incomplete message, details about why the message is incomplete. |
| <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 /> |
| <CopyableCode code="object" /> | `string` | The object type, which is always `thread.message`. |
| <CopyableCode code="role" /> | `string` | The entity that produced the message. One of `user` or `assistant`. |
| <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. |
| <CopyableCode code="status" /> | `string` | The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. |
| <CopyableCode code="thread_id" /> | `string` | The [thread](/docs/api-reference/threads) ID that this message belongs to. |
## Methods
| Name | Accessible by | Required Params |
|:-----|:--------------|:----------------|
| <CopyableCode code="get_message" /> | `SELECT` | <CopyableCode code="message_id, thread_id" /> |
| <CopyableCode code="list_messages" /> | `SELECT` | <CopyableCode code="thread_id" /> |
| <CopyableCode code="create_message" /> | `INSERT` | <CopyableCode code="thread_id, data__content, data__role" /> |
| <CopyableCode code="delete_message" /> | `DELETE` | <CopyableCode code="message_id, thread_id" /> |
| <CopyableCode code="modify_message" /> | `UPDATE` | <CopyableCode code="message_id, thread_id" /> |
53 changes: 53 additions & 0 deletions docs/openai-docs/providers/openai/assistants/run_steps/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: run_steps
hide_title: false
hide_table_of_contents: false
keywords:
- run_steps
- assistants
- openai
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage OpenAI and ChatGPT resources using SQL.
custom_edit_url: null
image: /img/providers/openai/stackql-openai-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>run_steps</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="openai.assistants.run_steps" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="id" /> | `string` | The identifier of the run step, which can be referenced in API endpoints. |
| <CopyableCode code="assistant_id" /> | `string` | The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. |
| <CopyableCode code="cancelled_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step was cancelled. |
| <CopyableCode code="completed_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step completed. |
| <CopyableCode code="created_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step was created. |
| <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. |
| <CopyableCode code="failed_at" /> | `integer` | The Unix timestamp (in seconds) for when the run step failed. |
| <CopyableCode code="last_error" /> | `object` | The last error associated with this run step. Will be `null` if there are no errors. |
| <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 /> |
| <CopyableCode code="object" /> | `string` | The object type, which is always `thread.run.step`. |
| <CopyableCode code="run_id" /> | `string` | The ID of the [run](/docs/api-reference/runs) that this run step is a part of. |
| <CopyableCode code="status" /> | `string` | The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. |
| <CopyableCode code="step_details" /> | `object` | The details of the run step. |
| <CopyableCode code="thread_id" /> | `string` | The ID of the [thread](/docs/api-reference/threads) that was run. |
| <CopyableCode code="type" /> | `string` | The type of run step, which can be either `message_creation` or `tool_calls`. |
| <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`. |
## Methods
| Name | Accessible by | Required Params |
|:-----|:--------------|:----------------|
| <CopyableCode code="get_run_step" /> | `SELECT` | <CopyableCode code="run_id, step_id, thread_id" /> |
| <CopyableCode code="list_run_steps" /> | `SELECT` | <CopyableCode code="run_id, thread_id" /> |
Loading

0 comments on commit ac295f3

Please sign in to comment.