Skip to content

Commit

Permalink
🐛 fix: fix incorrect baseURL for Groq in client mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mosade committed Jun 1, 2024
1 parent 1aa79de commit 981ee97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/__tests__/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,19 +862,21 @@ describe('AgentRuntimeOnClient', () => {
expect(runtime['_runtime']).toBeInstanceOf(LobeZeroOneAI);
});

it('Groq provider: with apiKey', async () => {
it('Groq provider: with apiKey,endpoint', async () => {
merge(initialSettingsState, {
settings: {
keyVaults: {
groq: {
apiKey: 'user-groq-key',
baseURL: 'user-groq-endpoint',
},
},
},
} as UserSettingsState) as unknown as UserStore;
const runtime = await initializeWithClientStore(ModelProvider.Groq, {});
expect(runtime).toBeInstanceOf(AgentRuntime);
expect(runtime['_runtime']).toBeInstanceOf(LobeGroq);
expect(runtime['_runtime'].baseURL).toBe('user-groq-endpoint');
});

it('DeepSeek provider: with apiKey', async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/services/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ export function initializeWithClientStore(provider: string, payload: any) {
break;
}
case ModelProvider.Groq: {
providerOptions = {
baseURL: providerAuthPayload?.endpoint,
};
break;
}
case ModelProvider.DeepSeek: {
Expand Down

0 comments on commit 981ee97

Please sign in to comment.