agentops icon indicating copy to clipboard operation
agentops copied to clipboard

[Feature]: AI Suite integration

Open areibman opened this issue 1 year ago • 3 comments

💡 Feature Description and Proposed Solution

A new LLM chat framework called AI Suite just launched from Andrew Ng's team https://github.com/andrewyng/aisuite

Adding observability callbacks would be a huge value-add for their project. This would involve:

  1. Building a custom instrumentor
  2. If needed, raise a PR to AI suite to improve observability handlers
  3. Add an optional dependency to AI suite to include AgentOps
  4. Updating our docs to show support
  5. Updating their docs to show support

🤔 Related Problem

No response

🤝 Contribution

  • [ ] Yes, I'd be happy to submit a pull request with these changes.
  • [ ] I need some guidance on how to contribute.
  • [X] I'd prefer the AgentOps team to handle this update.

areibman avatar Nov 25 '24 18:11 areibman

Looking at this, right now it looks like the system handles only sync chat completions so it doesn't seem to be anything hard or particularly taxing to work on!

Having observability handlers for LLMEvent, ActionEvent and ActionEvent seems simple enough, but I did have an idea I wanted to get greenlit! I'm thinking about putting this as a sort of simple wrapper and basically making it so if you set more than one provider on the AI Suite side it automatically initializes multi sessions under (providername.agentops_session) and logs the different sessions within each! Users can set a (start_multisession) bool to false to stop this and have it all go under one session.

TKTSWalker avatar Nov 26 '24 17:11 TKTSWalker

I'm halfway through right now and am at the handle_response area; would you rather the entire output is logged with AgentOps as one big message with the different providers all working or the different choices as separate outputs? Or would you rather have an option to toggle between??

TKTSWalker avatar Nov 27 '24 19:11 TKTSWalker

Going to wait until everything is all done to send to the provider; going to take a little time since AISuite doesn't natively have an event for telling when something is finished (Meaning i'll have to make conditionals for each based on the delta block or what other system they might use) but i'm confident I can make instrumentors now so it's more of a time issue than a skill issue!

It pretty much goes down to making a callback for each (which shouldn't take too long thanks to AgentOps having a lot of these already set up to reference) and then doing a wait until complete call! As mentioned in the OP's post, i'll have to make a pull request at the AISuite side for this to work!

TKTSWalker avatar Dec 01 '24 14:12 TKTSWalker