Skip to content

Commit

Permalink
add azure sample, implement various typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
valgaze committed Jul 10, 2024
1 parent 1cf17bd commit 8a5ba99
Show file tree
Hide file tree
Showing 32 changed files with 2,313 additions and 109 deletions.
60 changes: 55 additions & 5 deletions docs/.vitepress/components/monaco.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,35 @@ onMounted(() => {
type HeaderConfig = {
iconURL?: string;
backgroundColor?: ColorChoices;
backgroundColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
rtl?: boolean;
iconSize?: SizeChoices;
iconAlignment?: AlignmentChoices;
iconWidth?: number;
iconRound?: boolean;
textSize?: SizeChoices;
textAlign?: AlignmentChoices;
textColor?: ColorChoices;
textColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
};
type SizeChoices =
| "Small"
Expand All @@ -105,7 +125,17 @@ type SizeChoices =
addBlock(
content: string | CardBuilder,
config: {
backgroundColor?: ColorChoices;
backgroundColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
vertAlign?: VAlignChoices;
} = {}
): CardBuilder;
Expand All @@ -126,8 +156,28 @@ type SizeChoices =
config: {
size?: SizeChoices;
align?: AlignmentChoices;
color?: ColorChoices;
backgroundColor?: ColorChoices;
color?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
backgroundColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
vertAlign?: VAlignChoices;
} = {}): CardBuilder;
addChips(
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/components/token_handler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ const store = useCustomStore();
const label = ref("⭐️");
const emit = defineEmits();
const checkToken = async (tokenCandidate: string) => {
if (!tokenCandidate) store.invalidateToken();
if (tokenCandidate.length > 5) {
await store.validateToken(tokenCandidate);
if (store.state.tokenValid) {
emit("tokenValidated", { valid: true });
} else {
}
}
};
Expand Down
13 changes: 13 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export default defineConfig({
text: "🔥 Deploy to Worker ",
link: "/examples/worker/README",
},

{
text: "🔗 Bot + Azure LLM",
link: "/examples/azure/README",
},
{
text: "🦖 Deploy to Deno",
link: "/examples/deno/README",
Expand Down Expand Up @@ -77,6 +82,10 @@ export default defineConfig({
{
text: `v${version}`,
items: [
{
text: "NPM Package",
link: "https://www.npmjs.com/package/speedybot",
},
{
text: "Release Notes",
link: "https://github.com/valgaze/speedybot/releases",
Expand Down Expand Up @@ -119,6 +128,10 @@ export default defineConfig({
text: "🦖 Deploy to Deno",
link: "/examples/deno/README",
},
{
text: "🔗 Bot + Azure LLM",
link: "/examples/azure/README",
},
{
text: "🌐 Deploy to Server ",
link: "/examples/standard-server/README",
Expand Down
5 changes: 5 additions & 0 deletions docs/.vitepress/util/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function addWebhook(webhook: Webhook) {
store.webhooks.push(webhook);
}

async function invalidateToken() {
store.tokenValid = false;
}

async function validateToken(tokenCandidate: string): Promise<void | boolean> {
const loading = ElLoading.service({
lock: true,
Expand Down Expand Up @@ -141,6 +145,7 @@ export const storeHelper = {
setToken,
addWebhook,
validateToken,
invalidateToken,
cycle,
setSearchlevel,
};
Expand Down
46 changes: 44 additions & 2 deletions docs/api-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ npm install speedybot

## SpeedyBot basics

You can get a bot up and running fast by grabbing one of the batteries-included samples at **[https://speedybot.js.org/examples](https://speedybot.js.org/examples/)** and see how SpeedyBot has you covered for crafting bots that can do it all-- **[securely integrate w/ LLMs + content management systems](https://speedybot.js.org/examples/voiceflow/README)**, **[process file-uploads](https://speedybot.js.org/patterns.md#handle-file-uploads)**, **[segment content based on user data + behavior](https://speedybot.js.org/patterns.md#restrict-emails)**, create + manage **[SpeedyCards](https://speedybot.js.org/speedycard)**, **[ask for a user's location in a privacy-respecting way](https://speedybot.js.org/examples/location/README)** and lots more.
You can get a bot up and running fast by grabbing one of the batteries-included samples at **[https://speedybot.js.org/examples](https://speedybot.js.org/examples/)** and see how SpeedyBot has you covered for crafting bots that can do it all-- **[securely integrate w/ LLMs + content management systems](https://speedybot.js.org/examples/voiceflow/README)**, **[process file-uploads](https://speedybot.js.org/patterns#handle-file-uploads)**, **[segment content based on user data + behavior](https://speedybot.js.org/patterns#restrict-emails)**, create + manage **[SpeedyCards](https://speedybot.js.org/speedycard)**, **[ask for a user's location in a privacy-respecting way](https://speedybot.js.org/examples/location/README)** and lots more.

## The basics

Expand Down Expand Up @@ -100,7 +100,7 @@ Bot.addStep(async ($) => {

## Garage

SpeedyBot's docs are special-- they're interactive and you can do things with them. From the Patterns docs you can grab **[code snippets](https://speedybot.js.org/patterns)** and throw them right into your bot. Inside the visaul **[SpeedyBot Garage](https://speedybot.js.org/garage)** experience you can register webhooks and design + preview + send **[SpeedyCards](https://speedybot.js.org/speedycard)**
SpeedyBot's docs are special-- they're interactive and you can do things with them. From the Patterns docs you can grab **[code snippets](https://speedybot.js.org/patterns)** and throw them right into your bot. Inside the visual **[SpeedyBot Garage](https://speedybot.js.org/garage)** experience you can register webhooks and design + preview + send **[SpeedyCards](https://speedybot.js.org/speedycard)**

<img src="https://raw.githubusercontent.com/valgaze/speedybot-utils/main/assets/various/webhook_steps.gif" />

Expand All @@ -121,3 +121,45 @@ SpeedyBot makes it speedy & easy to build serverless bots for the LLM era. See t
## 🐍 Speedybot-Python

If you want to build bots with Python rather than Typescript, you can also check out [🐍Speedybot-Python🐍](https://pypi.org/project/speedybot)

## CLI

It's SpeedyBot all the way down-- the **[SpeedyBot Documentation](https://speedybot.js.org)** is powered by SpeedyBot but SpeedyBot also has a fast and powerful CLI.

- Can run as `npm init speedybot@latest` or `npx -y speedybot`

- Add `--help` flag to end of commands (ex. `npx -y speedybot setup --help`)

## Setup

Download, scaffold, setup, and even boot SpeedyBot projects locally

```
npm init speedybot@latest setup -- --help
npx -y speedybot@latest setup --help
npx -y speedybot@latest setup
npx -y speedybot@^2.0.0 setup --project default --boot --install
npx -y speedybot@^2.0.0 setup --project voiceflow-kb -e BOT_TOKEN -e VOICEFLOW_API_KEY --install --boot
```

## Token

Inspect a WebEx token, see if its valid and see if any associated agents

```
npm init speedybot@latest token -- --help
npx -y speedybot@latest token --help
```

## Webhook

Manage webhooks-- Create, List, and Destroy webhooks associated with a token

```
npm init speedybot@latest webhook -- --help
npx -y speedybot@latest webhook --help
npx -y speedybot@latest webhook list
npx -y speedybot@latest webhook create -w https://www.myinfra.com -t tokenvalue -s secretvalue
npx -y speedybot@latest webhook remove
```
Loading

0 comments on commit 8a5ba99

Please sign in to comment.