File tree 2 files changed +17
-1
lines changed
libs/agent-runtime/openrouter
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -326,10 +326,17 @@ const OpenRouter: ModelProviderCard = {
326
326
modelList : { showModelFetcher : true } ,
327
327
modelsUrl : 'https://openrouter.ai/models' ,
328
328
name : 'OpenRouter' ,
329
+ proxyUrl : {
330
+ placeholder : 'https://openrouter.ai/api/v1' ,
331
+ } ,
329
332
settings : {
330
333
// OpenRouter don't support browser request
331
334
// https://github.com/lobehub/lobe-chat/issues/5900
332
335
disableBrowserRequest : true ,
336
+
337
+ proxyUrl : {
338
+ placeholder : 'https://openrouter.ai/api/v1' ,
339
+ } ,
333
340
sdkType : 'openai' ,
334
341
searchMode : 'params' ,
335
342
showModelFetcher : true ,
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ beforeEach(() => {
30
30
} ) ;
31
31
32
32
afterEach ( ( ) => {
33
- vi . clearAllMocks ( ) ;
33
+ vi . restoreAllMocks ( ) ;
34
34
} ) ;
35
35
36
36
describe ( 'LobeOpenRouterAI' , ( ) => {
@@ -40,6 +40,15 @@ describe('LobeOpenRouterAI', () => {
40
40
expect ( instance ) . toBeInstanceOf ( LobeOpenRouterAI ) ;
41
41
expect ( instance . baseURL ) . toEqual ( defaultBaseURL ) ;
42
42
} ) ;
43
+
44
+ it ( 'should correctly initialize with a custom base URL' , async ( ) => {
45
+ const instance = new LobeOpenRouterAI ( {
46
+ apiKey : 'test_api_key' ,
47
+ baseURL : 'https://api.abc.com/v1' ,
48
+ } ) ;
49
+ expect ( instance ) . toBeInstanceOf ( LobeOpenRouterAI ) ;
50
+ expect ( instance . baseURL ) . toEqual ( 'https://api.abc.com/v1' ) ;
51
+ } ) ;
43
52
} ) ;
44
53
45
54
describe ( 'chat' , ( ) => {
You can’t perform that action at this time.
0 commit comments