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

community: use api token from Replicate constructor for service access #27859

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

fayvor
Copy link
Contributor

@fayvor fayvor commented Nov 2, 2024

Description:

  • In the Replicate LLM, when a replicate_api_token is passed into the Replicate constructor, use it to create a private Client. Use that instead of the default Client to access the service for things like model lookups.
  • Test that the api token is used by the model to access the service.

Issue:
#27861

Dependencies:
N/A

Twitter handle:
N/A

Copy link

vercel bot commented Nov 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 14, 2024 0:17am

@fayvor fayvor marked this pull request as ready for review November 2, 2024 16:52
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. community Related to langchain-community labels Nov 2, 2024
Copy link
Member

@efriis efriis left a comment

Choose a reason for hiding this comment

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

why were the pytest options changed?

libs/community/pyproject.toml Outdated Show resolved Hide resolved
@efriis efriis self-assigned this Dec 12, 2024
Copy link
Member

@efriis efriis left a comment

Choose a reason for hiding this comment

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

I believe this is unfortunately a breaking change for folks on the v0 replicate client. We have 2 options:

  1. we can close this PR and would recommend implementing a dedicated integration package, such that breaking changes can be tolerated moving forward. See these docs
  2. we can update the docs to show that this community Replicate integration is meant to be used with replicate==0.x
  3. we can add some if/else statements to the integration to tolerate both the v0 and v1 sdk

let me know what you prefer! I'd be strongly in favor of [1]!
5.

@efriis
Copy link
Member

efriis commented Dec 16, 2024

let me know what you think! For [1] and [2], I think it makes sense to close this PR and reopen separately as a docs change. For [3] could iterate here. If you think [3] is the way forward and you have time to implement that compatibility before the holidays, let me know in the next day or two so we can keep this open! Otherwise we can close this and reopen when those changes have gone in.

@fayvor
Copy link
Contributor Author

fayvor commented Dec 16, 2024

Hi! Thanks for the review. I won't have time to implement [1] but I will add some if/else switches for [3] this week, and you can make the call as to whether to merge.

@efriis
Copy link
Member

efriis commented Dec 16, 2024

great let's go for [3] here this week! If you don't get to it that's ok - I'll close and you're welcome to reopen a pr when it's in!

@ccurme ccurme marked this pull request as draft December 20, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Related to langchain-community size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants