error occurred while processing message: 'NoneType' object has no attribute 'create' while creating an agent in AutogenStudio #4406
Unanswered
himanshud2611
asked this question in
Q&A
Replies: 1 comment
-
Hi @himanshud2611 , Thanks for the note. That is indeed a bug related to the sequential mode implementation for AutoGen Studio v0.2x At the moment, there is an updated version of AutoGen Studio is being written based on the new v0.4 api (see#4208). It is still early but this is where much of the development effort will be focused going forward. For example your use case can be written in code like this... from autogen_agentchat.agents import AssistantAgent, UserProxyAgent
from autogen_agentchat.task import Console, TextMentionTermination
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models import OpenAIChatCompletionClient
async def read_invoice(pdf_url: str = "https://arxiv.org/pdf/2408.15247", max_pages: int = 1) -> str:
"""
Reads text from a PDF URL.
"""
import PyPDF2
import requests
import io
response = requests.get(pdf_url)
reader = PyPDF2.PdfReader(io.BytesIO(response.content))
pages_to_read = reader.pages[:max_pages]
return "".join(page.extract_text() for page in pages_to_read)
async def main() -> None:
# Define an agent
invoice_agent = AssistantAgent(
name="invoice_agent",
system_message="You are a helpful assistant. Use your read_invoice tool to extract the text from the pdf url",
model_client=OpenAIChatCompletionClient( model="gpt-4o-mini"),
tools=[read_invoice],
)
email_agent = AssistantAgent(
name="email_agent",
system_message="You are a helpful assistant. Please convert the text to a brief email summarizing content.",
model_client=OpenAIChatCompletionClient( model="gpt-4o-mini")
)
user_proxy = UserProxyAgent(name="user_proxy")
# Define termination condition
termination = TextMentionTermination("TERMINATE")
# Define a team
agent_team = RoundRobinGroupChat([invoice_agent, email_agent, user_proxy], termination_condition=termination)
# Run the team and stream messages to the console
stream = agent_team.run_stream(task="Send an email summarizing the pdf https://arxiv.org/pdf/2408.15247")
await Console(stream)
# NOTE: if running this inside a Python script you'll need to use asyncio.run(main()).
await main() and in AGS, this can be represented as a declarative specification that can be used in the UI
cc: @gagb |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue: Error in AutogenStudio Workflow Execution
Steps to Reproduce
read_invoice
with the following code:Model Configuration
gpt-4o-mini
Agent Configuration
read_invoice
(code provided above).Workflow Setup
Here is the workflow configuration:
Playground Test
I used the following prompt in the playground:
Error Observed
I encountered the following error:
Error occurred while processing message: 'NoneType' object has no attribute 'create'
Request for Assistance
Could you please help me identify and fix this issue? I can provide more details if required.
Thank you!
This formatting makes your message clear, organized, and professional for the GitHub discussion.
Beta Was this translation helpful? Give feedback.
All reactions