Skip to content

Comments

API Docs: AI app with Hugging Face tutorial#2464

Merged
haleychaas merged 4 commits intomainfrom
helmendorf-ai-apps-tutorial
Mar 24, 2025
Merged

API Docs: AI app with Hugging Face tutorial#2464
haleychaas merged 4 commits intomainfrom
helmendorf-ai-apps-tutorial

Conversation

@haleychaas
Copy link
Contributor

Summary

This PR adds a tutorial for an AI app that uses a Hugging Face model to answer coding questions. I also cleaned up some old/outdated language and links on the other AI app tutorial page.

Requirements (place an x in each [ ])

@codecov
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.59%. Comparing base (2445436) to head (70e23db).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2464   +/-   ##
=======================================
  Coverage   92.59%   92.59%           
=======================================
  Files          36       36           
  Lines        7472     7472           
  Branches      653      653           
=======================================
  Hits         6919     6919           
  Misses        545      545           
  Partials        8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@technically-tracy technically-tracy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple suggestions, nothing to hold you up!

```

This is the meat of our app! Here's a breakdown of what we've added:
* `DEFAULT_SYSTEM_CONTENT` is a set of instructions for the model; think of it as setting the scene in the play that is the interaction between your users and the AI model; it is the context for the role that the model will be playing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `DEFAULT_SYSTEM_CONTENT` is a set of instructions for the model; think of it as setting the scene in the play that is the interaction between your users and the AI model; it is the context for the role that the model will be playing.
* `DEFAULT_SYSTEM_CONTENT` is a set of instructions for the model. Think of it as setting the scene in the play that is the interaction between your users and the AI model; it is the context for the role that the model will be playing.

* `DEFAULT_SYSTEM_CONTENT` is a set of instructions for the model; think of it as setting the scene in the play that is the interaction between your users and the AI model; it is the context for the role that the model will be playing.
* `convertMarkdownToSlack` is a function that converts traditional markdown to the markdown that Slack uses (which is different). Alternatively, you could send the model's response through the [markdown block](https://docs.slack.dev/reference/block-kit/blocks/markdown-block) to achieve the same result.
* `assistant` is an instance of the [`Assistant` class](/bolt-js/concepts/ai-apps#the-assistant-class-instance); this sets up the suggested prompts that the user sees in the split-view container upon opening your app.
* `userMessage` is the handler that takes care of the fiddly bits around getting the thread history, preparing the structure of the messages for processing in a way that the model is expecting, interacting with the model, and responding to the user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fiddly bits! 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if sending as a markdown block makes a better example now! I was in a bit of a rush for the re:Invent demo, but here we should definitely introduce them to our recommended best practices. What do y'all think?

You should now see it and be able to open it from the icon in the upper right of the Slack client window. This opens the split-view. Upon opening your app's split-view, you should see the suggested prompts we set up in `app.js` file. Click on one of the suggested prompts or formulate a question of your own to see your AI app in action!

## Side quest: Use your function as a custom step in Workflow Builder {#custom-step}
Let's explore how to use the functionality you've created in your app inside of a workflow. In case you're unfamiliar, Workflow Builder is the no-code solution for executing tasks in Slack. Once your app is installed on your org, you can grant anyone access to use its function as a custom step in their workflow. Here's how that's done.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Let's explore how to use the functionality you've created in your app inside of a workflow. In case you're unfamiliar, Workflow Builder is the no-code solution for executing tasks in Slack. Once your app is installed on your org, you can grant anyone access to use its function as a custom step in their workflow. Here's how that's done.
Let's explore how to use the functionality you've created in your app inside of a workflow. In case you're unfamiliar, [Workflow Builder](https://slack.com/help/articles/360035692513-Guide-to-Slack-Workflow-Builder) is the no-code solution for executing tasks in Slack. Once your app is installed on your org, you can grant anyone access to use its function as a custom step in their workflow. Here's how that's done.

@haleychaas haleychaas removed the request for review from lukegalbraithrussell March 24, 2025 20:17
@haleychaas haleychaas merged commit 6d14948 into main Mar 24, 2025
20 checks passed
@haleychaas haleychaas deleted the helmendorf-ai-apps-tutorial branch March 24, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants