This repository contains a collection of Genkit agents and workflows designed to streamline your development processes. You can find the latest releases here.
- Agent 1: YouTube Video Search
- Agent 2: Video Search and Content Generation
- Getting Started
- Usage
- Contributing
- License
This agent defines a simple Genkit flow called searchVideosFlow. It searches for YouTube videos based on a text query.
- YouTube Video Search: Takes a string as input and uses the YouTube Data API to search for relevant videos.
- Structured Output: Returns a list of videos, each with a title, description, and URL.
- Input:
text: string - Output: An array of objects with the following structure:
{
title: string;
description: string;
url: string;
}[]To use the searchVideosFlow, you can call it like this:
const results = await searchVideosFlow("your search query");
console.log(results);This will return a list of videos related to your query.
This agent defines a more advanced Genkit flow, searchSummaryVideosFlow. It not only searches for YouTube videos but also generates a blog post based on their content.
- YouTube Video Search: Searches for videos using the YouTube Data API.
- Content Generation: Creates a blog post summarizing the video content.
- Input:
text: string - Output: An object containing video information and a generated blog post.
To use the searchSummaryVideosFlow, you can call it like this:
const summary = await searchSummaryVideosFlow("your search query");
console.log(summary);This will return a summary of the videos along with a generated blog post.
To get started with the Genkit agents, follow these steps:
-
Clone the Repository:
git clone https://github.com/huber1105/workshop-agents.git
-
Install Dependencies: Navigate to the project directory and install the required packages.
cd workshop-agents npm install -
Set Up YouTube API: Create a project in the Google Developers Console and enable the YouTube Data API. Obtain your API key and set it in your environment variables.
-
Run the Agents: You can now run the agents using Node.js.
node agent-01.ts node agent-02.ts
You can use the agents in your own projects. Import the desired agent and call the functions as needed.
Hereβs a basic example of how to use the agents in your application:
import { searchVideosFlow } from './agent-01';
import { searchSummaryVideosFlow } from './agent-02';
async function main() {
const videos = await searchVideosFlow("JavaScript tutorials");
console.log(videos);
const summary = await searchSummaryVideosFlow("JavaScript tutorials");
console.log(summary);
}
main();Contributions are welcome! If you have suggestions for improvements or new features, please fork the repository and submit a pull request.
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes.
- Commit your changes:
git commit -m "Add your message here" - Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest releases, check here.