क्या Agents इलेक्ट्रिक भेड़ों के बारे में सोचते हैं? ReAct फ्रेमवर्क

AI Agents परिचय

Adel Nehme

VP of AI Curriculum, DataCamp

मॉडल की सोच के अलग प्रकार

1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Planning "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Planning "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date"
Analysis "Looking at their spending patterns, they're overpaying for subscriptions they rarely use"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Planning "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date"
Analysis "Looking at their spending patterns, they're overpaying for subscriptions they rarely use"
Decision-making "Since they need it by tomorrow, I should suggest express shipping despite the extra cost"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Planning "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date"
Analysis "Looking at their spending patterns, they're overpaying for subscriptions they rarely use"
Decision-making "Since they need it by tomorrow, I should suggest express shipping despite the extra cost"
Problem-solving "To optimize this code, I should first profile it to identify bottlenecks"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Memory integration "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Memory integration "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions"
Self-reflection "I was too technical in my explanation - let me simplify this using everyday analogies"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Memory integration "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions"
Self-reflection "I was too technical in my explanation - let me simplify this using everyday analogies"
Goal-setting "Before planning their workout routine, I need to understand their fitness level and available time"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

मॉडल की सोच के अलग प्रकार

Thought Example
Memory integration "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions"
Self-reflection "I was too technical in my explanation - let me simplify this using everyday analogies"
Goal-setting "Before planning their workout routine, I need to understand their fitness level and available time"
Prioritization "They should book the flights before the hotel, since flight prices increase faster"
1 The Hugging Face Agents Course: https://github.com/huggingface/agents-course
AI Agents परिचय

ReAct फ्रेमवर्क: सोच कहाँ से आती है

react

1 Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., Cao, Y. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv preprint arXiv:2210.03629.
AI Agents परिचय

ReAct फ्रेमवर्क: Reasoning और Acting

Reasoning

Acting

1 Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., Cao, Y. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv preprint arXiv:2210.03629.
AI Agents परिचय

ReAct फ्रेमवर्क: Reasoning और Acting

Reasoning

Chain of thought prompting

[Prompt...]. Think step by step.

Acting

1 Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., Cao, Y. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv preprint arXiv:2210.03629.
AI Agents परिचय

ReAct फ्रेमवर्क: Reasoning और Acting

Reasoning

Chain of thought prompting

[Prompt...]. Think step by step.

Acting

Thought > Action > Observation examples

[Prompt...]. Follow this format:

  • Thought: [Think about what to calculate first]
  • Action: [Perform calculation]
  • Observation: [Result of calculation]
  • ...repeat as needed...
  • Final Answer: [Complete solution]
1 Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., Cao, Y. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv preprint arXiv:2210.03629.
AI Agents परिचय

ReAct इन एक्शन: सरल गणित

gpt-4o

AI Agents परिचय

ReAct इन एक्शन: सरल गणित

$$

The question

Calculate the total cost if I buy 3 laptops at $899 each with a 15% discount and 8% sales tax

$$

The correct answer

$2475.85

AI Agents परिचय

ReAct इन एक्शन: सरल गणित

incorrect

Prompt used

Calculate the total cost if I buy 3 laptops at $899 each with a 15% discount and 8% sales tax. Only return the answer.

AI Agents परिचय

ReAct इन एक्शन: सरल गणित

correct

Prompt used

Calculate the total cost if I buy 3 laptops at $899 
each with a 15% discount and 8% sales tax. Think step by step.

Follow this format:

Thought: [Think about what to calculate first]
Action: [Perform calculation]
Observation: [Result of calculation]
...repeat as needed...
Final Answer: [Complete solution]

Example:

Thought: Calculate base cost first
Action: 2 × $50 = $100
Thought: Apply 10% discount
Action: $100 - ($100 × 0.10) = $90
Final Answer: Total is $90
AI Agents परिचय

बिना ReAct प्रॉम्प्टिंग के

incorrect_answer

The correct answer $2475.85

ChatGPT answer: $2,776.63

AI Agents परिचय

ReAct प्रॉम्प्टिंग के साथ

correct_answer

The correct answer $2475.85

ChatGPT answer: $2475.85

AI Agents परिचय

ReAct एक सोचने का तरीका

ReAct मॉडल के system prompt का हिस्सा है

System prompt छिपे हुए निर्देश होते हैं जो मॉडल को पूरी बातचीत में कैसे व्यवहार करना है, यह बताते हैं.

1 Image generated with GPT-4o
AI Agents परिचय

Reasoning मॉडल और ReAct

$$

  • ReAct विशेष तौर पर "पारंपरिक" भाषा मॉडलों, जैसे GPT-सीरीज़, पर उपयोगी है
  • नई पीढ़ी के reasoning मॉडल step by step सोचने के लिए प्रशिक्षित होते हैं, उन्हें ReAct prompting की ज़रूरत नहीं होती

$$ Reasoning मॉडलों के उदाहरण

  • OpenAI o-series के मॉडल
  • DeepSeek R-series के मॉडल
  • Gemini thinking मॉडल
AI Agents परिचय

Reasoning मॉडल कैसे पहचानें

thinking_models

AI Agents परिचय

अभ्यास करते हैं!

AI Agents परिचय

Preparing Video For Download...