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
That doesn't exist in the skills portion of the export.
"skills": [
{
"user_id": "[email protected]",
"version": "0.0.1",
"name": "generate_and_save_images",
"content": "\nfrom typing ...,
"description": "Generate and save images based on a user's query.",
"libraries": [
"openai"
]
}
],
Modifying line 310 in the utils.py code from: "if skill.secrets:" to test for secrets like this: "if 'secrets' in skill.keys():" seemed to fix the issue.
Steps to reproduce
Install autogenstudio v0.1.3
Start UI -> autogenstudio ui --port 8081
Configure model
Test default workflow - success
export default workflow
copy application code snippet, update workflow path and execute
AttributeError: 'dict' object has no attribute 'secrets'
Model Used
No response
Expected Behavior
No response
Screenshots and logs
2024-07-10 16:28:49.265 | ERROR | autogenstudio.utils.utils:load_code_execution_config:441 - Error initializing Docker executor: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
{
"name": "AttributeError",
"message": "'dict' object has no attribute 'secrets'",
"stack": "---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[8], line 7
5 # run the workflow on a task
6 task_query = "Plot the stock price of NVIDIA YTD."
----> 7 workflow_manager.run(message=task_query)
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:386, in AutoWorkflowManager.run(self, message, history, clear_history)
376 """
377 Initiates a chat between the sender and receiver agents with an initial message
378 and an option to clear the history.
(...)
382 clear_history: If set to True, clears the chat history before initiating.
383 """
385 start_time = time.time()
--> 386 self._run_workflow(message=message, history=history, clear_history=clear_history)
387 end_time = time.time()
389 output = self._generate_output(message, self.workflow.get("summary_method", "last"))
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:99, in AutoWorkflowManager._run_workflow(self, message, history, clear_history)
97 self.sender = self.load(agent.get("agent"))
98 elif agent.get("link").get("agent_type") == "receiver":
---> 99 self.receiver = self.load(agent.get("agent"))
100 if self.sender and self.receiver:
101 if history:
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:272, in AutoWorkflowManager.load(self, agent)
267 raise ValueError(
268 "An agent configuration in this workflow is empty. Please provide a valid agent configuration."
269 )
271 linked_agents = agent.get("agents", [])
--> 272 agent = self.sanitize_agent(agent)
273 if agent.type == "groupchat":
274 groupchat_agents = [self.load(agent) for agent in linked_agents]
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:249, in AutoWorkflowManager.sanitize_agent(self, agent)
247 if skills:
248 skills_prompt = ""
--> 249 skills_prompt = get_skills_from_prompt(skills, self.work_dir)
250 if agent.config.system_message:
251 agent.config.system_message = agent.config.system_message + "
" + skills_prompt
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/utils/utils.py:310, in get_skills_from_prompt(skills, work_dir)
308 prompt = "" # filename: skills.py
309 for skill in skills:
--> 310 if skill.secrets:
311 for secret in skill.secrets:
312 print(">> Secret", secret)
AttributeError: 'dict' object has no attribute 'secrets'"
}
Additional Information
No response
The text was updated successfully, but these errors were encountered:
"Modifying line 310 in the utils.py code from: "if skill.secrets:" to test for secrets like this: "if 'secrets' in skill.keys():" seemed to fix the issue."
Update: The above had issues when the skill was a Skill. Since the issue is caused when the skill is a Dict from the json import, added check for skill being a Skill:
for skill in skills:
if (isinstance(skill, Skill) and skill.secrets):
for secret in skill.secrets:
if secret.get("value"):
os.environ[secret["secret"]] = secret["value"]
if not isinstance(skill, Skill):
skill = Skill(**skill)
Describe the bug
Exporting the default workflow and attempting to run using provided code snippet results in "AttributeError: 'dict' object has no attribute 'secrets'"
This seems to appear due to the unchecked expectation of a skills.secrets attribute in the code:
autogen/samples/apps/autogen-studio/autogenstudio/utils/utils.py
Line 310 in 421fa8e
That doesn't exist in the skills portion of the export.
"skills": [
{
"user_id": "[email protected]",
"version": "0.0.1",
"name": "generate_and_save_images",
"content": "\nfrom typing ...,
"description": "Generate and save images based on a user's query.",
"libraries": [
"openai"
]
}
],
Modifying line 310 in the utils.py code from: "if skill.secrets:" to test for secrets like this: "if 'secrets' in skill.keys():" seemed to fix the issue.
Steps to reproduce
Model Used
No response
Expected Behavior
No response
Screenshots and logs
2024-07-10 16:28:49.265 | ERROR | autogenstudio.utils.utils:load_code_execution_config:441 - Error initializing Docker executor: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
{
"name": "AttributeError",
"message": "'dict' object has no attribute 'secrets'",
"stack": "---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[8], line 7
5 # run the workflow on a task
6 task_query = "Plot the stock price of NVIDIA YTD."
----> 7 workflow_manager.run(message=task_query)
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:386, in AutoWorkflowManager.run(self, message, history, clear_history)
376 """
377 Initiates a chat between the sender and receiver agents with an initial message
378 and an option to clear the history.
(...)
382 clear_history: If set to True, clears the chat history before initiating.
383 """
385 start_time = time.time()
--> 386 self._run_workflow(message=message, history=history, clear_history=clear_history)
387 end_time = time.time()
389 output = self._generate_output(message, self.workflow.get("summary_method", "last"))
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:99, in AutoWorkflowManager._run_workflow(self, message, history, clear_history)
97 self.sender = self.load(agent.get("agent"))
98 elif agent.get("link").get("agent_type") == "receiver":
---> 99 self.receiver = self.load(agent.get("agent"))
100 if self.sender and self.receiver:
101 if history:
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:272, in AutoWorkflowManager.load(self, agent)
267 raise ValueError(
268 "An agent configuration in this workflow is empty. Please provide a valid agent configuration."
269 )
271 linked_agents = agent.get("agents", [])
--> 272 agent = self.sanitize_agent(agent)
273 if agent.type == "groupchat":
274 groupchat_agents = [self.load(agent) for agent in linked_agents]
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/workflowmanager.py:249, in AutoWorkflowManager.sanitize_agent(self, agent)
247 if skills:
248 skills_prompt = ""
--> 249 skills_prompt = get_skills_from_prompt(skills, self.work_dir)
250 if agent.config.system_message:
251 agent.config.system_message = agent.config.system_message + "
" + skills_prompt
File ~/git/test/autogenstudio-v0.1.3/autogen/samples/apps/autogen-studio/autogenstudio/utils/utils.py:310, in get_skills_from_prompt(skills, work_dir)
308 prompt = "" # filename: skills.py
309 for skill in skills:
--> 310 if skill.secrets:
311 for secret in skill.secrets:
312 print(">> Secret", secret)
AttributeError: 'dict' object has no attribute 'secrets'"
}
Additional Information
No response
The text was updated successfully, but these errors were encountered: