-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: autogen.runtime_logging.start do not write the log into sqllite when using it in python with multiy thread #1822
Comments
@flyxia are you using async chats? Can you share your code that reproduces this? cc @cheng-tan |
Hi @flyxia can you provide a small code sample to reproduce this issue? Thank you. |
Same here, I'm using Flask and Socket.IO to communicate with Autogen. # Override the _print_received_message method for sending to socket
def new_print_received_message(self, message, sender):
socketio.emit('message', {"sender": sender.name,
"content": message})
GroupChatManager._print_received_message = new_print_received_message On the Flask side, I do this: @socketio.on('send-message')
def handle_message(message):
global chat_started
if ( chat_started == False ):
chat_started = True
session['current_session_id'] = autogen.runtime_logging.start(logger_type="sqlite", config={"dbname": "logging.db"})
user_proxy.initiate_chat(
manager,
message=message,
summary_method="last_msg"
)
autogen.runtime_logging.stop()
else:
user_proxy.send(message, manager)
@app.route('/')
def index():
return render_template('index.html') While it works, suddenly I encounter an issue where the logger stops working while chatting with agents:
User Proxydef is_termination_msg(content) -> bool:
print(content)
have_content = content.get("content", None) is not None
if have_content and "TERMINATE" in content["content"]:
return True
return False
user_proxy = UserProxyAgent(
'user_proxy',
system_message="...",
human_input_mode="TERMINATE",
is_termination_msg= is_termination_msg,
) Info about the projectI'm creating a chat group using a graph with the goal of generating emails based on information that the user sends to the chats. The flow is as follows:
I also use function to collect client information, mail structure, today date, etc. I'm not sure if Autogen is a good choice for such a tool, especially considering the heavy need for real user input. |
thank you @monteduro, I'm looking into this issue, will send a fix shortly |
@monteduro Have you seen sequential chats? It may be better suited for your use case then group chat. See "Sequential Multi-Agent Chats" in the examples: https://microsoft.github.io/autogen/docs/Examples |
Describe the bug
this is the error info:
[SqliteLogger] log_chat_completion error: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 13416 and this is thread id 21888.
Steps to reproduce
No response
Expected Behavior
we expect it can use in multy thread
Screenshots and logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: