Agente no servidor

destroy()

agent.destroy() → Promise<void>

Destrue le sessioni modela questo agente ha fost dada. Un fallimento in un non ferma ids.

the sessions, not the agentfailures are toleratedcall it when done
Using Python?

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

const writer = await api.models.create({ model: "gemini-3.5-flash" });
const painter = await api.models.create({ model: "gemini-3.1-flash-image" });

const agent = api.agents.create({ model: { main: writer, image: painter }, tools: { … } });

try {
  await agent.run({ inputs });
} finally {
  await agent.destroy();     // both sessions
}
writer = api.models.create(model="gemini-3.5-flash")
painter = api.models.create(model="gemini-3.1-flash-image")

agent = api.agents.create(model={"main": writer, "image": painter}, tools={"image": api.tools.image})

try:
    agent.run(inputs=inputs)
finally:
    agent.destroy()     # both sessions

Cenès che remove

Ogni sessione di modelli passata come model — il single, o ogni voce di un set nominato. L'ogget agente in sé è ordinaria e non necessita di pulire.

Un falliment su un non ferma il resto

Ogni sessione è distrutta independentmente, e un reniere su uno è tollerata. Limpiezza che renuncia a midjame deja esattamente la cosa che era destinato a remover.

Non potan ser tuas per destruir

Sessioni create fora del agente sono distruse tambèn

Assegna a tès otès, non solo a cenès. Una sessione condivisa tra due agenti è partit per ambele — construir un per agente, o non chiamare a isto.

Destruire del motor local è una cosa differente

Lì retira il Sessù d'agente — la conversazione, la rivista e i punti di control.