Skip to content

Conversation

aniketmaurya
Copy link
Collaborator

@aniketmaurya aniketmaurya commented Jul 31, 2025

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Users can use LangChain tools with LitAI

from langchain_core.tools import tool as langchain_tool
from litai import LLM


@langchain_tool
def get_weather(city: str) -> str:
    """Get the weather of a given city"""
    return f"Weather in {city} is sunny."

llm = LLM("openai/gpt-4")
llm.chat("What's the weather in Tokyo?", tools=[get_weather])

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88%. Comparing base (1f08769) to head (194d4ce).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@        Coverage Diff         @@
##           main   #24   +/-   ##
==================================
+ Coverage    88%   88%   +1%     
==================================
  Files         6     6           
  Lines       333   364   +31     
==================================
+ Hits        292   322   +30     
- Misses       41    42    +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aniketmaurya aniketmaurya changed the title wip: Support LangChain tools Support LangChain tools Jul 31, 2025
@aniketmaurya aniketmaurya merged commit 27ef385 into main Jul 31, 2025
31 checks passed
@aniketmaurya aniketmaurya deleted the aniket/langchain-tool branch July 31, 2025 16:34
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.

2 participants