Complete the code to initialize the research assistant agent with a knowledge base.
agent = ResearchAssistantAgent(knowledge_base=[1])The research assistant agent needs a knowledge base object to access information. Here, my_knowledge_base is the correct input.
Complete the code to make the agent search for a topic.
results = agent.[1]('machine learning basics')
The search method lets the agent find information about a topic in the knowledge base.
Fix the error in the code to generate a summary from search results.
summary = agent.[1](results)The summarize method creates a short explanation from the search results.
Fill both blanks to train the agent and then make a prediction.
agent.[1](training_data) prediction = agent.[2](new_input)
First, the agent must be trained with data using train. Then it can make predictions with predict.
Fill all three blanks to create a report dictionary from keys, values, and a filter condition.
report = [1]: [2] for [3], [2] in data.items() if [2] > 0
This dictionary comprehension uses k as key, v as value, and iterates over k, v pairs in data.items(). The filter keeps only items with value > 0.
