07-agent-as-tool - agent-as-tools.ipynb - Sequential Agent Communication Pattern throws error

Aperta
#40 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
jupyter-notebook, python
Ambito
ai

Direzione di ricerca

Open 07-agent-as-tool/agent-as-tools.ipynb and inspect the research_assistant_2 example and the response handling described in the issue. Reproduce the error by calling research_assistant_2 with a query such as the Titanic example. Done when the call no longer raises the reported attribute error and the sequential agent communication example works.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

07-agent-as-tool - agent-as-tools.ipynb - Sequential Agent Communication Pattern throws error.
There is no example offered to test the research_assistant_2 function. The next section shows an unrelated 'use_llm tool' example that loops endlessly. Not sure why that is there.

I created a cell to test research_assistant_2 tool:
query = "Can you do a research on the Titanic?"
research_assistant_2(query)

This throws an error: "Error in research assistant: 'dict' object has no attribute 'content'"

The suggested fix is to modify research_assistant_2 tool:

research_text = research_response.message.content[0]["text"]
Change to: research_text = research_response.message['content'][0]["text"]

summary_text = summary_response.message.content[0]["text"]
Change to: summary_text = summary_response.message['content'][0]["text"]

Lingua principale
Python
Stelle
897
Fork
450
Merge medio
1g 9h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di strands-agents/samples

Tutte le issue di strands-agents/samples

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.