File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,17 +188,14 @@ const generateBaseReference = () => {
188188}
189189
190190const fetchAiInlineCompletion = ( codeBeforeCursor , codeAfterCursor ) => {
191- const { modelName, url , baseUrl } = getMergeMeta ( 'engine.plugins.pagecontroller' ) ?. options ?. AIModel || { }
191+ const { modelName, baseUrl } = getMergeMeta ( 'engine.plugins.pagecontroller' ) ?. options ?. AIModel || { }
192192 const apiKey = import . meta. env . VITE_API_TPKEN
193- if ( ! modelName || ! apiKey ) {
194- throw new Error ( `"modelName" & "apiKey" cannot be empty` )
195- }
196- if ( ! url && ! baseUrl ) {
197- throw new Error ( `"url" or "baseUrl" cannot be empty` )
193+ if ( ! modelName || ! apiKey || ! baseUrl ) {
194+ throw new Error ( `"modelName" & "apiKey" & "baseUrl" cannot be empty` )
198195 }
199196 const referenceContext = generateBaseReference ( )
200197 return getMetaApi ( META_SERVICE . Http ) . post (
201- url || `${ baseUrl } /chat/completions` ,
198+ `${ baseUrl } /chat/completions` ,
202199 {
203200 model : modelName ,
204201 messages : [
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ export default {
99 enableAICompletion : true ,
1010 AIModel : {
1111 modelName : 'qwen3-8b' ,
12- baseUrl : 'https://agent.opentiny.design/api/v1/ai' ,
13- url : ''
12+ baseUrl : 'https://agent.opentiny.design/api/v1/ai'
1413 }
1514 } ,
1615 confirm : 'close' // 当点击插件栏切换或关闭前是否需要确认, 会调用插件中confirm值指定的方法,e.g. 此处指向 close方法,会调用插件的close方法执行确认逻辑
You can’t perform that action at this time.
0 commit comments