Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load AI chat window #5621

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
96848e1
feat: load AI chat window
jstirnaman Sep 26, 2024
fd724c4
fix(api): Fix Cloud Dedicated /ping descriptions
jstirnaman Sep 25, 2024
a9f1072
fix(v1): update client library recommendations for v1, v3
jstirnaman Sep 26, 2024
3e43680
fix(v1): Make stable-version OSS-specific. Update API notes.
jstirnaman Sep 26, 2024
f34a61a
InfluxDB Clustered partial writes (#5594)
sanderson Sep 27, 2024
1d62703
fix: serverless/dedicated/clustered support chunked and chunk_size (#…
jeffreyssmith2nd Sep 30, 2024
1e6ee0e
docs: make description less ambiguous about what the function does
btasker Oct 2, 2024
13daf75
fix: adjust examples to do what the headers suggest
btasker Oct 2, 2024
41edaad
fix: use correct closing tag
btasker Oct 2, 2024
f3f7ffa
docs: tweak wording
btasker Oct 2, 2024
b9023c8
fix: influxdb.cardinality() can't accept an integer as start
btasker Oct 2, 2024
8bf686f
feat: add example
btasker Oct 2, 2024
7a52a2c
enable-tls add IP in san.cnf
ilario Oct 2, 2024
f9ae797
enable-tls add chown of .crt and .key to influxdb user
ilario Oct 2, 2024
5940174
Update content/influxdb/v2/admin/security/enable-tls.md
jstirnaman Oct 2, 2024
437e569
Update content/influxdb/v2/admin/security/enable-tls.md
jstirnaman Oct 2, 2024
c722780
fix(v2): v1-compat 404 due to alias typo
jstirnaman Oct 1, 2024
0db99c4
fix(v2): add IP address info to TLS config and troubleshooting explan…
jstirnaman Oct 2, 2024
b671f13
fix(influxdb): npm -y <package-name> expects an existing template
jstirnaman Sep 26, 2024
253bc79
fix(v2): remove dead native mqtt shortcut
jstirnaman Oct 3, 2024
e78d28f
chore(v2): provide additional information about the output plugin.
jstirnaman Oct 3, 2024
5a63f3f
fix(v1,v2): bad aliases causing 404s
jstirnaman Oct 3, 2024
3ed8509
fix(link): Closes #5623
jstirnaman Oct 3, 2024
1ee16ae
fix(link): Closes #5609
jstirnaman Oct 3, 2024
7a37e39
fix(link): Broken link in Chronograph Getting Started pane (Closes #5311
jstirnaman Oct 3, 2024
c8b9777
Note removal of Flux MQTT package support OSS 2.7+ (#5634)
sanderson Oct 4, 2024
5c016e2
docs: add other required fields to user setup for clustered (#5639)
david-rusnak Oct 9, 2024
aafd2c9
fix(dedicated): Update links to database token management API reference
savage-engineer Oct 11, 2024
3b75f7f
Update content/influxdb/cloud-dedicated/admin/tokens/database/create.md
jstirnaman Oct 11, 2024
9cbc010
Update content/influxdb/cloud-dedicated/admin/tokens/database/list.md
jstirnaman Oct 11, 2024
f04a860
Update content/influxdb/cloud-dedicated/admin/tokens/database/delete.md
jstirnaman Oct 11, 2024
4d798b6
Update content/influxdb/cloud-dedicated/admin/tokens/database/update.md
jstirnaman Oct 11, 2024
cd1e071
fix: Misc. typos and style
jstirnaman Oct 16, 2024
0e62742
Release influxctl v2.9.8 (#5647)
DStrand1 Oct 16, 2024
138e99c
fix(v3): broken optimize-queries links, typos, placeholder
jstirnaman Oct 17, 2024
4fe3cf7
Telegraf v1.32.1 (#5638)
srebhan Oct 17, 2024
47173a9
Reorganize InfluxDB Clustered installation documentation (#5636)
sanderson Oct 21, 2024
6e18684
InfluxDB Enterprise 1.11.7 (#5641)
sanderson Oct 22, 2024
e26094e
hotfix: fix enterprise 1.11.7 release notes title
sanderson Oct 22, 2024
e3ae2e4
enable-tls typo broken link
ilario Oct 23, 2024
1b1f6f1
chore(ai): Add org-id for site authorization.
jstirnaman Sep 30, 2024
4cace21
chore(ai): store AI workflows and custom GPT instruction sets.
jstirnaman Oct 1, 2024
40e47c1
chore(ai): add instructions directory and revise Doc instructions.
jstirnaman Oct 1, 2024
21f0fc6
WIP(ai): Added Yext AI chat for testing.
jstirnaman Oct 25, 2024
3f5a4e0
WIP(ai): Yext chat customizations
jstirnaman Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .ci/vale/styles/Google/Ordinal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ level: error
nonword: true
tokens:
- \d+(?:st|nd|rd|th)
- tenth

exceptions:
- 0th
- 50th
- 90th
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ influx3
influxctl
influxd
influxdata.com
iox
(iox|IOx)
keep-url
lat
locf
Expand Down
36 changes: 36 additions & 0 deletions ai/gpt/instructions/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Doc writes technical software documentation for InfluxData. The public web site is https://docs.influxdata.com and the source repository is https://github.com/influxdata/docs-v2.
Documentation provides step-by-step guides and reference documentation for InfluxDB and associated clients (CLIs, client libraries (SDKs), and Telegraf (https://docs.influxdata.com/telegraf/v1/)), and the legacy v1 components Kapacitor and Chronograf.

If I ask about InfluxDB version 1 (v1), use the following information:
- InfluxDB OSS v1.8+ ((https://docs.influxdata.com/influxdb/v1/)
- Enterprise v1.8+ (https://docs.influxdata.com/enterprise_influxdb/v1/) with InfluxQL and compatibility for Flux.
- InfluxDB v2 or v3 API compatibility guides for InfluxDB v1.
- `influx` CLI
If I ask about InfluxDB version 2 (v2), use the following information:
- OSS (https://docs.influxdata.com/influxdb/v2/)
- Cloud (TSM) (https://docs.influxdata.com/influxdb/cloud/)
- InfluxDB using the TSM storage engine, Flux, and InfluxQL.
- InfluxDB v1 or v3 API compatibility guides for InfluxDB v2.
- `influx` CLI
If I ask about InfluxDB version 3 (v3), use the following information:
- Cloud Serverless (https://docs.influxdata.com/influxdb/cloud-serverless/)
- Cloud Dedicated (https://docs.influxdata.com/influxdb/cloud-dedicated/)
- Clustered (https://docs.influxdata.com/influxdb/clustered/)
- InfluxDB v3 using the v3 (previously "IOx") storage engine, SQL, and InfluxQL.
- `influxctl` CLI for Cloud Dedicated and Clustered
- `influx` CLI for Cloud Serverless
- InfluxDB v3 is optimized for SQL and InfluxQL but is not optimized for FluxQL.
- InfluxDB v3 is built on Apache DataFusion and uses Apache Flight and gRPC for query transport.

If I ask about a REST API or SDK (client library) and don't specify a product, ask which product.
For API client libraries, refer to the documentation and to the source repositories in https://github.com/InfluxCommunity for the version-specific client library.

When writing documentation, always use Google Developer Documentation style guidelines and Markdown format.
If writing REST API reference documentation follow YouTube Data API style and Google Developer Documentation style guidelines.

The project uses the Hugo static site generator to build the documentation.
The site uses JavaScript and jQuery.
For information about linting, tests (using pytests for codeblocks), shortcode <shortcode_name>, refer to https://github.com/influxdata/docs-v2/blob/master/README.md and https://github.com/influxdata/docs-v2/blob/master/CONTRIBUTING.md.
If something in CONTRIBUTING.md needs clarification, then give me the suggested revision for CONTRIBUTING.md in Markdown.

The community forum is https://community.influxdata.com/ and should not be used as a primary source of information, but might contain useful suggestions or solutions to specific problems from users.
36 changes: 36 additions & 0 deletions ai/workflows/ask-product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
1. If the user asks about installing InfluxDB, then ask which version or product out of the following on-premise options:
- Clustered (https://docs.influxdata.com/influxdb/clustered/) (v3)
- OSS v2 (https://docs.influxdata.com/influxdb/v2/)
- OSS v1.8+ ((https://docs.influxdata.com/influxdb/v1/)
- Enterprise v1.8+ (https://docs.influxdata.com/enterprise_influxdb/v1/)
2. If the user asks about a REST API or SDK (client library) and doesn't specify a product, ask which product.
3. If the user asks about SDKs or client libraries, refer to the specific product documentation and to the source repositories in https://github.com/InfluxCommunity for the version-specific client library.
4. If the user doesn't specify the InfluxDB product or version they're using or want to use, then ask.
5. Use the following information to help the user identify and use a specific version of InfluxDB.
If the user's desired InfluxDB version or product doesn't match the current documentation section (URL), then suggest the appropriate URL for that product.

version 3 (v3) products:
- Cloud Dedicated https://docs.influxdata.com/influxdb/cloud-dedicated/
- Cloud Serverless (https://docs.influxdata.com/influxdb/cloud-serverless/)
- Clustered (https://docs.influxdata.com/influxdb/clustered/)
- Query using SQL or InfluxQL
- Use the `influxctl` CLI for management and light querying of Cloud Dedicated and Clustered (v3) clusters; not for Cloud Serverless
- Use the `influx` CLI for writing data in Cloud Serverless (v3); not for querying.
- Use `influxdb3-<programming_language>` v3 API client libraries (SDKs)
- Use Telegraf to write data

version 2 (v2) products:
- OSS (https://docs.influxdata.com/influxdb/v2/)
- Cloud (TSM) (https://docs.influxdata.com/influxdb/cloud/)
- Query using Flux or InfluxQL
- Use the `influx` CLI for writing and querying data and managing resources in v2.
- Use v2 API client libraries
- Use Telegraf to write data

version 1 (v1) products:
- InfluxDB OSS v1.8+ ((https://docs.influxdata.com/influxdb/v1/)
- Enterprise v1.8+ (https://docs.influxdata.com/enterprise_influxdb/v1/)
- Query using InfluxQL
- Use the `influx` CLI for writing and querying data and managing resources in v1.
- Use v1 API client libraries
- Use Telegraf to write data
77 changes: 77 additions & 0 deletions api-docs/cloud-dedicated/v1-compatibility/swaggerV1Compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,83 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/ping:
get:
description: |
Reports the InfluxQL bridge querier health and the InfluxDB version of the instance.

The response is a HTTP `204` status code to inform you the querier is available.

For InfluxDB Cloud Dedicated, this endpoint only checks the status of queriers; doesn't check the status of ingesters.

To check the health of ingesters before writing data, send a request to one of the [write endpoints](/influxdb/cloud-dedicated/api/v2/#tag/Write).

This endpoint doesn't require authentication.
operationId: GetPing
responses:
'204':
description: |
Success--the querier is available.
Headers contain InfluxDB version information.
headers:
X-Influxdb-Build:
description: |
The type of InfluxDB build.
schema:
type: string
X-Influxdb-Version:
description: |
The version of InfluxDB.
schema:
type: integer
4xx:
description: |
#### InfluxDB Cloud
- Doesn't return this error.
security:
- {}
servers: []
summary: Get the status of the instance
tags:
- Ping
head:
description: |
Reports the InfluxQL bridge querier health and the InfluxDB version of the instance.

The response is a HTTP `204` status code to inform you the querier is available.

For InfluxDB Cloud Dedicated, this endpoint only checks the status of queriers; doesn't check the status of ingesters.

To check the health of ingesters before writing data, send a request to one of the [write endpoints](/influxdb/cloud-dedicated/api/v2/#tag/Write).

This endpoint doesn't require authentication.

operationId: HeadPing
responses:
'204':
description: |
Success--the querier is available.
Headers contain InfluxDB version information.
headers:
X-Influxdb-Build:
description: The type of InfluxDB build.
schema:
type: string
X-Influxdb-Version:
description: |
The version of InfluxDB.
schema:
type: integer
4xx:
description: |
#### InfluxDB Cloud
- Doesn't return this error.
security:
- {}
servers: []
summary: Get the status of the instance
tags:
- Ping
components:
parameters:
TraceSpan:
Expand Down
22 changes: 14 additions & 8 deletions api-docs/cloud-dedicated/v2/ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,20 @@ paths:
/ping:
get:
description: |
Retrieves the status and InfluxDB version of the instance.
Reports the InfluxQL bridge querier health and the InfluxDB version of the instance.

The response is a HTTP `204` status code to inform you the querier is available.

Use this endpoint to monitor uptime for the InfluxDB instance. The response
returns a HTTP `204` status code to inform you the instance is available.
For InfluxDB Cloud Dedicated, this endpoint only checks the status of queriers; doesn't check the status of ingesters.

To check the health of ingesters before writing data, send a request to one of the [write endpoints](/influxdb/cloud-dedicated/api/v2/#tag/Write).

This endpoint doesn't require authentication.
operationId: GetPing
responses:
'204':
description: |
Success.
Success--the querier is available.
Headers contain InfluxDB version information.
headers:
X-Influxdb-Build:
Expand All @@ -184,17 +187,20 @@ paths:
- Ping
head:
description: |
Returns the status and InfluxDB version of the instance.
Reports the InfluxQL bridge querier health and the InfluxDB version of the instance.

The response is a HTTP `204` status code to inform you the querier is available.

For InfluxDB Cloud Dedicated, this endpoint only checks the status of queriers; doesn't check the status of ingesters.

Use this endpoint to monitor uptime for the InfluxDB instance. The response
returns a HTTP `204` status code to inform you the instance is available.
To check the health of ingesters before writing data, send a request to one of the [write endpoints](/influxdb/cloud-dedicated/api/v2/#tag/Write).

This endpoint doesn't require authentication.
operationId: HeadPing
responses:
'204':
description: |
Success.
Success--the querier is available.
Headers contain InfluxDB version information.
headers:
X-Influxdb-Build:
Expand Down
20 changes: 18 additions & 2 deletions api-docs/clustered/v2/ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -646,17 +646,33 @@ paths:
'204':
description: Write data is correctly formatted and accepted for writing to the database.
'400':
description: |
Data from the batch was rejected and not written. The response body indicates if a partial write occurred or all data was rejected.
If a partial write occurred, then some points from the batch are written and queryable.
The response body contains details about the [rejected points](/influxdb/clustered/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points.
content:
application/json:
examples:
rejectedAllPoints:
summary: Rejected all points
value:
code: invalid
line: 2
message: 'no data written, errors encountered on line(s): error message for first rejected point</n> error message for second rejected point</n> error message for Nth rejected point (up to 100 rejected points)'
partialWriteErrorWithRejectedPoints:
summary: Partial write rejects some points
value:
code: invalid
line: 2
message: 'partial write has occurred, errors encountered on line(s): error message for first rejected point</n> error message for second rejected point</n> error message for Nth rejected point (up to 100 rejected points)'
schema:
$ref: '#/components/schemas/LineProtocolError'
description: Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Token doesn't have sufficient permissions to write to this database or the database doesn't exist.
description: Token doesn't have sufficient permissions to write to this database or the database doesn't exist.
'403':
content:
application/json:
Expand Down
99 changes: 99 additions & 0 deletions assets/js/ai-interactions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@

const ANON_USER_ID = null;

function showAIChat() {
// Show CommandAI chat
// loadCommandAIChat();
// bootCommandAIChat(ANON_USER_ID);

// Show YextAI chat
loadYextAIChat();
bootCommandAIChat();
}

function loadCommandAIChat() {
// https://www.command.ai/docs/platform/installation/installing-in-web-app/

const ORG_ID='4df4efda';

var o=ORG_ID,n="https://api.commandbar.com",a=void 0,t=window;
function r(o,n){void 0===n&&(n=!1),"complete"!==document.readyState&&window.addEventListener("load",r.bind(null,o,n),{capture:!1,once:!0});var a=document.createElement("script");a.type="text/javascript",a.async=n,a.src=o,document.head.appendChild(a)}function e(){var e;if(void 0===t.CommandBar){delete t.__CommandBarBootstrap__;var c=Symbol.for("CommandBar::configuration"),d=Symbol.for("CommandBar::disposed"),i=Symbol.for("CommandBar::isProxy"),m=Symbol.for("CommandBar::queue"),u=Symbol.for("CommandBar::unwrap"),s=Symbol.for("CommandBar::eventSubscriptions"),l=[],p=localStorage.getItem("commandbar.lc");p&&p.includes("local")&&(n="http://localhost:8000",a=void 0);var f=Object.assign(((e={})[c]={uuid:o,api:n,cdn:a},e[d]=!1,e[i]=!0,e[m]=new Array,e[u]=function(){return f},e[s]=void 0,e),t.CommandBar),v=["addCommand","boot","addEventSubscriber","addRecordAction","setFormFactor"],b=f;Object.assign(f,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),t.CommandBar=new Proxy(f,{get:function(o,n){return n in b?f[n]:"then"!==n?v.includes(n)?function(){var o=Array.prototype.slice.call(arguments);return new Promise((function(a,t){o.unshift(n,a,t),f[m].push(o)}))}:function(){var o=Array.prototype.slice.call(arguments);o.unshift(n),f[m].push(o)}:void 0}}),null!==p&&l.push("lc=".concat(p)),l.push("version=2"),a&&l.push("cdn=".concat(encodeURIComponent(a))),r("".concat(n,"/latest/").concat(o,"?").concat(l.join("&")),!0)}}e();
}

function bootCommandAIChat(userid) {
// https://www.command.ai/docs/platform/installation/installing-in-web-app/#booting-the-command-bar
try {
(window.CommandBar) ? window.CommandBar.boot(userid) : setTimeout(() => window.CommandBar.boot(userid), 1000);
} catch (error) {
console.error('Error booting CommandBar', error);
}

}

function bootYextAIChat() {
window.ChatApp.mount({
apiKey: "c8486ab4b244e31cdba220ce07c3853d",
botId: "docs-bot",
title: "Experimental AI Chat",
// showRestartButton: true,
// onClose: () => { /* Your logic here */ },
showFeedbackButtons: true,
showTimestamp: true,
// footer: "",
// placeholder: "Type a message...",
// stream: true,
// inputAutoFocus: true,
// handleError: (e) => { /* Your error handling logic here */ },
// onSend: () => { /* Your logic here */ },
messageSuggestions: ["What is InfluxDB v3?", "How do I write data to InfluxDB?", "How do I use SQL with InfluxDB?"],
// openOnLoad: true,
// showHeartBeatAnimation: true,
// showUnreadNotification: true,
// showInitialMessagePopUp: true,
// saveToSessionStorage: true,
ctaLabel: "Experimental AI Chat",
});
}

function loadYextAIChat() {

var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://assets.sitescdn.net/chat/v0/chat.css';
document.head.appendChild(link);

var style = document.createElement('style');
style.innerHTML = `
/* You can override styles by targeting the various yext-chat classes */
#chat-app .yext-chat-panel__container {
background-color: #fff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
}
#chat-app .yext-chat-header__container {
background: linear-gradient(to right, #066FC5, #00A3FF);
background-color: #00A3FF;
color: #fff;
padding: 10px;
}
#chat-app .yext-chat-message-bubble__message__bot,
#chat-app .yext-chat-message-bubble__bubble,
#chat-app .yext-chat-message-bubble__user,
#chat-app .yext-chat-pop-up__button {
background-color: #066FC5;
color: #1d2129;
}
#chat-app .yext-chat-message-bubble__message__user {
background-color: #0084ff;
color: #fff;
}
#
`;
document.head.appendChild(style);

// https://www.yext.com/docs/ai-assistant/quick
var script = document.createElement('script');
script.src = 'https://assets.sitescdn.net/chat/v0/chat.umd.js';
script.onload = bootYextAIChat;
document.head.appendChild(script);
}
8 changes: 8 additions & 0 deletions assets/styles/layouts/article/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ a.btn {
font-size: 1.1rem;
}

&.arrow span.CaretOutlineRight {
font-size: 1.5rem;
line-height: 0;
vertical-align: sub;
display: inline-block;
margin-right: -.65rem;
}

&.small-plus {
padding: .25em;
line-height: .65rem;
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/layouts/article/_captions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
code { font-size: .9rem; }
}

p, li {
p, li, ol, ul {
& + .caption {
padding: 0;
margin: -.75rem 0 0;
Expand Down
Loading