This is my workflow. I am building a skill builder that will function as follows:
User:
I want to learn a new skill
Agent:
Okay, I can help. What skill do you want to learn?
User:
Photography
Agent:
What level are you at (‘Beginner’, ‘Intermediate’, ‘Advanced’)?
User:
Beginner
Agent:
Okay, answer these 5 questions which will justify your level. (The questions will be asked by the model and it will verify the user's level on the spot. If it's not justified, it will set the level accordingly.)
User:
Answered all the questions.
Agent:
Now the agent will evaluate the level.
User:
Agent sends him a tutorial video (from YouTube) of about 10 minutes, and then gives him some questions or tasks to utilize the knowledge from the video.
Agent:
Sends the whole roadmap to the user, along with day-by-day tutorial videos (from YouTube) and the user's tasks.
What is the issue here? Why can I not access the YouTube video I wanted? Please help me figure this out, and is this the correct approach?
Hi there, could you please share your workflow as code in the forum? Are you encountering any specific errors, or could you describe what is happening (or not happening) in more detail?
json
{
“nodes”: [
{
“parameters”: {
“sessionKey”: “=chat_with_{{ $(‘Listen for incoming events1’).first().json.message.chat.id }}”,
“contextWindowLength”: 10
},
“id”: “f58edc85-bc6e-4717-8904-6a4c4ef05835”,
“name”: “Window Buffer Memory1”,
“type”: “@callin.io/callin.io-nodes-langchain.memoryBufferWindow”,
“position”: [
-180,
160
],
“typeVersion”: 1
},
{
“parameters”: {
“chatId”: “={{ $(‘Listen for incoming events1’).first().json.message.from.id }}”,
“text”: “={{ $json.output }}”,
“additionalFields”: {
“appendAttribution”: false,
“parse_mode”: “HTML”
}
},
“id”: “673f46a0-f6b8-496b-8f73-dc69e4c54e5d”,
“name”: “Send Response1”,
“type”: “callin.io-nodes-base.telegram”,
“position”: [
340,
-200
],
“typeVersion”: 1.1,
“webhookId”: “09afe851-f1a1-446a-a142-7fd93cba5505”,
“credentials”: {
“telegramApi”: {
“id”: “Hr0ZYk5jR6i7zWqu”,
“name”: “Telegram account”
}
},
“onError”: “continueErrorOutput”
},
{
“parameters”: {
“chatId”: “={{ $(‘Listen for incoming events1’).first().json.message.from.id }}”,
“text”: “={{ $(‘AI Learning Coach1’).item.json.output.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"') }}”,
“additionalFields”: {
“appendAttribution”: false,
“parse_mode”: “HTML”
}
},
“id”: “6a00a93b-01dd-44d5-940d-d36226b49137”,
“name”: “Send Error Response1”,
“type”: “callin.io-nodes-base.telegram”,
“position”: [
580,
-100
],
“typeVersion”: 1.1,
“webhookId”: “28533613-f646-40b6-9017-4790a77100de”,
“credentials”: {
“telegramApi”: {
“id”: “Hr0ZYk5jR6i7zWqu”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“updates”: [
“message”
],
“additionalFields”: {}
},
“id”: “25e4d4fc-5a7e-4212-a00c-371893e73555”,
“name”: “Listen for incoming events1”,
“type”: “callin.io-nodes-base.telegramTrigger”,
“position”: [
-340,
-200
],
“webhookId”: “322dce18-f93e-4f86-b9b1-3305519b7834”,
“typeVersion”: 1,
“credentials”: {
“telegramApi”: {
“id”: “Hr0ZYk5jR6i7zWqu”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“modelName”: “models/gemini-1.5-flash-latest”,
“options”: {}
},
“type”: “@callin.io/callin.io-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1,
“position”: [
-420,
140
],
“id”: “5f7ab657-3082-494f-9d99-7a7d6e89792f”,
“name”: “Google Gemini Chat Model1”,
“credentials”: {
“googlePalmApi”: {
“id”: “ztVzgiHEoGCbEHgV”,
“name”: “Google Gemini(PaLM) Api account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.message.text }}”,
“hasOutputParser”: true,
“options”: {
“systemMessage”: “You are a friendly and structured AI learning coach. Your job is to help people learn new skills step by step. You’re currently talking to a user named {{ $json.message.from.first_name }}. Today is {{ $now.toLocaleString() }}.nn__Your conversation flow:__nn__Stage 1: Skill and Level Identification__n1. Ask what skill the user wants to learnn2. Ask what level they are at (Beginner, Intermediate, or Advanced)nn__Stage 2: Level Assessment__n1. Acknowledge their stated leveln2. Ask 5 relevant questions to assess their actual knowledge leveln3. Evaluate their responses and confirm or adjust their levelnn__Stage 3: Initial Tutorial Video & Tasks__n1. Use the youtube_search tool to find a good tutorial video for their skill and leveln2. Share the video with them using proper HTML formatting with clickable linksn3. Give them 3-5 practical tasks related to the videonn__Stage 4: Full Learning Roadmap__n1. Create a structured daily learning plann2. Include topics, goals, and tasks for each dayn3. Make it motivating and easy to follownn__Important Tool Usage:__n- When you need to find YouTube videos, use the youtube_search tool with a clear search query like ‘python tutorial beginner’ or ‘guitar lessons intermediate’n- The tool will return video titles and URLs that you can share with usersn- Format video results as HTML links: <a href="VIDEO_URL">Video Titlen- Always provide the video URL and title to usersnn__Formatting Rules:__n- Use Telegram HTML formatting: __bold__, _italic_, <a href="url">linksn- Call users by their first name occasionallyn- Be encouraging and supportiven- When sharing YouTube videos, make titles clickable linksn- Replace special characters when not part of HTML tags”
}
},
“id”: “6075f199-5a82-413a-b8bb-d796339caa2b”,
“name”: “AI Learning Coach1”,
“type”: “@callin.io/callin.io-nodes-langchain.agent”,
“typeVersion”: 1.6,
“position”: [
-100,
-200
]
},
{
“parameters”: {
“resource”: “video”,
“filters”: {
“q”: “What the Ai agent wants”
},
“options”: {}
},
“type”: “callin.io-nodes-base.youTubeTool”,
“typeVersion”: 1,
“position”: [
200,
100
],
“id”: “582676eb-05e5-46cc-8699-ab7a680a155c”,
“name”: “youtube_search”,
“credentials”: {
“youTubeOAuth2Api”: {
“id”: “H0zO4PaLlw2aSpg8”,
“name”: “YouTube account 2”
}
}
}
],
“connections”: {
“Window Buffer Memory1”: {
“ai_memory”: [
[
{
“node”: “AI Learning Coach1”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Send Response1”: {
“main”: [
<span class="chcklst-box fa fa-square-o fa-fw"></span>,
[
{
“node”: “Send Error Response1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Listen for incoming events1”: {
“main”: [
[
{
“node”: “AI Learning Coach1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “AI Learning Coach1”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“AI Learning Coach1”: {
“main”: [
[
{
“node”: “Send Response1”,
“type”: “main”,
“index”: 0
}
]
]
},
“youtube_search”: {
“ai_tool”: [
[
{
“node”: “AI Learning Coach1”,
“type”: “ai_tool”,
“index”: 0
}
]
]
}
},
“pinData”: {
“Listen for incoming events1”: [
{
“update_id”: 896053906,
“message”: {
“message_id”: 290,
“from”: {
“id”: 1781811970,
“is_bot”: false,
“first_name”: “Rahul”,
“last_name”: “Son Boro”,
“language_code”: “en”
},
“chat”: {
“id”: 1781811970,
“first_name”: “Rahul”,
“last_name”: “Son Boro”,
“type”: “private”
},
“date”: 1748948182,
“text”: “hi”
}
}
]
},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “56d42f1378f9595f332abc1af3a15359cbb9d45b96bb92265f23032055a65aa2”
}
}
I'm having trouble retrieving tutorial videos from YouTube.
Could you please share screenshots of the output?
Alternatively, could you clarify what you mean by not able to retrieve tutorial videos from YouTube
?
I understand the issue now:
You cannot reference the output this way because it is a tool, and the output has not been generated yet.
First, set the prompt in the agent to an expression to use {{ $json.message.from.first_name }}
and {{ $now.toLocaleString() }}
:
Then, for the tool, let AI define the parameter:
The Agent will then pass the parameter according to your prompt:
- When you need to find YouTube videos, use the youtube_search tool with a clear search query like ‘python tutorial beginner’ or ‘guitar lessons intermediate’
Hope this helps.
I've hit my YouTube quota. I'll let you know as soon as I'm back within my quota.
Please review the execution logs and examine what was provided to the YouTube search. Consider refining the prompt to produce a more concise search term.