Logo

dev-resources.site

for different kinds of informations.

Confbrew: A Getting Started Tutorial with Markprompt and Contenda

Published at
4/6/2023
Categories
ai
conferences
content
tutorial
Author
lilchenzo
Categories
4 categories in total
ai
open
conferences
open
content
open
tutorial
open
Author
9 person written this
lilchenzo
open
Confbrew: A Getting Started Tutorial with Markprompt and Contenda

This tutorial was generated by Contenda from our video tutorial on the subject. If you’d prefer to watch, head over there!

Uploading a YouTube playlist using Contenda APIs

In this tutorial, you’ll learn how to convert a YouTube playlist into a Q&A bot. We’ll use the Contentful Fast Forward 2022 Conference playlist as an example.

  1. Open this Autocode Template
  2. Hit Run on main.js

This file will grab the playlist ID from the YouTube URL and call the Google YouTube API endpoint to get all the video IDs. Then it will call the Contenda API, which takes the video IDs and generates tutorials in Markdown format. These tutorials can later be converted into a Q&A using Markprompt.

const lib = require('lib')({ token: process.env.STDLIB });
const { google } = require('googleapis');
const apiKey = process.env.apiKey;
const playlistUrl = 'https://www.youtube.com/watch?v=_tLJRAl';

// Extract the playlist ID from the URL
const playlistId = playlistUrl.split('list=')[1];

// Function to get video IDs from a playlist
async function getPlaylistVideoIds(playlistId) {
  const youtube = google.youtube({
    version: 'v3',
    auth: apiKey
  });

  const response = await youtube.playlistItems.list({
    key: apiKey,
    part: 'snippet',
    maxResults: 50,
    playlistId
  });

  const videoIds = response.data.items.map(
    (item) => item.snippet.resourceId.videoId
  );

  console.log(videoIds);
  return videoIds
}
Enter fullscreen mode Exit fullscreen mode

Afterwards:

  1. Wait for Contenda to process the jobs (depending on the playlist length and video size, this can take a few hours)
  2. In the receive_jobs.js logs, observe the jobs being queued up and processed.

Integrating Contenda and Markprompt

When a job is successful, the Contenda endpoint sends back the status as “success” along with the job ID. We store this job ID, call the Contenda API to get the blog ID, and then create a paired array. Our receive_jobs.js file now created job IDs paired with blog IDs in local key-value storage.

Next, we need to modify our markprompt.js file. First, change the Markprompt key to match the project you’re using. Sign up for Markprompt, create a project, and generate a token in the settings. After adding the Markprompt key, save the environmental variable.

Markprompt UI screenshot to get the project key

The goal is to create key-value pairs where the keys are the blog IDs, and the values are JSON objects containing the markdown from the content. Contenda provides a “retrieve as markdown” endpoint that returns markdown for a given blog ID. Simply stringify the returned object and add it to the files array.

Markprompt can then accept this JSON array and train on it. Run the code and verify if you receive a 200 status response. Go back to Markprompt and check the “Data” tab, where you should see all of your videos as blog IDs.

Markprompt UI screenshot of the data tab

You did it!

In order to search through video content effectively, you are now all set up to use a combination of Contenda and Markprompt APIs!

With these tools, you can access valuable information that might be locked up within videos, like customer panels, which may not be easily searchable on platforms like YouTube.

You can join our Discord for help or feedback. We’d love to hear from you.

Happy shipping!

conferences Article's
30 articles in total
Favicon
London Perl Workshop 2024 – Preview
Favicon
No more "Expert, Intermediate, Beginner": Classifying talks in Call for Papers/Conference agendas
Favicon
Mon épopée au devQuest
Favicon
An Overview of Devmio’s Conferences in 2024
Favicon
Collecting talks
Favicon
The Extreme Sport of Solo-Conferencing
Favicon
Deep Thoughts on Denver Startup Week
Favicon
The complete line-up for Patterns Day …and a workshop!
Favicon
Top 10 AI/ML Conferences You Must Visit in 2024
Favicon
Revojs: How a Local Conference in 🇷🇴 Romania turned into a Networking Gold Mine
Favicon
PostgreSQL at AWS re:Invent
Favicon
PHP / Laravel / Symfony conferences in 2024
Favicon
Nx Conf 2023 - Recap
Favicon
dev up 2023: Leveling up our dev skills, security posture, and careers
Favicon
Slides from CincyDeliver
Favicon
15 GREAT Data Engineering Conferences to attend in 2023-24
Favicon
A review of WeAreDevelopers 2023
Favicon
The Perl and Raku Conference, Toronto 2023
Favicon
Days of style and standards
Favicon
Why Attend Developer Conferences
Favicon
15 Top Testing Conferences To Attend In 2023
Favicon
Find your conference: calendar for developers
Favicon
ConFoo 2023 in Review
Favicon
Confbrew: A Getting Started Tutorial with Markprompt and Contenda
Favicon
Axe-Con Lessons.
Favicon
Ruby gems & rocket ships: A RubyConf Opportunity Scholar experience 🚀
Favicon
Waffles, Fries, Beer and Developers; Notes from FOSDEM 2023
Favicon
The State of Developer Conferences
Favicon
Datanova 2023
Favicon
12 JS Conferences in 2023

Featured ones: