Skip to content

Instantly share code, notes, and snippets.

@clatwell
Last active April 3, 2024 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clatwell/9de5dc98ac95a3df1487ce7a24eceab3 to your computer and use it in GitHub Desktop.
Save clatwell/9de5dc98ac95a3df1487ce7a24eceab3 to your computer and use it in GitHub Desktop.
slackpile-ai.md

SlackPile AI Explorations

What service are we using?

  • OpenAI
    • Can we specify JSON output? Yes
    • Can we use the free plan? Rate limits are a downside unless we want to spend some $$; we can probably get ~$50 approved
  • Gemini
    • Can we specify JSON output? Gemini API doesn’t have a JSON mode but we can tell it to return JSON and it returns JSON just fine.
    • Can we use the free plan? TBD

What data are we sending?

Option 1 - Preferred

Option 2 - Backup

  • Send JSON of Mentions from our app
    • Claire will share example

What are we prompting the AI to do?

Option 1

  • Parse raw Slack JSON for Book Mentions
  • Analyze each detected Mention for sentiment
  • Write summary for each detected Mention
  • Return valid JSON of Mentions with: Book Title, user, ts, thread_ts, sentiment, summary
    • user, ts, thread_ts will pass through straight from the input

Option 2

  • Parse Mentions JSON from our app
  • Analyze each Mention for sentiment
  • Write summary for each Mention
  • Return valid JSON for each Mention with id, sentiment, and summary

Prompt Engineering

  • Book Title
    • Is a string and corresponds to the name of the book mentioned
    • Do not need to include the name of the author or any text formatting in the “book” field
    • If you detect that a book is mentioned only in comparison to a previous book mentioned, I'd like you not to include it as a Mention. Instead. I'd like you to include any books mentioned in comparison within the summarized comments of the original book.
  • Sentiment
    • Is a string and should be one of either “positive”, “negative”, or “neutral”
    • If you don't have enough information to assess sentiment, use "neutral"
    • Do we want to fine-tune any of the sentiment analysis? (in Claire's explorations, OpenAI tended to underestimate sentiment)
  • Summary
    • Is a string that summarizes the reader's comments in a complete sentence no more than 30 words.
    • The sentence should begin with the value in the “first_name” field from the “user_profile” object
    • Do we want to fine-tune any of the summarization?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment