Skip to content
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

LunaryAI automatic Thread and User tracking #2667

Closed
wants to merge 1 commit into from

Conversation

vincelwt
Copy link
Contributor

@vincelwt vincelwt commented Jun 18, 2024

Hi!

This PR extends the Lunary integration to automatically report user conversations using the Threads feature (not just the LLM calls), as well as report the user data if lead capture is enabled.

(Lunary is an open-source LLM monitoring toolkit :) ).

This was requested by many of our mutual users.

For example this is a Flowise conversation:
Screenshot 2024-06-18 at 18 58 39

Now visible into Lunary:
Screenshot 2024-06-18 at 18 59 05

Also with full support for tracing each assistant's message:
Screenshot 2024-06-18 at 18 59 18


I extensively tested this (both with and without Lunary enabled) but let me know if something else is required!

Cheers

@BigFoxMedia
Copy link

Great contribution! Is this also supporting the open source variant of lunary?

So, if we install lunary locally, can we use your integration in this PR to natively connect to the local variant or only the commercial one?

@vincelwt
Copy link
Contributor Author

Hi @BigFoxMedia yes absolutely, this is completely compatible with the open-source version. If you install Lunary locally, you just have to set the correct endpoint to http://localhost:3333 in the settings :) 

uploads: incomingInput.uploads,
prependMessages
})
const runParams = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the correct placement is here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @HenryHengZJ are there events for "on user message" and "on assistant response"? Couldn't find it in the callback handlers space, which seems to be more related with Langchain events (as this PR is for tracking the high level user conversation)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need on user message as we can already have input from the callbacks in AnalyticHandler

For instance, open a thread when onChainStart, and close when onChainEnd. I'd like to keep 3rd party integration on components level and try to reuse the callbacks that are already exposed

@vincelwt
Copy link
Contributor Author

Closing in favor of #3233

@vincelwt vincelwt closed this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants