PANDUAN AI Bahasa

Alat Panggilan

Panggilan alat membolehkan model meminta operasi melalui antara muka yang ditentukan.

Dengar panduan iniAI-diceritakan · ~2 min

Pada halaman ini2 min dibaca
  1. Gambaran keseluruhan
  2. Pengambilan utama
  3. Menyelam dalam
  4. Retry without duplicating work
  5. Pelaksanaan Dunia Sebenar
  6. Mempraktikkannya
  7. Sumber dan bacaan lanjut
  8. Teruskan Meneroka
  9. Soalan lazim

Gambaran keseluruhan

The application or provider executes the operation and returns a result. A model proposing a tool call is different from that call succeeding, and both are different from the user’s overall task being completed.

Pengambilan utama

  1. Validate authority as well as argument shape.
  2. Design safe retries for side effects.
  3. Verify the resulting state.

Menyelam dalam

Define each tool’s purpose, input schema, output shape, and side effects. A narrowly scoped operation is easier to validate than a general command interface. The tool description should explain when the operation is appropriate without granting the model authority beyond the user’s request. Validate inputs and permissions in application code. A well-formed argument can still identify the wrong account, destination, or amount. Keep secrets out of tool descriptions and return only information the requesting user is allowed to access. Handle errors and uncertain outcomes explicitly. A network timeout may occur before or after an external action completes. Use operation identifiers or a read-back check where possible so a retry does not duplicate a completed action. After execution, supply an accurate result and verify the intended state. Treat text returned by a website or document as untrusted content; it cannot authorize new actions merely because it arrived through a tool. Test cancellation, malformed responses, revoked access, and partial completion as part of the full tool-use loop.

04Contoh yang dikerjakan

Retry without duplicating work

  1. Imagine a task-creation tool accepts request identifier demo-17. The response times out after the task is created.

  2. Look up demo-17 before creating another task. If the service supports idempotency, reuse the same identifier for the retry.

  3. Report completion only after confirming the resulting task and its contents.

Apa yang ditunjukkan

This constructed example separates uncertain transport from the external action’s actual outcome.

Pelaksanaan Dunia Sebenar

Fetch a current record before proposing an update.

Return an operation identifier and verified result after a file save.

Mempraktikkannya

Mengapa ia penting

  • Kelajuan dan skala. Aliran kerja bahasa boleh bergerak lebih pantas tanpa mengorbankan konsistensi.
  • Akses dan capai. Ia meluaskan akses merentas bahasa dan gaya komunikasi.
  • Keputusan yang lebih jelas. Pasukan boleh menghabiskan lebih banyak masa untuk membuat pertimbangan manakala automasi mengendalikan pengulangan.

Berhati-hati untuk

  • Fakta halusinasi boleh memasukkan laporan, aliran sokongan atau hasil penyelidikan secara senyap-senyap.
  • Sensitiviti segera boleh mencipta hasil yang tidak konsisten merentas permintaan yang serupa.
  • Data teks sensitif mungkin terdedah jika kawalan akses lemah.

Langkah seterusnya

  1. Tentukan format output, nada dan standard kualiti sebelum pelancaran.
  2. Respons asas dengan sumber yang dipercayai apabila ketepatan penting.
  3. Simpan pusat pemeriksaan semakan manusia untuk output berkepentingan tinggi.
  4. Jejaki corak kegagalan dan latih semula gesaan atau aliran kerja dengan kerap.

Sumber dan bacaan lanjut

  1. AnthropicHow tool use works

Teruskan Meneroka

Newsletter percuma

Dapatkan taklimat AI harian

Tiga cerita AI yang disahkan setiap pagi hari bekerja, ditulis dalam Bahasa Inggeris biasa. Percuma selamanya, tiada iklan.

Satu e-mel setiap hari bekerja. Berhenti melanggan dalam satu klik. Kami tidak pernah menjual atau berkongsi alamat anda.

Uji diri anda

Take the Tool Calling quiz

Maklum balas segera pada setiap jawapan, dan sijil yang boleh dikongsi dengan ID yang boleh disahkan sebaik sahaja anda lulus kursus.

Mulakan kuiz

Sokong pendidikan AI percuma. AI Understanding ialah pertubuhan bukan keuntungan 501(c)(3) — tiada iklan, tiada bayaran dinding, selamanya. Buat derma

Soalan lazim

Does a model execute a function merely by naming it?

No. The application or tool provider executes the operation. A structured request must be handled, authorized, and checked.