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
Fix Replicate API #5221
base: main
Are you sure you want to change the base?
Fix Replicate API #5221
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -170,7 +170,7 @@ | |||
"prettier": "^2.8.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there! I noticed the "replicate" dependency was updated from "^0.18.0" to "^0.29.1". This comment is just flagging the change for maintainers to review. Keep up the great work!
@@ -97,15 +97,19 @@ export class Replicate extends LLM implements ReplicateInput { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there! I noticed that the recent code change in replicate.ts introduces a new external HTTP request using an API client within the if block. I've flagged this for your review to ensure it aligns with the project's design and requirements. Let me know if you have any questions or need further clarification!
@@ -147,7 +168,8 @@ export class Replicate extends LLM implements ReplicateInput { | |||
Replicate: typeof import("replicate").default; | |||
}> { | |||
try { | |||
const { default: Replicate } = await import("replicate"); | |||
// eslint-disable-next-line @typescript-eslint/no-var-requires,global-require | |||
const Replicate = require("replicate"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause issue in some environments I think?
We actually don't need dynamic imports anymore, since we've added different entrypoints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import
crashed for me in linux and osx with Jest. Is there a better way to do this?
…fix-replicate-streaming
Thanks for this! Ran format and updated imports, but something still seems to be up - the tests all return just |
It needs to be run with a REPLICATE_API_TOKEN env var. I assume CI/CD has this? And also it took two times where it timed out before it started working. I assume this is because Replicate needs to spin up a model on demand? It does work very quickly for me after it spins up. |
Fixes #20757 but for LangChainJS