Prompt Engineering & LLM Optimization for Developers · Ders

ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme

Modelin yalnızca belleğinden yanıtlayamayacağı görevleri çözmek için akıl yürütme adımlarını araç eylemleriyle dönüşümlü olarak kullandığı ReAct kalıbını öğrenin.

4. ders / 413 adım

ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme, CoddyKit'te ücretsiz bir Prompt Engineering & LLM Optimization for Developers dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Prompt Engineering & LLM Optimization for Developers öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Prompt Engineering & LLM Optimization for Developers kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

When Thinking Is Not Enough

Chain-of-thought helps a model reason, but reasoning alone cannot fetch live data or run code. The ReAct pattern combines Reasoning with Acting so the model can use tools mid-task.

The ReAct Loop

ReAct alternates three roles in a loop:

  • Thought: reason about what to do next.
  • Action: call a tool with an input.
  • Observation: read the tool's result.

Repeat until the answer is ready.

A ReAct Trace

A typical trace looks like this. The model emits a thought, an action, then waits for an observation injected back into the prompt.

Thought: I need today's weather in Paris.
Action: get_weather("Paris")
Observation: 18C, light rain
Thought: I can now answer.
Answer: It is 18C with light rain in Paris.

Defining the Tools

You describe the available tools in the prompt: their names, what they do, and the input format. The model picks among them.

Tools:
- search(query): web search
- calc(expr): evaluate math
- get_weather(city): current weather

Stopping at the Action

In practice your code stops generation when it sees an Action, executes the real tool, then appends the Observation and resumes the model. The model never invents tool results itself.

Why It Reduces Hallucination

Because the model grounds each step in real observations, ReAct cuts hallucination on factual or computational tasks. The reasoning explains why each tool was called, aiding debugging.

Multi-Step Problems

ReAct shines on tasks needing several lookups: find a company, then its founder, then that person's birth year. Each step's observation feeds the next thought.

Limiting the Loop

Always cap the number of iterations. Without a limit, a confused model can loop forever calling tools. Add a max-step budget and a fallback answer.

for step in range(MAX_STEPS):
    out = model(prompt)
    if is_answer(out): break
    obs = run_tool(parse_action(out))
    prompt += observation(obs)

Handling Tool Errors

Tools fail: timeouts, bad inputs, empty results. Feed the error back as an observation so the model can retry differently rather than crashing the loop.

Observation: ERROR: city not found.
Thought: I should try the full country name.

ReAct vs Plain Chain-of-Thought

  • CoT: reasons internally, no external data.
  • ReAct: reasons AND acts on the world via tools.

Use ReAct whenever the answer depends on information the model cannot already know.

Foundation for Agents

ReAct is the backbone of modern LLM agents. Frameworks like LangChain implement this thought-action-observation loop under the hood to build autonomous tool-using assistants.

Quick Check

Test your understanding of ReAct.

Recap

ReAct interleaves Thought, Action, and Observation so the model reasons and uses real tools. It grounds answers, reduces hallucination, needs a step limit and error handling, and underpins modern LLM agents.

Başlamak ücretsiz

Yapay zeka eğitmeniyle Prompt Engineering & LLM Optimization for Developers öğren — ücretsiz

Tarayıcında gerçek kod yaz ve çalıştır, 7/24 yapay zeka eğitmeninden anında yardım al; web'de ya da uygulamada kaldığın yerden devam et.

Kurslar
12
Dersler
48

Sıkça Sorulan Sorular

“ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme” dersi ücretsiz mi?

Evet — “ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Prompt Engineering & LLM Optimization for Developers kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Prompt Engineering & LLM Optimization for Developers kursu toplamda 4 dersten oluşur.

“ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme” dersinde ne öğreneceğim?

Modelin yalnızca belleğinden yanıtlayamayacağı görevleri çözmek için akıl yürütme adımlarını araç eylemleriyle dönüşümlü olarak kullandığı ReAct kalıbını öğrenin. Prompt Engineering & LLM Optimization for Developers ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Prompt Engineering & LLM Optimization for Developers öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Prompt Engineering & LLM Optimization for Developers, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Prompt Engineering & LLM Optimization for Developers dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Prompt Engineering & LLM Optimization for Developers dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Düşünce Zinciri İstem Yazımı
  2. Öz Tutarlılık ve Üretilen Bilgi
  3. Düşünce Ağacı ve Grafik İstemleri
  4. ReAct: Araçlarla Akıl Yürütme ve Eyleme Geçme
← Prompt Engineering & LLM Optimization for Developers Sayfasına Dön