fix(small-model): use selected runtime model endpoint (#3437)
This commit is contained in:
@@ -14,7 +14,10 @@ const providerPayload = (overrides = {}) => ({
|
||||
id: 'llmapi',
|
||||
source: 'config',
|
||||
options: { apiKey: 'plugin-key', baseURL: 'https://api.llmapi.ai/v1/' },
|
||||
models: { 'claude-opus-4-8': { api: { id: 'claude-opus-4-8', url: '', npm: '@ai-sdk/anthropic' } } },
|
||||
models: {
|
||||
'claude-opus-4-8': { api: { id: 'claude-opus-4-8', url: '', npm: '@ai-sdk/anthropic' } },
|
||||
'gpt-5.6-luna': { api: { id: 'gpt-5.6-luna', url: 'https://api.llmapi.ai/v1', npm: '@ai-sdk/openai' } },
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'opencode',
|
||||
@@ -59,6 +62,9 @@ describe('OpenCode runtime provider snapshot', () => {
|
||||
const provider = await getRuntimeProvider('llmapi');
|
||||
|
||||
expect(provider).toMatchObject({ apiKey: 'plugin-key', baseURL: 'https://api.llmapi.ai/v1' });
|
||||
expect(provider.models.get('gpt-5.6-luna')).toEqual({
|
||||
api: { url: 'https://api.llmapi.ai/v1', npm: '@ai-sdk/openai' },
|
||||
});
|
||||
expect(fetchMock.mock.calls[0][0]).toBe('http://127.0.0.1:4096/provider');
|
||||
expect(fetchMock.mock.calls[0][1].headers).toMatchObject({ Authorization: 'Basic test' });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user