mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-09 22:38:10 -05:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
126a9ff406 | ||
|
|
e906425138 | ||
|
|
df4a560302 | ||
|
|
34cf669bd4 | ||
|
|
0dbe1bbb4e |
@@ -1 +1 @@
|
||||
"1.4.216"
|
||||
"1.4.217"
|
||||
|
||||
64
patterns/extract_mcp_servers/system.md
Normal file
64
patterns/extract_mcp_servers/system.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# IDENTITY and PURPOSE
|
||||
|
||||
You are an expert at analyzing content related to MCP (Model Context Protocol) servers. You excel at identifying and extracting mentions of MCP servers, their features, capabilities, integrations, and usage patterns.
|
||||
|
||||
Take a step back and think step-by-step about how to achieve the best results for extracting MCP server information.
|
||||
|
||||
# STEPS
|
||||
|
||||
- Read and analyze the entire content carefully
|
||||
- Identify all mentions of MCP servers, including:
|
||||
- Specific MCP server names
|
||||
- Server capabilities and features
|
||||
- Integration details
|
||||
- Configuration examples
|
||||
- Use cases and applications
|
||||
- Installation or setup instructions
|
||||
- API endpoints or methods exposed
|
||||
- Any limitations or requirements
|
||||
|
||||
# OUTPUT SECTIONS
|
||||
|
||||
- Output a summary of all MCP servers mentioned with the following sections:
|
||||
|
||||
## SERVERS FOUND
|
||||
|
||||
- List each MCP server found with a 15-word description
|
||||
- Include the server name and its primary purpose
|
||||
- Use bullet points for each server
|
||||
|
||||
## SERVER DETAILS
|
||||
|
||||
For each server found, provide:
|
||||
- **Server Name**: The official name
|
||||
- **Purpose**: Main functionality in 25 words or less
|
||||
- **Key Features**: Up to 5 main features as bullet points
|
||||
- **Integration**: How it integrates with systems (if mentioned)
|
||||
- **Configuration**: Any configuration details mentioned
|
||||
- **Requirements**: Dependencies or requirements (if specified)
|
||||
|
||||
## USAGE EXAMPLES
|
||||
|
||||
- Extract any code snippets or usage examples
|
||||
- Include configuration files or setup instructions
|
||||
- Present each example with context
|
||||
|
||||
## INSIGHTS
|
||||
|
||||
- Provide 3-5 insights about the MCP servers mentioned
|
||||
- Focus on patterns, trends, or notable characteristics
|
||||
- Each insight should be a 20-word bullet point
|
||||
|
||||
# OUTPUT INSTRUCTIONS
|
||||
|
||||
- Output in clean, readable Markdown
|
||||
- Use proper heading hierarchy
|
||||
- Include code blocks with appropriate language tags
|
||||
- Do not include warnings or notes about the content
|
||||
- If no MCP servers are found, simply state "No MCP servers mentioned in the content"
|
||||
- Ensure all server names are accurately captured
|
||||
- Preserve technical details and specifications
|
||||
|
||||
# INPUT:
|
||||
|
||||
INPUT:
|
||||
@@ -26,6 +26,7 @@ func Serve(registry *core.PluginRegistry, address string, apiKey string) (err er
|
||||
NewContextsHandler(r, fabricDb.Contexts)
|
||||
NewSessionsHandler(r, fabricDb.Sessions)
|
||||
NewChatHandler(r, registry, fabricDb)
|
||||
NewYouTubeHandler(r, registry)
|
||||
NewConfigHandler(r, fabricDb)
|
||||
NewModelsHandler(r, registry.VendorManager)
|
||||
NewStrategiesHandler(r)
|
||||
|
||||
70
restapi/youtube.go
Normal file
70
restapi/youtube.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package restapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/danielmiessler/fabric/core"
|
||||
"github.com/danielmiessler/fabric/plugins/tools/youtube"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type YouTubeHandler struct {
|
||||
yt *youtube.YouTube
|
||||
}
|
||||
|
||||
type YouTubeRequest struct {
|
||||
URL string `json:"url"`
|
||||
Language string `json:"language"`
|
||||
Timestamps bool `json:"timestamps"`
|
||||
}
|
||||
|
||||
type YouTubeResponse struct {
|
||||
Transcript string `json:"transcript"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
func NewYouTubeHandler(r *gin.Engine, registry *core.PluginRegistry) *YouTubeHandler {
|
||||
handler := &YouTubeHandler{yt: registry.YouTube}
|
||||
r.POST("/youtube/transcript", handler.Transcript)
|
||||
return handler
|
||||
}
|
||||
|
||||
func (h *YouTubeHandler) Transcript(c *gin.Context) {
|
||||
var req YouTubeRequest
|
||||
if err := c.BindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"})
|
||||
return
|
||||
}
|
||||
if req.URL == "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "url is required"})
|
||||
return
|
||||
}
|
||||
language := req.Language
|
||||
if language == "" {
|
||||
language = "en"
|
||||
}
|
||||
|
||||
var videoID, playlistID string
|
||||
var err error
|
||||
if videoID, playlistID, err = h.yt.GetVideoOrPlaylistId(req.URL); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if videoID == "" && playlistID != "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "URL is a playlist, not a video"})
|
||||
return
|
||||
}
|
||||
|
||||
var transcript string
|
||||
if req.Timestamps {
|
||||
transcript, err = h.yt.GrabTranscriptWithTimestamps(videoID, language)
|
||||
} else {
|
||||
transcript, err = h.yt.GrabTranscript(videoID, language)
|
||||
}
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, YouTubeResponse{Transcript: transcript, Title: videoID})
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
package main
|
||||
|
||||
var version = "v1.4.216"
|
||||
var version = "v1.4.217"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from 'svelte/store';
|
||||
import { languageStore } from '$lib/store/language-store';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
export interface TranscriptResponse {
|
||||
transcript: string;
|
||||
@@ -18,18 +18,18 @@ export async function getTranscript(url: string): Promise<TranscriptResponse> {
|
||||
console.log('\n=== YouTube Transcript Service Start ===');
|
||||
console.log('1. Request details:', {
|
||||
url,
|
||||
endpoint: '/chat',
|
||||
endpoint: '/api/youtube/transcript',
|
||||
method: 'POST',
|
||||
isYouTubeURL: url.includes('youtube.com') || url.includes('youtu.be'),
|
||||
originalLanguage
|
||||
});
|
||||
|
||||
const response = await fetch('/chat', {
|
||||
const response = await fetch('/api/youtube/transcript', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
body: JSON.stringify({
|
||||
url,
|
||||
language: originalLanguage // Pass original language to server
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user