Skip to content

Commit

Permalink
Merge pull request #200 from stackql/feature/doc-updates
Browse files Browse the repository at this point in the history
added anthropic
  • Loading branch information
jeffreyaven authored Oct 30, 2024
2 parents ac295f3 + aa82f49 commit f802f59
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 6 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 openai 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 anthropic 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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ This repository contains documentation for StackQL providers, which is published
| 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) |
| Netlify Deploy Anthropic | [![Netlify Status](https://api.netlify.com/api/v1/badges/114c5a2a-9b76-4941-a0e8-3669ee7d2016/deploy-status)](https://app.netlify.com/sites/stackql-anthropic-docs/deploys) | [anthropic-docs.stackql.io](https://anthropic-docs.stackql.io)<br/>[anthropic.stackql.io](https://anthropic.stackql.io) |


## Adding Docs for a New Provider

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

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

AI models including Claude for advanced language understanding and generation.

:::info Provider Summary (v24.10.00267)

<div class="row">
<div class="providerDocColumn">
<span>total services:&nbsp;<b>1</b></span><br />
<span>total methods:&nbsp;<b>2</b></span><br />
</div>
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>2</b></span><br />
<span>total selectable resources:&nbsp;<b>2</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 `anthropic` provider, run the following command:

```bash
REGISTRY PULL anthropic;
```
> 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="ANTHROPIC_API_KEY" /> - Anthropic API key (see <a href="https://docs.anthropic.com/claude/reference/getting-started-with-the-api">How to Create an Anthropic 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='{ "anthropic": { "type": "bearer", "credentialsenvvar": "MY_ANTHROPIC_API_KEY" }}'
stackql shell --auth="${AUTH}"

```
or using PowerShell:

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

## Services
<div class="row">
<div class="providerDocColumn">
<a href="/providers/anthropic/messages/">messages</a><br />
</div>
<div class="providerDocColumn">
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: claude_35_chat
hide_title: false
hide_table_of_contents: false
keywords:
- claude_35_chat
- messages
- anthropic
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage Anthropic resources using SQL.
custom_edit_url: null
image: /img/providers/anthropic/stackql-anthropic-provider-featured-image.png
---

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




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

## Fields
> This resource is a view. For the view definition, please refer to the provider spec in the [stackql-provider-registry](https://github.com/stackql/stackql-provider-registry/blob/dev/providers/src/anthropic/v00.00.00000/services/messages.yaml), located under `components -> x-stackQL-resources -> claude_35_chat`.
| Name | Datatype |
|:-----|:---------|
| <CopyableCode code="content" /> ||
| <CopyableCode code="input_tokens" /> | `text` |
| <CopyableCode code="model" /> | `text` |
| <CopyableCode code="output_tokens" /> | `text` |
| <CopyableCode code="role" /> | `text` |
| <CopyableCode code="stop_reason" /> | `text` |
| <CopyableCode code="stop_sequence" /> | `text` |
## Methods
No additional methods available for this resource
48 changes: 48 additions & 0 deletions docs/anthropic-docs/providers/anthropic/messages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: messages
hide_title: false
hide_table_of_contents: false
keywords:
- messages
- anthropic
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy, and manage Anthropic resources using SQL.
custom_edit_url: null
image: /img/providers/anthropic/stackql-anthropic-provider-featured-image.png
---

Given A List Of Messages Comprising A Conversation, The Model Will Return A Response.

:::info Service Summary

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

:::

## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>anthropic.messages</code></td></tr>
<tr><td><b>Type</b></td><td>Service</td></tr>
<tr><td><b>Title</b></td><td>Anthropic API - Messages</td></tr>
<tr><td><b>Description</b></td><td>Given A List Of Messages Comprising A Conversation, The Model Will Return A Response.</td></tr>
<tr><td><b>Id</b></td><td><code>messages:v24.10.00267</code></td></tr>
</tbody></table>

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

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




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

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="id" /> | `string` | Unique object identifier. |
| <CopyableCode code="content" /> | `array` | The generated content blocks by the model. |
| <CopyableCode code="model" /> | `string` | The model that handled the request. |
| <CopyableCode code="role" /> | `string` | The conversational role of the generated message. |
| <CopyableCode code="stop_reason" /> | `string` | The reason the model stopped generating. |
| <CopyableCode code="stop_sequence" /> | `string` | The stop sequence that caused the model to stop, if applicable. |
| <CopyableCode code="type" /> | `string` | Object type, which is always "message" for Messages API. |
| <CopyableCode code="usage" /> | `object` | Information about token usage and rate limits. |
## Methods
| Name | Accessible by | Required Params |
|:-----|:--------------|:----------------|
| <CopyableCode code="create_message" /> | `SELECT` | <CopyableCode code="anthropic-version, data__max_tokens, data__messages, data__model" /> |
20 changes: 20 additions & 0 deletions docs/anthropic-docs/stackql-provider-registry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: StackQL Provider Registry
hide_title: true
hide_table_of_contents: true
keywords:
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query and Deploy Cloud Infrastructure and Resources using SQL
custom_edit_url: null
image: https://storage.googleapis.com/stackql-web-assets/blog/stackql-blog-post-featured-image.png
slug: /
---
import RegistryPage from '@site/src/shared/shared-stackql-provider-registry.mdx';

<RegistryPage currentProvider="anthropic" />

---

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"start:firebase": "export REGISTRY=firebase && docusaurus start",
"start:github": "export REGISTRY=github && docusaurus start",
"start:openai": "export REGISTRY=openai && docusaurus start",
"start:anthropic": "export REGISTRY=anthropic && docusaurus start",
"start:google": "export REGISTRY=google && docusaurus start",
"start:k8s": "export REGISTRY=k8s && docusaurus start",
"start:netlify": "export REGISTRY=netlify && docusaurus start",
Expand All @@ -34,6 +35,7 @@
"build:firebase": "export REGISTRY=firebase && docusaurus build",
"build:github": "export REGISTRY=github && docusaurus build",
"build:openai": "export REGISTRY=openai && docusaurus build",
"build:anthropic": "export REGISTRY=anthropic && docusaurus build",
"build:google": "export REGISTRY=google && docusaurus build",
"build:k8s": "export REGISTRY=k8s && docusaurus build",
"build:netlify": "export REGISTRY=netlify && docusaurus build",
Expand Down
22 changes: 22 additions & 0 deletions scripts/docgen/provider_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@
"""

provider_data = {
'anthropic': {
'meta_description': 'Query, deploy, and manage Anthropic resources using SQL.',
'description': 'AI models including Claude for advanced language understanding and generation.',
'image': '/img/providers/anthropic/stackql-anthropic-provider-featured-image.png'
},
'openai': {
'meta_description': 'Query, deploy, and manage OpenAI and ChatGPT resources using SQL.',
'description': 'AI models for natural language processing and content generation.',
Expand Down Expand Up @@ -240,6 +245,23 @@

auth_blocks = {
#
# Anthropic
#
'anthropic': {
'custom': False,
'variables': """
- <CopyableCode code="ANTHROPIC_API_KEY" /> - Anthropic API key (see <a href="https://docs.anthropic.com/claude/reference/getting-started-with-the-api">How to Create an Anthropic API Key</a>)
""",
'linux': """
AUTH='{ "anthropic": { "type": "bearer", "credentialsenvvar": "MY_ANTHROPIC_API_KEY" }}'
stackql shell --auth="${AUTH}"
""",
'windows': """
$Auth = "{ 'anthropic': { 'type': 'bearer', 'credentialsenvvar': 'MY_ANTHROPIC_API_KEY' }}"
stackql.exe shell --auth=$Auth
""",
},
#
# OpenAI
#
'openai': {
Expand Down
11 changes: 6 additions & 5 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ const isLocal = process.env.NODE_ENV=== 'development'
const registry = process.env.REGISTRY || 'root'

const providers = [
{name: 'aws'},
{name: 'azure'},
{name: 'google'},
{name: 'googleadmin'},
{name: 'azure'},
{name: 'aws'},
{name: 'digitalocean'},
{name: 'github'},
{name: 'openai'},
{name: 'anthropic'},
{name: 'linode'},
{name: 'netlify'},
{name: 'okta'},
{name: 'azure_extras'},
{name: 'azure_isv'},
{name: 'azure_stack'},
{name: 'sumologic'},
{name: 'firebase'},
{name: 'k8s'},
Expand All @@ -35,6 +33,9 @@ const providers = [
{name: 'datadog'},
{name: 'godaddy'},
{name: 'homebrew'},
{name: 'azure_extras'},
{name: 'azure_isv'},
{name: 'azure_stack'},
]

const getProviderSiteUrl = (name) =>{
Expand Down
1 change: 1 addition & 0 deletions src/configs/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const providers = [
{name: 'digitalocean', description: 'Cloud computing services and Infrastructure as a Service (IaaS).', title: 'Digital Ocean'},
{name: 'github', description: 'Web-based version-control and collaboration.', title: 'GitHub'},
{name: 'openai', description: 'AI models and services by OpenAI.', title: 'OpenAI'},
{name: 'anthropic', description: 'AI language models and services powered by Claude.', title: 'Anthropic'},
{name: 'linode', description: 'Cloud computing services by Akamai.', title: 'Linode'},
{name: 'netlify', description: 'Web development and content distribution platform.', title: 'Netlify'},
{name: 'okta', description: 'Authentication and authorization services.', title: 'Okta'},
Expand Down
Binary file added static/img/providers/anthropic/anthropic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f802f59

Please sign in to comment.