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

groq[major]: ChatGroq (groq integration package) #4467

Merged
merged 10 commits into from
Feb 21, 2024
Merged

groq[major]: ChatGroq (groq integration package) #4467

merged 10 commits into from
Feb 21, 2024

Conversation

bracesproul
Copy link
Collaborator

@bracesproul bracesproul commented Feb 20, 2024

No description provided.

Copy link

vercel bot commented Feb 20, 2024

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

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2024 11:09pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview Feb 21, 2024 11:09pm

@bracesproul bracesproul changed the title [WIP]community[minor]: ChatGroq groq[minor]: ChatGroq Feb 21, 2024
@bracesproul bracesproul changed the title groq[minor]: ChatGroq groq[minor]: ChatGroq (groq integration package) Feb 21, 2024
@bracesproul bracesproul changed the title groq[minor]: ChatGroq (groq integration package) groq[major]: ChatGroq (groq integration package) Feb 21, 2024
@bracesproul bracesproul marked this pull request as ready for review February 21, 2024 22:02
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Feb 21, 2024
@@ -0,0 +1,20 @@
import { ChatGroq } from "@langchain/groq";
Copy link

Choose a reason for hiding this comment

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

Hey there! I've reviewed the code and noticed that the addition explicitly accesses an environment variable using process.env. I've flagged this for your review to ensure it aligns with our best practices. Let me know if you need further assistance!

@@ -0,0 +1,52 @@
import { ChatGroq } from "@langchain/groq";
Copy link

Choose a reason for hiding this comment

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

Hey team, just a heads up that I've flagged a change in the PR that accesses an environment variable using process.env. It's always good to review these changes to ensure proper handling of sensitive information. Keep up the great work!

@@ -0,0 +1,94 @@
{
Copy link

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 this PR introduces changes to the project's dependencies, including both peer and dev dependencies. I've flagged this for your review as it's important to ensure the compatibility and stability of the project. Keep up the great work!

@@ -0,0 +1,350 @@
import {
Copy link

Choose a reason for hiding this comment

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

Hey there! 👋 This is a friendly flag to highlight that the recent changes in the code are accessing environment variables via process.env and getEnvironmentVariable. This is an important change that should be reviewed by the maintainers. Great work on the code! 🚀

@gradenr
Copy link
Contributor

gradenr commented Feb 21, 2024

For the python integration I was asked to add a provider doc page. I assume there's something similar for JS.

Here's an example from my PR:
vercel deploy: https://langchain-lu1zuf8nu-langchain.vercel.app/docs/integrations/providers/groq
mdx file: https://github.com/langchain-ai/langchain/pull/17856/files#diff-7f412d0a3b880dd49da4652a288a5fc50fe7b28dba973ee4626c18ab29a3d285

const res = await chat.invoke([message]);
```

## Development
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice development section. I'm going to add this to the python readme.

const messagesMapped = convertMessagesToGroqParams(messages);

if (params.stream) {
console.log("streaming via _generate");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove log

@jacoblee93
Copy link
Collaborator

LGTM! Remove that log and let's ship.

@jacoblee93
Copy link
Collaborator

For the python integration I was asked to add a provider doc page. I assume there's something similar for JS.

Here's an example from my PR: vercel deploy: https://langchain-lu1zuf8nu-langchain.vercel.app/docs/integrations/providers/groq mdx file: https://github.com/langchain-ai/langchain/pull/17856/files#diff-7f412d0a3b880dd49da4652a288a5fc50fe7b28dba973ee4626c18ab29a3d285

At the moment, just the chat model page for JS! You're all good.

Copy link
Contributor

@gradenr gradenr left a comment

Choose a reason for hiding this comment

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

Thanks for getting this done for us.

apiKey,
});
this.temperature = fields?.temperature ?? this.temperature;
this.modelName = fields?.modelName ?? this.modelName;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we pass the stream here?
this.stream = fields?.stream ?? this.stream;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey, the recommended way of streaming is via the .stream method.

Copy link
Contributor

Choose a reason for hiding this comment

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

are we deprecating the streaming property as well (for other chat models)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bracesproul we should add this - there are niche but legit use cases for invoke with aggregating token information (a big one is agent streamLog actually).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

appreciate the quick action as always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants