Skip to content

Conversation

@dot-agi
Copy link
Member

@dot-agi dot-agi 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

@dot-agi dot-agi requested a review from areibman January 23, 2025 07:24
@codecov
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!

@dot-agi dot-agi merged commit b391685 into main Jan 24, 2025
9 of 10 checks passed
@dot-agi dot-agi 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

3 participants