awesome-n8n-templates/OpenAI_and_LLMs/AI_ Summarize podcast episode and enhance using Wikipedia.json

463 lines
37 KiB
JSON
Raw Normal View History

{
"id": "zFxUMqgvTXGIMzvh",
"meta": {
"instanceId": "ec7a5f4ffdb34436e59d23eaccb5015b5238de2a877e205b28572bf1ffecfe04"
},
"name": "Podcast Digest",
"tags": [],
"nodes": [
{
"id": "48bf1045-cfc1-4b37-9cce-86634bd97480",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-420,
580
],
"parameters": {},
"typeVersion": 1
},
{
"id": "75f2e528-e5fe-4508-b98f-e1f71f803e60",
"name": "Podcast Episode Transcript",
"type": "n8n-nodes-base.code",
"position": [
-220,
580
],
"parameters": {
"jsCode": "return { transcript: `So throughout the last couple episodes weve been doing on the philosophy of mindtheres been an IDEA that weve referenced MULTIPLE TIMES and really just glossed over it as something, thats PRACTICALLY self evident. \n\n\n\nThe idea is that when we THINK about consciousness we can SPLIT it into two different typestheres ACCESS consciousness on the one hand and PHENOMENAL consciousness on the other. This is what weve been saying. \n\n\n\nWhen it comes to ACCESS consciousnessthats stuff we CAN explain with neuroscience things like memories, information processing, our field of visual awarenesswe can CLEARLY EXPLAIN a bit about how all THAT stuff works.\n\n\n\nBut in this conversation so far, what KEEPS on being said is that what we CANT SEEM to explainis PHENOMENAL consciousnessyou know, the subjective experience, that UNDERLIES conscious thought. That it FEELS like something to be me. Theres this ideathat this phenomenal consciousness is something separatesomething fundamental, something in a category ALL ITS OWN that needs to be explained. You can explain a lot of stuff about access consciousnessbut you cant explain PHENOMENAL consciousness. \n\n\n\nBut if you were a good materialist listening to the discussions on this series so farand youre sitting in the back of the room, being SUPER PATIENT, NOT SAYING ANYTHING trying to be respectful to all the other ideas being presentedmaybe theres a part of you so far thats just been BOILING inside, because youre waiting for the part of the show where were ACTUALLY going to call that GIANT assumption thats being made into question. \n\n\n\nBecause a materialist might say, SUREphenomenal consciousness is PRETTY mysterious and all. But DOES that necessarily mean that its something that NEEDS a further explanation? \n\n\n\nThis is a good question. What is the difference between EXPLAINING ALL of the component PARTS of our subjective experience again the thoughts, memories, information processingwhats the difference between explaining all that and explaining phenomenal consciousness in itself? Like what does that even mean?\n\n\n\nThats kinda like you sayingwell you can EXPLAIN the delicious waffle cone. You can EXPLAIN the creamy chocolatey goodness inside, you can EXPLAIN the RAINBOW colored SPRINKLES. But you CANT explain the ICE CREAM CONEin ITSELF, now can you? \n\n\n\nI mean at a CERTAIN point what are we even talking about anymore? IS phenomenal consciousness REALLY something thats ENTIRELY SEPARATE that needs to be explained? \n\n\n\nMaybe, it DOESNT need to be explained. Maybe phenomenal consciousness is less a thing in itselfand MORE a sort of ATTRIBUTION we make about a particular INTERSECTION of those component parts that we CAN study and explain. \n\n\n\nNow obviously theres a bit to clarify there and going over some popular arguments as to why that might be the case will take a good portion of the episode here today. But maybe a good place to start is to ask the questionif the hard problem of consciousness is to be able to explain why it FEELS like something to be meand your SOLUTION to that is that maybe we dont even need to explain that. One thing youre gonna HAVE to explain no matter what is why it SEEMS to MOST people living in todays worldthat phenomenal consciousness IS something that needs to be explained. \n\n\n\nRight before we began this series we did an episode on Susan Sontag and the power of the metaphors we casually use in conversations. And we talked about how these metaphors ACTUALLY go on to have a pretty huge impact on the way we contextualize the things in our lives. \n\n\n\nWell the philosopher Susan Blackmore, and apparently I ONLY cover female philosophers by the name of Susan or Simone on this showbut anyway SUSAN BLACKMORE, huge player in these modern conversations about the mysteries of consciousnessand she thinks that if its DIFFI
},
"typeVersion": 2
},
{
"id": "70b657d9-5a8f-4a9e-8d4e-18940ba35683",
"name": "Workflow Input to JSON Document",
"type": "@n8n/n8n-nodes-langchain.documentJsonInputLoader",
"position": [
80,
780
],
"parameters": {
"pointers": "/transcript"
},
"typeVersion": 1
},
{
"id": "b05c5e26-5a1d-4717-868d-3b05783a0d24",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
220,
900
],
"parameters": {
"chunkSize": 6000,
"chunkOverlap": 1000
},
"typeVersion": 1
},
{
"id": "1b78b734-167e-4eb6-ba2e-19bbecd3a75e",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-100,
460
],
"parameters": {
"width": 455.5091388435286,
"height": 577.6862533692728,
"content": "## Chunk the transcript into several parts, and refine-summarize it "
},
"typeVersion": 1
},
{
"id": "86ac5fad-307f-4f95-ad1c-1ba00a29e807",
"name": "Topics",
"type": "n8n-nodes-base.itemLists",
"position": [
920,
580
],
"parameters": {
"options": {},
"fieldToSplitOut": "topics"
},
"typeVersion": 3
},
{
"id": "078890f1-d840-479e-b702-ce6f9e3b4852",
"name": "Summarize Transcript",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
-40,
580
],
"parameters": {
"type": "refine"
},
"typeVersion": 1
},
{
"id": "4a583efe-ff24-4bc1-b3e7-89651e3147c7",
"name": "GPT 4 - Extract",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
560,
755
],
"parameters": {
"model": "gpt-4",
"options": {
"temperature": 0.8
}
},
"credentials": {
"openAiApi": {
"id": "wJtZwsVKW5v6R2Iy",
"name": "OpenAi account 2"
}
},
"typeVersion": 1
},
{
"id": "b658f2c1-3f60-4ff0-8b7b-2b2ebe1b1f5e",
"name": "Wikipedia1",
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
"position": [
1380,
900
],
"parameters": {},
"typeVersion": 1
},
{
"id": "5bffc33d-bb52-4432-bb82-ce2005be3c06",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
460
],
"parameters": {
"width": 615.8516011477997,
"height": 443.66706715913415,
"content": "## Generate Questions and Topics from the summary and make sure the response follows required schema."
},
"typeVersion": 1
},
{
"id": "53626ccb-451d-4ed8-8512-2daa74baf556",
"name": "Send Digest",
"type": "n8n-nodes-base.gmail",
"position": [
1900,
580
],
"parameters": {
"sendTo": "oleg@n8n.io",
"message": "=Greetings 👋,\nHope you're doing well! Here's your digest for this week's episode of Philoshopy This! \n\n<h2>🎙 Episode Summary</h2>\n{{ $json.summary }}\n\n<h2>💡 Topics Discussed</h2>\n{{ $json.topics.join('\\n') }}\n\n<h2>❓ Questions to Ponder</h2>\n{{ $json.questions.join('\\n') }}",
"options": {},
"subject": "Podcast Digest",
"emailType": "html"
},
"credentials": {
"gmailOAuth2": {
"id": "kLFedNEM8Zwkergv",
"name": "Gmail account"
}
},
"typeVersion": 2
},
{
"id": "751ffffe-190e-4fc6-93ff-0021c98f225d",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1220,
460
],
"parameters": {
"width": 359.3751741576458,
"height": 567.5105121293799,
"content": "## Ask Agent to research and explain each topic using Wikipedia\n\n"
},
"typeVersion": 1
},
{
"id": "0165bec2-f390-44a8-8435-ba718cf18465",
"name": "Format topic text & title",
"type": "n8n-nodes-base.code",
"position": [
1740,
580
],
"parameters": {
"jsCode": "const inputItems = $input.all();\nconst topics = [];\nconst questions = [];\nconst summary = $('Summarize Transcript').item.json.response.output_text;\n// Format Topics\nfor (const [index, topic] of inputItems.entries()) {\n const title = $('Topics').all()[index].json.topic\n\n topics.push(`\n <h3>${title}</h3>\n <p>${topic.json.output}</p>`.trim()\n )\n}\n\n// Format Questions\nfor (const question of $('Extract Topics & Questions').item.json.questions) {\n questions.push(`\n <h3>${question.question}</h3>\n <p>${question.why}</p>`.trim()\n )\n}\n\nreturn { topics, summary, questions }"
},
"typeVersion": 2
},
{
"id": "497c5a49-e4cb-4c1f-98c2-49088ced2e72",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
720,
755
],
"parameters": {
"jsonSchema": "{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Generated schema for Root\",\n \"type\": \"object\",\n \"properties\": {\n \"questions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"question\": {\n \"type\": \"string\"\n },\n \"why\": {\n \"type\": \"string\",\n \"description\": \"Explanation of why this question is relevant for the context\"\n }\n },\n \"required\": [\n \"question\",\n \"why\"\n ]\n }\n },\n \"topics\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"topic\": {\n \"type\": \"string\"\n },\n \"why\": {\n \"type\": \"string\",\n \"description\": \"A few sentences explanation of why this topic is relevant for the context\"\n }\n },\n \"required\": [\n \"topic\",\n \"why\"\n ]\n }\n }\n },\n \"required\": [\n \"questions\",\n \"topics\"\n ]\n}"
},
"typeVersion": 1
},
{
"id": "6b42d3bf-912e-4df3-91c6-2eba06dbe27c",
"name": "Extract Topics & Questions",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
560,
580
],
"parameters": {
"prompt": "=Come up with a list of questions and further topics to explore that are relevant for the context. Make sure questions are relevant to the topics but not verbatim. Think hard about what the appropriate questions should be and how it relates to the summarization.\nPodcast Summary: {{ $json.response.output_text }}"
},
"typeVersion": 1
},
{
"id": "701c2977-0c17-4fa0-ad4b-afbbbaa6f044",
"name": "GPT3.5 - Research",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1280,
780
],
"parameters": {
"model": "gpt-3.5-turbo-16k",
"options": {
"temperature": 0.8
}
},
"credentials": {
"openAiApi": {
"id": "wJtZwsVKW5v6R2Iy",
"name": "OpenAi account 2"
}
},
"typeVersion": 1
},
{
"id": "0da11c5a-ffd3-47a0-a082-9eaf9d18fc10",
"name": "GPT3.5 - Summarize",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-60,
780
],
"parameters": {
"model": "gpt-3.5-turbo-16k",
"options": {
"temperature": 0
}
},
"credentials": {
"openAiApi": {
"id": "wJtZwsVKW5v6R2Iy",
"name": "OpenAi account 2"
}
},
"typeVersion": 1
},
{
"id": "bbb29b9f-f765-4f0c-926f-1b34a6eb999c",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1700,
460
],
"parameters": {
"width": 371.7094059635757,
"height": 330.6932614555254,
"content": "## Format as HTML and send via Gmail"
},
"typeVersion": 1
},
{
"id": "cfdde2b8-5fb7-4eb6-b821-e5d0511bcabd",
"name": "Research & Explain Topics",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1260,
580
],
"parameters": {
"text": "=Topic: {{ $json.topic }}\n\nContext: {{ $('Summarize Transcript').item.json.response.output_text }}\n",
"agent": "openAiFunctionsAgent"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d1a1ab93-2fb9-42f9-94a2-9d2c187eb41e",
"connections": {
"Topics": {
"main": [
[
{
"node": "Research & Explain Topics",
"type": "main",
"index": 0
}
]
]
},
"Wikipedia1": {
"ai_tool": [
[
{
"node": "Research & Explain Topics",
"type": "ai_tool",
"index": 0
}
]
]
},
"GPT 4 - Extract": {
"ai_languageModel": [
[
{
"node": "Extract Topics & Questions",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"GPT3.5 - Research": {
"ai_languageModel": [
[
{
"node": "Research & Explain Topics",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"GPT3.5 - Summarize": {
"ai_languageModel": [
[
{
"node": "Summarize Transcript",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Summarize Transcript": {
"main": [
[
{
"node": "Extract Topics & Questions",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Extract Topics & Questions",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Format topic text & title": {
"main": [
[
{
"node": "Send Digest",
"type": "main",
"index": 0
}
]
]
},
"Research & Explain Topics": {
"main": [
[
{
"node": "Format topic text & title",
"type": "main",
"index": 0
}
]
]
},
"Extract Topics & Questions": {
"main": [
[
{
"node": "Topics",
"type": "main",
"index": 0
}
]
]
},
"Podcast Episode Transcript": {
"main": [
[
{
"node": "Summarize Transcript",
"type": "main",
"index": 0
}
]
]
},
"Workflow Input to JSON Document": {
"ai_document": [
[
{
"node": "Summarize Transcript",
"type": "ai_document",
"index": 0
}
]
]
},
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Podcast Episode Transcript",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Workflow Input to JSON Document",
"type": "ai_textSplitter",
"index": 0
}
]
]
}
}
}