operand / agency

A fast and minimal framework for building agent-integrated systems
https://createwith.agency
MIT License
408 stars 21 forks source link

Potential issues introduced by eventlet #65

Closed hidaris closed 1 year ago

hidaris commented 1 year ago

Hello, thank you for creating such a fantastic project. During my usage, I encountered the issue mentioned in https://github.com/eventlet/eventlet/issues/371. According to the comments in that issue, I resolved the problem by moving the import of 'agency' to the top of the file. If eventlet is required, it would be beneficial to include instructions regarding this aspect.

operand commented 1 year ago

Thanks for reporting this. I'll have to experiment to see what the issue is and how I can best address it. Were you configuring SSL support in some way in your code? And do you have any stack trace or error output you can provide?

I hadn't considered the fact that this would force others to have to import this before other libraries. That's not good. So I'll be looking to fix this right after the heartbeat related bug. I may remove eventlet as a dependency and let others decide whether they want to use it but currently some of the library code probably relies on it's behavior so I may have to rewrite a little bit to do so.

I'm glad you appreciate the project! Lot's more on the way soon!

hidaris commented 1 year ago

There is no SSL support configured in my code. In my testing, if you import other network I/O libraries(some code use requests) before importing the agency module(evenlet monkey patch), this issue will be reproduced.

hidaris commented 1 year ago

Additionally, I would like to add that the request I tested was for the openai gpt3.5 HTTPS interface.

operand commented 1 year ago

Thanks for the extra info. That makes sense. I have a PR ready to merge to remove eventlet from the core library and only use it for the demo application. The demo relies on it along with flask-socketio for the websocket support but the core library didn't really need it.

So the PR should fix this issue causing you to have to import agency first. And you can still use eventlet if you want by importing it similar to the demo.

I'm probably going to merge this shortly and I'll issue a patch release.

hidaris commented 1 year ago

Thank you for your prompt response!

operand commented 1 year ago

Your welcome! Alright all the above is done. It takes a minute for pypi to serve the new version but it should be available shortly.

Closing the issue but if you find anything else let me know. Cheers!