langchain-ai / langchain-google

MIT License
74 stars 78 forks source link

Added anthropic support for bind_tools, with_structured_output & tool-parsing #288

Closed rvndbalaji closed 3 weeks ago

rvndbalaji commented 3 weeks ago

My very-very first open source contribution

Therefore, please do let me know if any changes are required I personally feel like this is incomplete for some reason, but do let me know

Related Issues

I did the following

  1. Copy pasted the logic from langchain_anthropic.
  2. I was unable to test my changes locally . But I did create a custom inherited class with the overridden bind_tools and with_structured_output methods in jupyter notebooks and it worked- I don't know how test this locally, so I'll be happy to do so if required
  3. If i've made a mistake, please let me know and ill make the required changes

FYI - @lkuligin

lkuligin commented 3 weeks ago

/gcbrun

rvndbalaji commented 3 weeks ago

@lkuligin I've fixed the lint issues by running ruff --fix .

I'll address the unit tests shortly

rvndbalaji commented 3 weeks ago

@lkuligin I have run make format, make lint and make tests locally and everything passed I did notice a few deprecation warnings

Could you please run the workflow again?

lkuligin commented 3 weeks ago

/gcbrun

rvndbalaji commented 3 weeks ago

@lkuligin Hey, so the unit tests failed because the packages were updated in my local and I have now modified them in the .toml file as well

I ran poetry run pytest --release tests/unit_tests/ and 64 passed, 2 warnings in 3.31s

I ran poetry run pytest --release tests/integration_tests and 88 passed, 43 skipped, 2 xfailed, 3 xpassed, 2 warnings in 96.33s (0:01:36)

Please run the workflow again, and hopefully third time's the charm :D

lkuligin commented 3 weeks ago

/gcbrun

lkuligin commented 3 weeks ago

/gcbrun

lkuligin commented 3 weeks ago

/gcbrun

lkuligin commented 3 weeks ago

I added an integration and a few small fixes. @rvndbalaji I'm going to merge it, but it would be great if you could work on another PR with adding unit tests for parser (and also for parsing output and preparing tools calls). Thanks a lot!

lkuligin commented 3 weeks ago

/gcbrun