Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8963b20
Update nav.adoc
bryanthowell-ts Nov 13, 2024
59ac5aa
Update and rename modules/ROOT/pages/spotter-in-custom-chatbot.adoc t…
bryanthowell-ts Nov 13, 2024
67a5232
Update spotter-in-custom-chatbot.adoc
bryanthowell-ts Nov 13, 2024
3423099
Update spotter-in-custom-chatbot.adoc
bryanthowell-ts Nov 13, 2024
192cadb
Update spotter-in-custom-chatbot.adoc
bryanthowell-ts Nov 13, 2024
3a27e1d
Update style-customization_intro.adoc
bryanthowell-ts Nov 13, 2024
3e56864
Update style-customization_intro.adoc
bryanthowell-ts Nov 14, 2024
bbc829b
Create placeholder.txt
bryanthowell-ts Nov 14, 2024
04827da
Add files via upload
bryanthowell-ts Nov 14, 2024
47188d1
Update style-customization_intro.adoc
bryanthowell-ts Nov 14, 2024
35acc10
Add files via upload
bryanthowell-ts Nov 14, 2024
9399bbc
Update style-customization_intro.adoc
bryanthowell-ts Nov 14, 2024
68ee5d5
broken link fixes
ShashiSubramanya Nov 15, 2024
0271690
known-isse-lb view
ShashiSubramanya Nov 15, 2024
2f7339c
known-issue update
ShashiSubramanya Nov 15, 2024
788a1fd
typo fixes, minor editorial corrections
ShashiSubramanya Nov 15, 2024
0c18437
typo fixes
ShashiSubramanya Nov 15, 2024
6d685c1
Update style-customization_intro.adoc
bryanthowell-ts Nov 15, 2024
92d7a9a
links/ref fix
ShashiSubramanya Nov 15, 2024
fbd4224
lb typo fix
ShashiSubramanya Nov 18, 2024
662b513
Update style-customization_intro.adoc
bryanthowell-ts Nov 18, 2024
373cee7
Update style-customization_intro.adoc
bryanthowell-ts Nov 18, 2024
32fba2f
Update style-customization_intro.adoc
bryanthowell-ts Nov 18, 2024
2542a28
Update style-customization_intro.adoc
bryanthowell-ts Nov 18, 2024
fca4897
Update and rename style-customization_intro.adoc to style-customizati…
bryanthowell-ts Nov 18, 2024
99028e4
Update nav.adoc
bryanthowell-ts Nov 18, 2024
0bdfd34
Update style-customization_tutorial.adoc
bryanthowell-ts Nov 18, 2024
22d8caa
Update style-customization_tutorial.adoc
bryanthowell-ts Nov 18, 2024
68e448c
Update rest-api-intro.adoc
bryanthowell-ts Nov 18, 2024
ee39edf
Update rest-api_lesson-01.adoc
bryanthowell-ts Nov 18, 2024
f9ce71c
Update rest-api_lesson-02.adoc
bryanthowell-ts Nov 18, 2024
3cbe8f6
Update rest-api_lesson-03.adoc
bryanthowell-ts Nov 18, 2024
cacc833
Update rest-api_lesson-04.adoc
bryanthowell-ts Nov 18, 2024
f02ce33
Update helper.tsx
bryanthowell-ts Nov 18, 2024
3fc53ad
Update gatsby-node.js
bryanthowell-ts Nov 18, 2024
2fb00ad
Update tse-fundamentals-intro.adoc
bryanthowell-ts Nov 18, 2024
1a5a93b
Update tse-fundamentals-lesson-01.adoc
bryanthowell-ts Nov 18, 2024
de068af
Update tse-fundamentals-lesson-02.adoc
bryanthowell-ts Nov 18, 2024
8d1947b
Update tse-fundamentals-lesson-03.adoc
bryanthowell-ts Nov 18, 2024
61c6c52
Update tse-fundamentals-lesson-04.adoc
bryanthowell-ts Nov 18, 2024
08b131a
Update tse-fundamentals-lesson-05.adoc
bryanthowell-ts Nov 18, 2024
2de4ebb
Update tse-fundamentals-lesson-06.adoc
bryanthowell-ts Nov 18, 2024
b0b157c
Update tse-fundamentals-lesson-07.adoc
bryanthowell-ts Nov 18, 2024
a282921
Update tse-fundamentals-lesson-08.adoc
bryanthowell-ts Nov 18, 2024
737282b
Update tse-fundamentals-lesson-09.adoc
bryanthowell-ts Nov 18, 2024
1104aee
Update tse-fundamentals-lesson-10.adoc
bryanthowell-ts Nov 18, 2024
b025786
Update tse-fundamentals-lesson-11.adoc
bryanthowell-ts Nov 18, 2024
1b4c4f0
Merge pull request #215 from thoughtspot/reference-menu-fix
ShashiSubramanya Nov 19, 2024
4d0a253
pageid update - double underscore
ShashiSubramanya Nov 19, 2024
219446b
Merge pull request #211 from thoughtspot/spotter-tutorials-move-1
ShashiSubramanya Nov 19, 2024
a668709
Merge branch 'release' into main
ShashiSubramanya Nov 19, 2024
acd7bca
Update style-customization_tutorial.adoc
bryanthowell-ts Nov 19, 2024
dfb9664
Merge branch 'main' into style-customization-tutorial
ShashiSubramanya Nov 20, 2024
b8a8ba4
menu reorder
ShashiSubramanya Nov 20, 2024
be74701
typo fixes and editorial changes, intro block update
ShashiSubramanya Nov 20, 2024
72f9e23
formatting fixes
ShashiSubramanya Nov 20, 2024
63f2a63
code block style fix
ShashiSubramanya Nov 20, 2024
a465db9
fig alignment
ShashiSubramanya Nov 20, 2024
a634d5b
code block formatting fix
ShashiSubramanya Nov 20, 2024
c80510d
Update style-customization_tutorial.adoc
bryanthowell-ts Nov 20, 2024
391584d
formatting fix
ShashiSubramanya Nov 20, 2024
fa19ad2
Merge pull request #213 from thoughtspot/style-customization-tutorial
ShashiSubramanya Nov 20, 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
4 changes: 2 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.createPages = async function ({ actions, graphql }) {
const pageId = e.node.pageAttributes.pageid;
if (sourceName === 'tutorials'){
const relPathSplit = relPath.split('/');
const pageIdSplit = pageId.split('_');
const pageIdSplit = pageId.split('__');
let finalPageId = pageId;
if( pageIdSplit.length > 1) {
finalPageId = pageIdSplit[1];
Expand All @@ -70,7 +70,7 @@ exports.createPages = async function ({ actions, graphql }) {
if (sourceName === 'tutorials'){
// One-level of subdirectory part of stub
const relPathSplit = relPath.split('/');
const pageIdSplit = pageId.split('_');
const pageIdSplit = pageId.split('__');
let finalPageId = pageId;
if( pageIdSplit.length > 1) {
finalPageId = pageIdSplit[1];
Expand Down
4 changes: 3 additions & 1 deletion modules/ROOT/pages/common/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
*** link:{{navprefix}}/tutorials/tse-fundamentals/lesson-09[09 - Embed full application]
*** link:{{navprefix}}/tutorials/tse-fundamentals/lesson-10[10 - Style embedded app]
*** link:{{navprefix}}/tutorials/tse-fundamentals/lesson-11[11 - Course summary]
** link:{{navprefix}}/tutorials/style-customization/tutorial[Style customization]
** link:{{navprefix}}/tutorials/rest-api/intro[REST API]
*** link:{{navprefix}}/tutorials/rest-api/lesson-01[01 - REST API overview]
*** link:{{navprefix}}/tutorials/rest-api/lesson-02[02 - Simple Python implementation]
*** link:{{navprefix}}/tutorials/rest-api/lesson-03[03 - Complex REST API workflows]
*** link:{{navprefix}}/tutorials/rest-api/lesson-04[04 - Browser JavaScript REST API implementation]

** Spotter
*** link:{{navprefix}}/tutorials/spotter/integrate-into-chatbot[Integrate Spotter into your Chatbot]
* link:{{navprefix}}/getting-started[Embed ThoughtSpot]
** link:{{navprefix}}/getting-started[Quickstart Guide]
** link:{{navprefix}}/tsembed[Embed a ThoughtSpot component]
Expand Down
67 changes: 0 additions & 67 deletions modules/ROOT/pages/spotter-in-custom-chatbot.adoc

This file was deleted.

2 changes: 1 addition & 1 deletion modules/tutorials/pages/rest-api/rest-api-intro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:toclevels: 3

:page-title: ThoughtSpot REST API tutorials
:page-pageid: rest-api_intro
:page-pageid: rest-api__intro
:page-description: This lesson covers the security setup necessary to embed ThoughtSpot into TSE applications.

This tutorial is a hands-on guide to practically working with the ThoughtSpot V2.0 REST API.
Expand Down
2 changes: 1 addition & 1 deletion modules/tutorials/pages/rest-api/rest-api_lesson-01.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:toc: true
:toclevels: 3

:page-pageid: rest-api_lesson-01
:page-pageid: rest-api__lesson-01
:description: Introduction to REST APIs and how ThoughtSpot defines the V2.0 REST API

Before you begin this lesson, check if you have done all initial activities described in the xref:rest-api-intro.adoc[tutorial introduction].
Expand Down
2 changes: 1 addition & 1 deletion modules/tutorials/pages/rest-api/rest-api_lesson-02.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:toc: true
:toclevels: 3

:page-pageid: rest-api_lesson-02
:page-pageid: rest-api__lesson-02
:description: A lesson on a simple implementation of the V2.0 using Python


Expand Down
2 changes: 1 addition & 1 deletion modules/tutorials/pages/rest-api/rest-api_lesson-03.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= Complex REST API workflows
:page-pageid: rest-api_lesson-03
:page-pageid: rest-api__lesson-03
:description: Complex REST API Workflows
:toc: true
:toclevels: 1
Expand Down
2 changes: 1 addition & 1 deletion modules/tutorials/pages/rest-api/rest-api_lesson-04.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:toc: true
:toclevels: 1

:page-pageid: rest-api_lesson-04
:page-pageid: rest-api__lesson-04
:description: Browser JavaScript REST API implementation


Expand Down
86 changes: 86 additions & 0 deletions modules/tutorials/pages/spotter/spotter-in-custom-chatbot.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
= Integrate Spotter into your chatbot
:toc: true
:toclevels: 1

:page-title: Integrate Spotter into your own Chatbot
:page-pageid: spotter__integrate-into-chatbot
:page-description: Tutorial to integrate Spotter into your own Chatbot


In this article, we'll use ThoughtSpot's https://github.com/thoughtspot/visual-embed-sdk[Visual Embed SDK^] to add analytics and interactive data visualizations to your own chatbot. To view the full code used in this tutorial, visit our link:https://codesandbox.io/p/sandbox/bodyless-sample-doc-5q3dwr[CodeSandbox^].

== Install Visual Embed SDK

----
$ npm i @thoughtspot/visual-embed-sdk
----

== Configure security and authentication

. Add the URL of the host application, which embeds ThoughtSpot visualizations, to the CSP allowlist. This includes adding the correct CORS and frame-ancestors CSP.
+
For more information, see xref:security-settings.adoc#_add_domains_to_csp_and_cors_allowlists[Security settings].

. Configure the authentication scheme that works best for your use case.
+
Read the https://developers.thoughtspot.com/docs/embed-auth[Authentication documentation] and choose the scheme that best suits your implementation.
+
In this tutorial, we'll use `AuthType.None`. We assume you are logged into your ThoughtSpot instance in a different browser tab.

== Get the data model

Make sure you have already connected your database and created a ThoughtSpot data model. Log into your instance to get the `id` of the data model you want to use.

For this tutorial, we'll use the link:https://try-everywhere.thoughtspot.cloud/#/everywhere[demo^] Thoughtspot instance with a sample data model.

== Initialize the SDK

[source,javascript]
----
import {
BodylessConversation,
init,
AuthType,
} from "@thoughtspot/visual-embed-sdk";

init({
thoughtSpotHost: "https://<your-instance>.thoughtspot.cloud",
authType: AuthType.None, // Or your authentication scheme.
});
----

== Create a conversation

To use the Spotter conversational analytics, let's start by creating a new conversation. This conversation holds the context of all messages sent to ThoughtSpot by your bot. This enables a truly conversational experience for your chatbot users.

[source,javascript]
----
const conversation = new BodylessConversation({
worksheetId: "<data-model-id>",
});
----

== Send messages and get interactive visualizations in response

After creating a conversation, we'll use it to send messages to the ThoughtSpot Spotter AI. Spotter evaluates and generates data on your data model, and returns a visualization in response.

[source,javascript]
----
// Get the response from ThoughtSpot Spotter
const { container } = await conversation.sendMessage(message);

// Create a new DOM element, to host the visualization returned above.
const div = document.createElement("div");

// Add any styling you might want to this element.
div.classList.add("viz");
// Add the container of the visualization as contents to this dom element.
div.append(container);
// insert the DOM into your application.
app.insertAdjacentElement("beforeend", div);
----

== That's all!

And that’s a wrap! This was a super quick tutorial on how to use Spotter embed APIs to integrate conversational analytics with your chatbot!
Visit the link:https://codesandbox.io/p/sandbox/bodyless-sample-doc-5q3dwr[CodeSandbox^] to see it in action in a sample chatbot we created.

This file was deleted.

Loading
Loading