File tree Expand file tree Collapse file tree
test/unit/forge/routes/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,15 @@ module.exports = {
130130 }
131131 }
132132
133+ if ( config . assistant ?. enabled === true && ! config . assistant . service ?. url ) {
134+ config . assistant . service = config . assistant . service || { }
135+ config . assistant . service . url = 'https://expert.flowfuse/v1/openai'
136+ }
137+ if ( config . expert ?. enabled === true && ! config . expert . service ?. url ) {
138+ config . expert . service = config . expert . service || { }
139+ config . expert . service . url = 'https://expert.flowfuse/v4/expert'
140+ }
141+
133142 const defaultLogging = {
134143 level : 'info' ,
135144 http : 'warn' ,
Original file line number Diff line number Diff line change @@ -69,18 +69,6 @@ describe('Assistant API', async function () {
6969 } )
7070 response . statusCode . should . equal ( 501 )
7171 } )
72- it ( 'should return 501 if assistant service url is not set' , async function ( ) {
73- app2 = await setupApp ( { assistant : { enabled : true , service : { url : null } } } )
74- const instance = app2 . project
75- const token = ( await instance . refreshAuthTokens ( ) ) . token
76- const response = await app2 . inject ( {
77- method : 'POST' ,
78- url : '/api/v1/assistant/function' ,
79- headers : { authorization : 'Bearer ' + token } ,
80- payload : { prompt : 'multiply by 5' , transactionId : '1234' }
81- } )
82- response . statusCode . should . equal ( 501 )
83- } )
8472 } )
8573
8674 describe ( 'service enabled' , async function ( ) {
Original file line number Diff line number Diff line change @@ -1497,17 +1497,5 @@ describe('Expert API', function () {
14971497 } )
14981498 response . statusCode . should . equal ( 501 )
14991499 } )
1500- it ( 'should return 501 if expert service url is not set' , async function ( ) {
1501- app = await setupApp ( { expert : { enabled : true , service : { url : null } } } )
1502- const instance = app . project
1503- const token = ( await instance . refreshAuthTokens ( ) ) . token
1504- const response = await app . inject ( {
1505- method : 'POST' ,
1506- url : '/api/v1/expert/chat' ,
1507- headers : { authorization : 'Bearer ' + token } ,
1508- payload : { context : { team : 'teamid' } , query : 'test' }
1509- } )
1510- response . statusCode . should . equal ( 501 )
1511- } )
15121500 } )
15131501} )
You can’t perform that action at this time.
0 commit comments