You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed a similar issue in several places within the agent module. Before calling the model, the constructed input_messages is assigned to self.input_messages. However, it seems that self.input_messages is only used when calling self.model, and not utilized elsewhere.
Wouldn't it be simpler to create a local variable input_messages instead?
Is there a specific design consideration behind this choice?
defprovide_final_answer(self, task) ->str:
""" This method provides a final answer to the task, based on the logs of the agent's interactions. """self.input_messages= [
{
"role": MessageRole.SYSTEM,
"content": "An agent tried to answer a user query but it got stuck and failed to do so. You are tasked with providing an answer instead. Here is the agent's memory:",
}
]
self.input_messages+=self.write_inner_memory_from_logs()[1:]
self.input_messages+= [
{
"role": MessageRole.USER,
"content": f"Based on the above, please provide an answer to the following user request:\n{task}",
}
]
try:
returnself.model(self.input_messages).contentexceptExceptionase:
returnf"Error in generating final LLM output:\n{e}"
The text was updated successfully, but these errors were encountered:
I have noticed a similar issue in several places within the agent module. Before calling the
model
, the constructed input_messages is assigned toself.input_messages
. However, it seems thatself.input_messages
is only used when callingself.model
, and not utilized elsewhere.Wouldn't it be simpler to create a local variable
input_messages
instead?Is there a specific design consideration behind this choice?
smolagents/src/smolagents/agents.py
Line 345 in fe2f4e7
The text was updated successfully, but these errors were encountered: