-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
add GroqSharp provider #303
Conversation
Sweep: PR ReviewSweep is currently reviewing your pr... |
WalkthroughThe update introduces significant enhancements to the LangChain project. Key changes include adding new projects and tests for providers like GroqSharp and Reka, integrating a new workflow file, and reorganizing existing workflows. New classes and methods have been implemented to support GroqSharp functionalities, and package configurations have been updated accordingly. The adjustments also include project type changes and the addition of new package versions. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 5
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- LangChain.sln (5 hunks)
- src/Directory.Packages.props (1 hunks)
- src/Providers/GroqSharp/src/GroqSharpChatModel.cs (1 hunks)
- src/Providers/GroqSharp/src/GroqSharpConfiguration.cs (1 hunks)
- src/Providers/GroqSharp/src/GroqSharpProvider.cs (1 hunks)
- src/Providers/GroqSharp/src/LangChain.Providers.GroqSharp.csproj (1 hunks)
- src/Providers/GroqSharp/src/Predefined/GroqSharpModels.cs (1 hunks)
- src/Providers/GroqSharp/test/GroqSharpTests.cs (1 hunks)
- src/Providers/GroqSharp/test/LangChain.Providers.GroqSharp.Test.csproj (1 hunks)
Files skipped from review due to trivial changes (4)
- src/Directory.Packages.props
- src/Providers/GroqSharp/src/GroqSharpConfiguration.cs
- src/Providers/GroqSharp/src/LangChain.Providers.GroqSharp.csproj
- src/Providers/GroqSharp/test/LangChain.Providers.GroqSharp.Test.csproj
Additional comments not posted (18)
src/Providers/GroqSharp/src/GroqSharpProvider.cs (3)
6-10
: Constructor looks good.
12-24
: Constructor looks good.
5-5
: Property definition looks good.src/Providers/GroqSharp/src/GroqSharpChatModel.cs (5)
13-39
: Verify the usage ofChatSettings.Default
.Ensure that
ChatSettings.Default
is appropriate for the context.
41-44
: Method looks good.
46-49
: Method looks good.
50-58
: Method looks good.
12-12
: Property definition looks good.LangChain.sln (10)
40-40
: Addition ofdeep-infra.yml
looks good.
347-348
: Addition ofLangChain.Providers.Reka
project looks good.
349-349
: Addition ofLangChain.Providers.Reka.Tests
project looks good.
351-351
: Addition ofLangChain.Serve.OpenAI
project looks good.
353-353
: Addition ofLangChain.Samples.Serve.OpenAI
project looks good.
355-355
: Addition ofLangChain.Samples.LocalRAG
project looks good.
357-358
: Addition ofLangChain.Providers.GroqSharp
project looks good.
361-361
: Addition ofLangChain.Providers.GroqSharp.Test
project looks good.
341-341
: Change of project type forLangChain.DocumentLoaders.IntegrationTests
looks good.
347-348
: Change of project type forLangChain.Providers.Reka
looks good.
public class Llama38b8192(GroqSharpProvider provider) | ||
: GroqSharpChatModel(provider, id: "llama3-8b-8192"); |
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.
Class name should follow PascalCase naming convention.
- public class Llama38b8192(GroqSharpProvider provider)
+ public class Llama38B8192(GroqSharpProvider provider)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public class Llama38b8192(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "llama3-8b-8192"); | |
public class Llama38B8192(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "llama3-8b-8192"); |
public class Llama370b8192(GroqSharpProvider provider) | ||
: GroqSharpChatModel(provider, id: "llama3-70b-8192"); |
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.
Class name should follow PascalCase naming convention.
- public class Llama370b8192(GroqSharpProvider provider)
+ public class Llama370B8192(GroqSharpProvider provider)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public class Llama370b8192(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "llama3-70b-8192"); | |
public class Llama370B8192(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "llama3-70b-8192"); |
public class Mixtral8x7b32768(GroqSharpProvider provider) | ||
: GroqSharpChatModel(provider, id: "mixtral-8x7b-32768"); |
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.
Class name should follow PascalCase naming convention.
- public class Mixtral8x7b32768(GroqSharpProvider provider)
+ public class Mixtral8X7B32768(GroqSharpProvider provider)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public class Mixtral8x7b32768(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "mixtral-8x7b-32768"); | |
public class Mixtral8X7B32768(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "mixtral-8x7b-32768"); |
public class Gemma7bIt(GroqSharpProvider provider) | ||
: GroqSharpChatModel(provider, id: "gemma-7b-it"); |
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.
Class name should follow PascalCase naming convention.
- public class Gemma7bIt(GroqSharpProvider provider)
+ public class Gemma7BIt(GroqSharpProvider provider)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public class Gemma7bIt(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "gemma-7b-it"); | |
public class Gemma7BIt(GroqSharpProvider provider) | |
: GroqSharpChatModel(provider, id: "gemma-7b-it"); |
[Test] | ||
public async Task Chat() | ||
{ | ||
|
||
var config = new GroqSharpConfiguration() | ||
{ | ||
ApiKey = Environment.GetEnvironmentVariable("GROQ_API_KEY") ?? | ||
throw new InconclusiveException("GROQ_API_KEY is not set."), | ||
ModelId = "llama3-70b-8192" | ||
}; | ||
|
||
var provider = new GroqSharpProvider(config); | ||
var model = new Llama370b8192(provider); | ||
|
||
string answer = await model.GenerateAsync("Generate some random name:"); | ||
|
||
Console.WriteLine(answer); |
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.
Add assertions to verify the generated response.
- Console.WriteLine(answer);
+ Assert.IsNotNull(answer);
+ Assert.IsNotEmpty(answer);
+ Console.WriteLine(answer);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
[Test] | |
public async Task Chat() | |
{ | |
var config = new GroqSharpConfiguration() | |
{ | |
ApiKey = Environment.GetEnvironmentVariable("GROQ_API_KEY") ?? | |
throw new InconclusiveException("GROQ_API_KEY is not set."), | |
ModelId = "llama3-70b-8192" | |
}; | |
var provider = new GroqSharpProvider(config); | |
var model = new Llama370b8192(provider); | |
string answer = await model.GenerateAsync("Generate some random name:"); | |
Console.WriteLine(answer); | |
[Test] | |
public async Task Chat() | |
{ | |
var config = new GroqSharpConfiguration() | |
{ | |
ApiKey = Environment.GetEnvironmentVariable("GROQ_API_KEY") ?? | |
throw new InconclusiveException("GROQ_API_KEY is not set."), | |
ModelId = "llama3-70b-8192" | |
}; | |
var provider = new GroqSharpProvider(config); | |
var model = new Llama370b8192(provider); | |
string answer = await model.GenerateAsync("Generate some random name:"); | |
Assert.IsNotNull(answer); | |
Assert.IsNotEmpty(answer); | |
Console.WriteLine(answer); |
I have added the groq provider using https:/Sarel-Esterhuizen/GroqSharp
the code needs some adjustment.
Summary by CodeRabbit
New Features
GroqSharp
,Reka
, andOpenAI
.GroqSharp
with new configuration settings and models.Bug Fixes
Chores
GroqSharp
to version1.1.2
.Tests
GroqSharp
provider functionalities.