ข้าม​ไป​ยัง​เนื้อหา

ประกอบ​ร่าง: autonomous agent กับ​เงื่อนไข​หยุด​แบบ​ประกอบ

เจ็ด​บท​ที่​ผ่าน​มา​คุณ​ถอด loop ของ #15 ออก​เป็นชิ้นๆ แล้ว​เปลี่ยน​ที​ละ clause: บท1 วาง​กรอบ​ว่า​เงื่อนไข​หยุด​คือ นโยบาย​ประกอบ ไม่ใช่ predicate เดียว, บท2 ลาก​เส้น​แบ่ง workflow กับ agent แล้ว​ตั้ง​ด่าน​ความ​เรียบ​ง่าย​ก่อน​เอื้อมหา agent, บท3–5 สำรวจ workflow pattern (chaining, routing, parallelization, orchestrator-workers) และ​เมื่อไร​มัน​คุ้ม​ค่า, บท6 ใส่ reflection แบบ​มี​สติ, บท7 ทำให้​ทนทาน​ด้วย tool-error recovery / retry / timeout / idempotency บท​นี้​คือ​บท​ประกอบ​ร่าง — เอา​ทุก​ชิ้น​มา​รวม​เป็น agent อิสระ​ตัว​เดียว คร่อม agent Order เดิม แล้ว​จ่าย​คืน​สัญญา​ที่​บท1 ตั้ง​ไว้: stop policy 5 clause ที่​ทำงาน​จริง

Anthropic ปิด​วง​ด้วย​ประโยค​เดียว​กับ​ที่​บท1 เปิด — “Agents are typically just LLMs using tools based on environmental feedback in a loop.” agent อิสระAutonomous Agentตาม​นิยาม BEA: 'systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks' — model กำหนด​ทิศทาง​ของ​ตัวเอง​แบบ dynamic; harness + loop ของ​บท1 คือ​สิ่ง​ที่​ทำให้​ระบบ​เป็น agent ไม่ใช่ workflow แลก​ความ​ยืดหยุ่น​มา​ด้วย latency + cost + โอกาส​สะสม error จึง​ต้อง​คุ้ม​ค่า​ก่อน​จึง​จะ​ใช้ (ประกอบ​จริง​ใน​บท8)Architecture ที่​เรา​จะ​ประกอบ​ก็​แค่​นั้น: augmented LLM (context จาก #16) วาง​อยู่​ข้าง​ใน loop ที่ มี​ขอบ (harness จาก #17) มนุษย์​เป็น​คน​สตาร์ท จาก​นั้น​มัน​วางแผน​และ​เดิน​เอง​จนกว่า​จะ​ชน clause ใด clause หนึ่ง​ของ​นโยบาย​หยุด

📦 code ตัวอย่าง

บท​นี้​ประกอบ​ทุก​อย่าง​จาก​บท1–7 เข้า​เป็น LoopController ตัว​เดียว​คร่อม agent Order จาก​คอร์ส #15 (พร้อม context layer จาก #16) — repo kaen-food-ordering (กำลัง​จัด​ทำ) ไม่มี tool หรือ store ใหม่​มี​แต่ runtime ที่​โต​เต็ม​วัย: loop แบบ hand-rolled ที่​ตรวจ​นโยบาย​หยุด​แบบ​ประกอบ บวก​มิเตอร์​วัด token ต่อ run กติกา API ฝั่ง​แชต​ทุก​ข้อ​ยัง​ยึด​เดิม​จาก​บท1 ทุก​ประการ

เส้น​แบ่ง​จาก workflow (บท2) คือ agent อิสระ กำหนด​ทิศทาง​ของ​ตัวเอง Anthropic อธิบาย​วงจร​ชีวิต​ของ​มันไว้ตรงๆ — “Agents begin their work with either a command from, or interactive discussion with, the human user. Once the task is clear, agents plan and operate independently, potentially returning to the human for further information or judgement.” และ​จุด​สำคัญ​ที่​จ่าย​คืน clause สุดท้าย​ของ​นโยบาย​หยุด: agent “can then pause for human feedback at checkpoints or when encountering blockers.”

map ลงบน agent Order: มนุษย์​พิมพ์ “ออเดอร์ A-1002 อยู่​ไหน ถ้า​ส่ง​ช้า​ให้​คืน​เงิน” → agent วางแผน​เอง (เรียก getDeliveryStatus, ตัดสิน​ความ​ล่าช้า, เรียก issueRefund) → แต่ issueRefund เป็น write action (บท1) ที่​มี​ผล​ข้าง​เคียง​กับ​เงิน​จริง จึง​เป็น​จุด​ที่​เหมาะ​จะ pause for human feedback at a checkpoint — checkpoint ไม่ใช่​ของ​แถม แต่​คือ clause หนึ่ง​ใน​นโยบาย​หยุด

รูปทรง loop คือ gather context → take action → verify work → repeat (Claude Agent SDK) เหมือน​บท1 — สิ่ง​ที่​บท​นี้​เพิ่ม​ไม่ใช่​รูปทรง แต่​คือ เพดาน รอบวง​นั้น

บท1 เขียน​สัญญา​นี้​ไว้​ว่า stop check ของ #15 (stop_reason != "tool_use") เป็น​แค่​เคส degenerate บท​นี้​ประกอบ นโยบาย​หยุดStopping Conditionเงื่อนไข​หยุด loop — เป็น 'นโยบาย​ประกอบ' (compound policy) ไม่ใช่ predicate เดียว: task-complete ∨ max-iterations ∨ token/cost-budget ∨ unrecoverable-error ∨ human-checkpoint (BEA + Huyen) `stop_reason != tool_use` ของ #15 คือ​เคส degenerate ของ​นโยบาย​นี้ ทุก​บท​ลงมือ​แทนที่​ที​ละ clause; loop ออก​ทันที​ที่ clause แรก trip และ log เหตุผล​ที่​ออก (ตั้ง​ไว้​บท1 จ่าย​คืน​บท8)Process เต็ม​รูป5 clause แล้ว​ห่อ​ไว้​ใน LoopController ที่​ประเมิน ที่​หัว​ของ​ทุกรอบ ก่อน​เรียก model ครั้ง​ถัด​ไป — ออก​จาก​วง​ทันที​ที่ clause แรก​ทริป และ log เหตุ​ที่​ออก​เสมอ:

  1. task-complete (done signal) — assistant turn ที่​ไม่มี tool call เลย ใน​ระดับ raw คือ stop_reason เป็น end_turn นี่​คือ ทางออก​สำเร็จ​เพียง​หนึ่ง​เดียว Anthropic เรียก​ว่า “terminates upon completion” ⚠️ อย่า​เช็ก​แค่ “ไม่มี tool call” — ถ้า stop_reason เป็น max_tokens หรือ model_context_window_exceeded แปล​ว่า​คำ​ตอบ​ถูก​ตัด​กลางคัน ไม่ใช่​เสร็จ (ดู​ตาราง stop_reason ของ Anthropic) ต้อง​แยก​จาก done จริง
  2. Step BudgetStep Budgetเพดาน​จำนวน​รอบ​แบบ​ตายตัว (`iterations >= MaxIterations`) ที่​รักษาการ​ควบคุม loop ไว้​และ​กัน runaway 1,000 ขั้น — BEA: 'stopping conditions (such as a maximum number of iterations) to maintain control'; Huyen: heuristic 'ตัด​แผนที่​เกิน X ขั้น' บน middleware loop คือ knob `MaximumIterationsPerRequest`Process (เพดาน​จำนวน​รอบ)iterations >= MaxIterations Anthropic ระบุ​ว่า stopping condition อย่าง “a maximum number of iterations… to maintain control” มี​ไว้​กัน​แผน​พัน​ขั้น​ที่​ไม่​ไป​ไหน
  3. Cost BudgetCost Budgetเพดาน token/เงิน​ที่​สะสม​ข้าม​เทิร์น (จาก UsageDetails) แล้ว​หยุด​เมื่อ runCost ถึง​เพดาน — มี​ไว้​เพราะ error สะสม​แบบ​ทวีคูณ (95%^N: 10 ขั้น ≈ 60%, 100 ขั้น ≈ 0.6% — Huyen, ตัวเลข​ประกอบ) และ multi-actor กิน token มาก (MARS 15×) จึง​ต้อง bound loop ให้​แน่น ⚠️ `ChatResponse.Usage` เป็น connector-populated/beta-mapped — งาน​ระดับ​บิล​ต้อง cross-check `RawRepresentation`Process (เพดาน token) — สะสม token จาก usage ข้าม​ทุก​เทิร์น หยุด​เมื่อ run.TotalTokenCount >= MaxRunTokens นี่​คือ clause ที่​มิเตอร์​ใน​หัวข้อ​ถัด​ไป​ป้อน​ข้อมูล​ให้
  4. error ที่​กู้​ไม่​ได้ — บท7 แยก error กู้​ได้ (ป้อน​กลับ​เป็น instructive message ให้ model ลอง​ใหม่) ออก​จาก error กู้​ไม่​ได้ (business-logic ล้ม, tool หาย​ถาวร) อย่าง​หลัง​ไม่​ควร​วน​ต่อ — หยุด​แล้ว escalate
  5. human-checkpoint — write action อย่าง issueRefund ต้อง​ผ่าน​คน​อนุมัติ​ก่อน ถ้า​ยัง​ไม่​อนุมัติ​ก็ pause ตรง​นี้

task-complete เกิน Step Budget เกิน Cost Budget error ที่​กู้​ไม่​ได้ ถึง human-checkpoint

นอก5 clause นี้​ยัง​มี guard เชิง​ปฏิบัติ อีก​ตัว​ที่​คุ้ม​ค่า​จะ​ใส่: no-progress guard — hash ชื่อ+args ของ​ทุก tool call ถ้า model เรียก​ซ้ำ​เดิม​โดย​ไม่​ได้ ground truth ใหม่ ก็​แปล​ว่า​มัน​ติด​วน Anthropic ย้ำ​ว่า “During execution, it’s crucial for the agents to gain ‘ground truth’ from the environment at each step… to assess its progress.” — guard ตัว​นี้​คือ​การ​บังคับ​ใช้​ประโยค​นั้น

flowchart TD
  START["คำสั่งจากผู้ใช้<br/>เริ่ม run"] --> HEAD{"ตรวจนโยบายหยุดที่หัวรอบ"}
  HEAD -->|"ครบ MaxIterations"| S2["หยุด: Step Budget"]
  HEAD -->|"เกินงบ token"| S3["หยุด: Cost Budget"]
  HEAD -->|"ผ่านทุก clause"| CALL["เรียก model + สะสม usage"]
  CALL --> DONE{"มี tool call ไหม"}
  DONE -->|"ไม่มี + end_turn"| OK["หยุด: task complete<br/>ทางออกสำเร็จเดียว"]
  DONE -->|"มี write action"| GATE{"human-checkpoint<br/>อนุมัติ issueRefund?"}
  GATE -->|"ยังไม่อนุมัติ"| S5["หยุด: รอคน"]
  GATE -->|"อนุมัติ / read-only"| DISP["dispatch tool"]
  DISP -->|"error กู้ไม่ได้"| S4["หยุด: unrecoverable"]
  DISP -->|"ผลกลับ / error กู้ได้"| APP["ผนวก FunctionResultContent"]
  APP --> HEAD
  classDef stop fill:#b91c1c,stroke:#7f1d1d,color:#f8fafc;
  class S2,S3,S4,S5 stop;
  classDef okc fill:#15803d,stroke:#14532d,color:#f8fafc;
  class OK okc;

คำ​บรรยาย​ภาพ: loop อิสระ​วง​เดียว โดย​นโยบาย​หยุด​ถูก​ตรวจ ที่​หัว​รอบ ก่อน​เรียก model ทุก​ครั้ง สี่​ช่อง​แดง​คือ​ทางออกแบบ non-done (Step Budget, Cost Budget, unrecoverable, รอคน) ที่​ต้อง escalate เสมอ ส่วน​ช่อง​เขียว​คือ task-complete — ทางออก​สำเร็จ​เพียง​หนึ่ง​เดียว​ใน5 clause

บท1 บอกว่า middleware (.UseFunctionInvocation()) คือ​ค่า​เริ่มต้น แต่​จอง​รูป hand-rolled ไว้​ให้​บท​ที่ stop policy เกิน knob ของ middleware — บท​นี้​คือ​หนึ่ง​ใน​นั้น FunctionInvokingChatClient มี knob ครอบ​แค่​บาง clause:

  • MaximumIterationsPerRequest → Step Budget (clause 2) ✅
  • MaximumConsecutiveErrorsPerRequest → เพดาน error ติด​กัน (ญาติ​ของ clause 4) ✅
  • TerminateOnUnknownCalls → หยุด​เมื่อ model เรียก tool ที่​ไม่รู้จัก ✅

แต่ Cost Budget (clause 3), no-progress guard และ human-checkpoint (clause 5) ไม่มี knob — ต้อง hand-roll เพราะ​มัน​ต้อง​สะสม state ข้าม​เทิร์น (token รวม, hash ของ call ที่​เคย​เห็น) และ​แทรก​การ​ตัดสิน​ใจกลางวง ซึ่ง​เป็น​อย่าง​เดียว​กับ​ที่​บท1 บอกว่า​เป็น​เหตุผล​ให้ hand-roll

รวม​ทุก clause เข้า​เป็น loop เดียว สังเกต​ว่า​มัน​คือ loop แบบ hand-rolled ของ​บท1 ที่​เติม guard เข้าไป​ที่​หัว​และ​กลางวง — ไม่ใช่​โครง​ใหม่ กติกา API เดิม​ทุก​ข้อ​ยัง​อยู่ (claude-opus-4-8 เปล่า ไม่​ต่อ suffix, ไม่​ส่ง temperature, อ่าน​คำ​ตอบ​ผ่าน resp.Messages[].Contents[] ไม่ใช่ .text, ผ่าน NuGet Anthropic beta ด้วย AsIChatClient):

record StopReason(string Kind, string Detail); // log เหตุที่ออกจากวงเสมอ
async Task<StopReason> RunAsync(List<ChatMessage> messages, ChatOptions options, CancellationToken ct)
{
var run = new UsageDetails(); // มิเตอร์ token ทั้ง run (S19)
var seen = new HashSet<string>(); // no-progress guard
for (int step = 0; step < MaxIterations; step++) // clause 2: Step Budget
{
if (run.TotalTokenCount >= MaxRunTokens) // clause 3: Cost Budget
return new("cost", $"เกินงบ {MaxRunTokens} token ที่ step {step}");
ChatResponse resp = await raw.GetResponseAsync(messages, options, ct);
if (resp.Usage is { } u) run.Add(u); // สะสม usage ทุกเทิร์น
messages.AddRange(resp.Messages);
var calls = resp.Messages.SelectMany(m => m.Contents)
.OfType<FunctionCallContent>().ToList();
if (calls.Count == 0) // clause 1: done signal
return new("done", "task complete"); // (ทางออกสำเร็จเดียว)
// clause 5: human-checkpoint — write action ต้องผ่านคนก่อน
foreach (var call in calls.Where(c => c.Name == nameof(IssueRefund)))
if (!await ApproveRefund(call.Arguments))
return new("checkpoint", "รอมนุษย์อนุมัติการคืนเงิน");
// no-progress guard: เรียก tool ชุดเดิมซ้ำโดยไม่ได้ ground truth ใหม่ → ติดวน
var sig = string.Join("|", calls.Select(c => c.Name + JsonSerializer.Serialize(c.Arguments)));
if (!seen.Add(sig))
return new("stuck", "เรียก tool ซ้ำเดิมโดยไม่คืบหน้า");
List<AIContent> results = [];
foreach (var call in calls)
{
object? output;
try { output = await Dispatch(call.Name, call.Arguments); }
catch (UnrecoverableToolException ex) { return new("error", ex.Message); } // clause 4
catch (Exception ex) { output = $"ERROR: {ex.Message}"; } // กู้ได้ → ป้อนกลับ (บท7)
results.Add(new FunctionResultContent(call.CallId, output));
}
messages.Add(new ChatMessage(ChatRole.Tool, results));
}
return new("budget", $"ครบ {MaxIterations} รอบ"); // clause 2: Step Budget หมด
}

3 knob หลัก​คือ MaxIterations, MaxRunTokens และ​รายการ write action ที่​ต้อง checkpoint ทุก​ทางออก​ที่​ไม่ใช่ done ต้อง​คืน คำ​ตอบ​บาง​ส่วน​อย่าง​ซื่อสัตย์ + escalate ไม่ใช่​วน​เงียบๆ — Anthropic บอก​ให้ “pause for human feedback… when encountering blockers”

Cost Budget จะ​ทำงาน​ได้​ต้อง​วัด token จริง ChatResponse.Usage เป็น UsageDetails? โดย field นับ​เป็น long? และ .Add() บวก​สะสม​ข้าม​เทิร์น​ให้:

var run = new UsageDetails();
// ...ในวง ต่อ1 response:
if (resp.Usage is { } u) run.Add(u); // UsageDetails.Add — บวก usage ทั้ง run
// ...จบ run:
Console.WriteLine($"in={run.InputTokenCount} out={run.OutputTokenCount} total={run.TotalTokenCount}");

field ที่​ยืนยัน​แล้ว​ของ UsageDetails: InputTokenCount, OutputTokenCount, TotalTokenCount, CachedInputTokenCount, ReasoningTokenCount, AdditionalCounts และ .Add(UsageDetails)

billing-grade: อย่า​เชื่อ ChatResponse.Usage ดิบๆ

ChatResponse.Usage เป็น​ค่าที่ connector เป็น​คน​เติม ไม่ใช่​สิ่ง​ที่ abstraction การันตี และ​การ map จาก Anthropic → AsIChatClient เป็น beta — field อย่าง CachedInputTokenCount / ReasoningTokenCount อาจ​ถูก​เติม​ไม่​ครบ​หรือ​ไม่​ตรง สำหรับ​การ​คิด​เงิน​จริง ให้ cross-check resp.RawRepresentation หรือ usage ดิบ​จาก client.Messages.* ของ SDK (input_tokens, output_tokens, cache_read_input_tokens, cache_creation_input_tokens) อย่า​ถือตัวเลข​จาก M.E.AI เป็น​ทางการ​โดย​ไม่​ตรวจ mapping บน version SDK ที่ pin ไว้ — มิเตอร์​นี้​พอ​สำหรับ คุม​งบ แต่​ยัง​ไม่​พอ​สำหรับ ออก​ใบเสร็จ

การ log ต่อ​รอบ (iteration, stop reason ถ้า​มี, tool + args + ผล, token เข้า/ออก, cost สะสม, latency) ไม่ใช่​แค่ debug — มัน​คือ hook สำหรับ online-eval ที่​คอร์ส #13 ใช้​นับ failure mode ต่อ 🔁 ความ​ทนทาน (บท7) วาง​ท่อ error ให้ ส่วน​บท​นี้​วาง​ท่อ ตัวเลข ให้

ทั้ง​คอร์ส​นี้​สอน กลไก ของ runtime — แต่​กลไก​ที่​โต​ขึ้น​ไม่​ได้​แปล​ว่า​ควร​ใช้​มาก​ขึ้น Anthropic พูด​ชัด​ว่า “The autonomous nature of agents means higher costs, and the potential for compounding errors.” — สอง​ราคา​นี้​จริง​และ​วัด​ได้ error ทบ​ต้น​เพราะ agent ต้อง​เดิน​หลาย​ขั้น ความ​แม่น​รวม​ลด​ลง​เมื่อ​จำนวน​ขั้น​เพิ่ม ยิ่ง​วน​มาก​ยิ่ง​ไม่ใช่​ยิ่ง​ดี — นี่​คือ​เหตุผล​เชิง​ปริมาณ​ที่​ต้อง บีบ loop ให้​แน่น ด้วย​นโยบาย​หยุด​ข้าง​บน ไม่ใช่​ปล่อย​ให้​มัน​วิ่ง​ฟรี

และ​ราคา​ของ โครงสร้าง ก็​จริง​ไม่​แพ้​กัน MARS ของ Anthropic วัด​ว่า “agents typically use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats.” ⚠️ ตัวเลข 4×/15× นี้​เป็น​ข้อมูล​จาก workload วิจัย​ของ Anthropic เอง ลง​วัน​ที่ 2025-06-13 — เป็น​ผล​วัด ไม่ใช่​กฎ​สากล — แต่​ทิศทาง​ชัด: การ fan-out (บท4) และ orchestrator-workers (บท5) เผา token เป็น​ทวีคูณ

ดังนั้น​คำ​ปิด​ของ​คอร์ส​นี้ ไม่ คลาย default ของ #12 ลง​เลย — single-agent loop ที่​มี​ขอบ​ยัง​เป็น​ค่า​เริ่มต้น โครงสร้าง multi-actor คือ ข้อ​ยกเว้น​ที่​ต้องหา​เหตุผล​มารองรับ ไม่ใช่​อัปเกรด​ที่​เอื้อมหา​โดย​อัตโนมัติ Anthropic ปิด​ด้วย​สอง​ประโยค​ที่​ควร​จำ — “Maintain simplicity in your agent’s design.” และ “Success in the LLM space isn’t about building the most sophisticated system. It’s about building the right system for your needs.” มาตร​วัด​ไม่​เคย​เป็น “มัน agentic กว่า​ไหม” แต่​เป็น “มัน​ทำให้​ผลลัพธ์​ดี​ขึ้น​จริง​ไหม”

คุณ​ประกอบ runtime ของ agent จบ​แล้ว: harness, loop, workflow pattern ห้า​แบบ, ความ​ทนทาน และ agent อิสระ​ที่​มีนโยบาย​หยุด​แบบ​ประกอบ #17 สอน กลไก​ของ runtime โดย​ตั้งใจ — มัน​เชื่อม​กับ​คอร์ส​อื่น​ใน​เสา​หลัก AI ที่​ตอบ​คำถาม​คนละ​ข้อ:

  • ควร​แบ่ง agent ยังไง / เมื่อไร​ควร​มี​หลาย​ตัว → 🔁 Agent as a Bounded Context (#12) — เรื่อง ขอบเขต ที่ #17 อ้าง​ถึง​ตลอด​ใน​ฐานะ default “1 agent 1 loop”
  • runtime นี้​ช่วย​จริง​ไหม / วัด​ยังไง → 🔁 Evals for AI Agents (#13) — trace ต่อ​รอบ​จาก​บท​นี้​คือ input ของ​การ​นับ failure mode
  • ห่อ tool เป็น server share ได้​ยังไง → 🔁 Designing MCP Servers (#14)
  • agent ฐาน​ที่​เรา​ต่อยอด​มา​ทั้ง​คอร์ส → 🔁 Your First AI Agent in C# (#15)
  • จะ​ป้อน context อะไร​เข้า loop นี้ → 🔁 Context Engineering (#16)

🔗 อ้างอิง​ต้นทาง​ของ​บท​นี้

บท​นี้​อิง​ต้นทาง​ที่​ลง​วัน​ที่​กำกับ อ่าน​ต่อ​ได้​โดยตรง:

  • Anthropic, “Building Effective Agents” (2024-12-19) — นิยาม agent (“LLMs using tools based on environmental feedback in a loop”), วงจร​เริ่ม/เดิน/pause-for-human, “ground truth… to assess its progress”, stopping condition “to maintain control”, “higher costs, and the potential for compounding errors” และ​คำ​ปิด simplicity
  • Anthropic, “Building agents with the Claude Agent SDK” (2025-09-29) — รูปทรง loop gather context → take action → verify work → repeat และ​คำ​ว่า “agent harness”
  • Anthropic, “How we built our multi-agent research system” (2025-06-13) — “agents typically use about 4× more tokens… multi-agent systems use about 15× more tokens than chats” (ข้อมูล workload วิจัย​ของ Anthropic เอง — ผล​วัด ไม่ใช่​กฎ)
  • Chip Huyen, “Agents” (2025-01-07) — ความ​แม่น​รวม​ของ agent ลด​ลง​เมื่อ​จำนวน​ขั้น​เพิ่ม (ตัวเลข​ประกอบ 95%^N เช่น 10 ขั้น ≈ 60%, 100 ขั้น ≈ 0.6% เป็นการ​คำนวณ​เชิง​อธิบาย ไม่ใช่​ผล​วัด)
  • Anthropic, “Stop reasons and fallback” — enumeration ของ stop_reason (end_turn, max_tokens, model_context_window_exceeded ฯลฯ) ที่​ต้อง​แยก done จริง​ออก​จาก​คำ​ตอบ​ที่​ถูก​ตัด
  • Microsoft Learn, “UsageDetails” (pkg v10.7.0, upd. 2026-06-12) — InputTokenCount / OutputTokenCount / TotalTokenCount (long?) และ .Add(UsageDetails) สำหรับ​มิเตอร์ token ต่อ run

เช็กความเข้าใจ — บทที่ 8

ข้อ 1 / 3

clause 'task-complete' ของนโยบายหยุด ตรวจแค่ 'ไม่มี tool call' พอไหม?