-
Notifications
You must be signed in to change notification settings - Fork 43
feat(groq): Migrate Groq to v2 Plugins API #348
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
base: main
Are you sure you want to change the base?
feat(groq): Migrate Groq to v2 Plugins API #348
Conversation
|
you will need to implement the changes see this similar PR: #347 |
plugins/groq/src/index.ts
Outdated
| }, | ||
| list: async () => { | ||
| return Object.keys(SUPPORTED_GROQ_MODELS).map((name) => ({ | ||
| name: `groq/${name}`, |
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.
Do we need the groq/ part?
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.
Well, groq/ was initially being appended to the model name.
The prefix groq/ was added here:
https://github.com/BloomLabsInc/genkit-plugins/pull/9/files#diff-9c9efbee9ae1c4a79760d6d2d0f89c9d46d538f645235c21e3f51f3c4c9e35aeR454-R457
When the initialized Genkit object is logged while using the genkitx-groq package (which has the v1 plugin under the hood), the resulting model name will include this prefix.
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.
I don't think it's necessary anymore in v2.
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.
alright, removing it shortly
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.
@HassanBahati I think we're going for namespace: 'pluginName' and name: 'modelName' instead. So can we apply that here and to your other migrations too.
For example:
{
name: 'llama3-70b-8192',
namespace: 'groq'
...
}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.
Thanks @CorieW, i've updated
| @@ -97,3 +98,45 @@ describe('toGroqRequestBody', () => { | |||
| }); | |||
| }); | |||
| }); | |||
|
|
|||
| describe('Groq Plugin', () => { | |||
| it('should create plugin with v2 API', () => { | |||
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.
@cabljac thoughts on this test?
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.
it's not bad, but tests seem quite minimal. ideally i'd like some integration tests with the core genkit methods
e.g we initialise genkit with the plugin, we mock global fetch, we call ai.generate with groq
Before you submit a pull request, please make sure you have read and understood the contribution guidelines and the code of conduct.
This pull request is related to:
I have checked the following:
Description:
Please provide a clear and concise description of the changes you are proposing here.
Related issues:
Closes #353