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

[Feat] Improved LangChain Callback Handler #659

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

the-praxs
Copy link
Member

@the-praxs the-praxs commented Jan 23, 2025

📥 Pull Request

📘 Description

  • Fixes [Bug]: LangChain callback handler on_llm_start/end issue #656
  • Adds new methods on_chat_model_start and on_llm_new_token based on the latest callbacks docs
  • Adds logic in case key is not found when retrieving events
  • Parses SystemMessage and HumanMessage to ChatML format
  • Adds logic to check if the completions is not similar to the message content
  • Updates the _test_langchain_handler.py file to use the latest langchain release APIs

🧪 Testing
Tested using the notebook and updated langchain testing file

@the-praxs the-praxs requested a review from areibman January 23, 2025 07:24
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 71 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agentops/partners/langchain_callback_handler.py 0.00% 71 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@areibman areibman left a comment

Choose a reason for hiding this comment

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

Notebook run looks great, approved!

@the-praxs the-praxs merged commit b391685 into main Jan 24, 2025
9 of 10 checks passed
@the-praxs the-praxs deleted the feat/new-langchain-callback-handler branch January 24, 2025 08:43
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.

[Bug]: LangChain callback handler on_llm_start/end issue
2 participants