Ferramentas do agente

ask_user

ask_user({ question, options? })

Pregunt-te e attende. Esiste solo quando fornisce onPregunta — sin di essa, l'agente non ha modo de chiedere.

category: readneeds onQuestionnot for subagents
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

questionstringobrigatório

- Cee que si chiede.

optionsstring[]

Due a quattro risposte breves, quando può offrir.

Quando il sollevi

  • La richiesta è ambigua e la scelta è genuinamente tua.
  • Dopo due tentazioni fallite a la stessa approccio — si dice a chiedere piuttosto que improvvisare un tercio.

L'abre

api.agents.create({
  runtime: "local", machine: pc, model,
  onQuestion: async ({ question, options }) => askThePerson(question, options),
});
api.agents.create(
    runtime="local", machine=pc, model=model,
    on_question=lambda request: ask_the_person(request["question"], request["options"]),
)

Un evento question è emitit prima che il callback sia atteso, per cui un'interfàcia puè pinturar il dialog mentre il loop attende.

Senza il callback

L'utenda non è dichiarat

Un agente senza interrogazione è instruit a fare un giudizio o explicar lo che blocca. Que è un run differente, non un blocched — ma significa un agente non vigilat va a scegliere per voi.

Un subagente non lo capisce mai

Un dei tre strumenti che un subagente fa senza, insieme con todo_write e memory. Se dice non può parlare con voi e deve informar in cambio.