docs: update ai hugging face tutorial examples#2613
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2613 +/- ##
=======================================
Coverage 93.37% 93.37%
=======================================
Files 37 37
Lines 7581 7581
Branches 667 667
=======================================
Hits 7079 7079
Misses 497 497
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
📝 Leaving a few notes below for the kind reviewers!
|
|
||
| 1. On the **Install App** page, copy your **Bot User OAuth Token**. You will store this in your environment as `SLACK_BOT_TOKEN` (we'll get to that next). | ||
| 2. Navigate to **Basic Information** and in the **App-Level Tokens** section, click **Generate Token and Scopes**. Add the [`connections:write`](https://docs.slack.dev/reference/scopes/connections.write) scope, name the token, and click **Generate**. (More on tokens [here](/authentication/tokens)). Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`. | ||
| 3. A fine grained [access token](https://huggingface.co/settings/tokens) from Hugging Face with the "Make calls to Inference Providers" permission is also needed. Keep this for `HUGGINGFACE_API_KEY`. |
There was a problem hiding this comment.
🔍 Not super sure if this line makes sense here, so open to updates!
There was a problem hiding this comment.
I think that makes sense! I just reworked it a bit to be clear which token you're getting with each step
| ```bash title=".env" | ||
| SLACK_APP_TOKEN=xapp-1-example-token | ||
| SLACK_BOT_TOKEN=xoxb-example-token | ||
| HUGGINGFACE_API_KEY=hf_exampletoken | ||
| ``` |
There was a problem hiding this comment.
🗣️ QQ: Is this useful to keep, or perhaps much?
|
|
||
| // HuggingFace configuration | ||
| const hfClient = new HfInference(process.env.HUGGINGFACE_API_KEY); | ||
| const hfClient = new InferenceClient(process.env.HUGGINGFACE_API_KEY); |
There was a problem hiding this comment.
📣 This is the main change from slack-samples/bolt-js-assistant-template#33.
| * Within **OAuth & Permissions**, you will find several bot scopes have been added. | ||
| * Within **Event Subscriptions**, you will find several events this app subscribes to, which allow it to respond to user requests appropriately. |
There was a problem hiding this comment.
The diff is not so clear on this, but "bot tokens" was change to "bot scopes" and a space was removed later 👾
| git clone https://github.com/slack-samples/bolt-js-starter-template.git | ||
| ``` | ||
|
|
||
| Then navigate to its directory: | ||
|
|
||
| ```bash | ||
| # Change into this project directory | ||
| cd bolt-js-starter-template |
There was a problem hiding this comment.
🪓 Updating to clone in the current code-assistant directory!
| For this project, we will need to install [Hugging Face Inference](https://www.npmjs.com/package/@huggingface/inference) to interact with pre-trained models. Run this command in your terminal window to install the dependencies we need: | ||
|
|
||
| ```bash | ||
| npm install axios @huggingface/inference isomorphic-fetch |
There was a problem hiding this comment.
🪓 Also a happening of slack-samples/bolt-js-assistant-template#33.
|
|
||
| ```js | ||
| require("isomorphic-fetch"); | ||
| ````js title="app.js" |
There was a problem hiding this comment.
🧮 Four tabs are set here for the ``` of L199!
Co-authored-by: Haley Elmendorf <[email protected]>
Co-authored-by: Haley Elmendorf <[email protected]>
|
@haleychaas Kind thanks for the reviews and great suggestion as always! I am a fan of more obvious steps 📚 ✨ Edit: Oops I mistook a review for approval - holding off on this merge for now😉 |
|
@haleychaas Haha another kind thanks - let us now merge this! 🙏 |
Summary
This PR updates AI tutorials to match changes from slack-samples/bolt-js-assistant-template#33 🤖
Preview
Pages with updates can be found at these links:
Requirements