Skip to content

Commit 47d4056

Browse files
committed
feat(ai-completions): modify param name
1 parent 135ef84 commit 47d4056

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/common/js/completion-files/context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ props的属性中值为对象,且包含type和value属性,type为JSExpressio
4646

4747
直接上下文如下:
4848
$codeBeforeCursor$<cursor>$codeAfterCursor$
49-
请从<cursor>(光标位置)处进行补全
49+
请从<cursor>(光标位置)后进行补全
5050
注意如果是函数时,须以function关键字开头,不使用箭头函数
5151
请只返回代码,且只返回一个示例,不需要思考过程和解释

packages/common/js/completion.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ const generateBaseReference = () => {
195195
}
196196

197197
const fetchAiInlineCompletion = (codeBeforeCursor, codeAfterCursor) => {
198-
const { model, apiKey, baseUrl } = useRobot().robotSettingState?.selectedModel || {}
199-
if (!model || !apiKey || !baseUrl) {
200-
throw new Error(`"modelName" & "apiKey" & "baseUrl" cannot be empty`)
198+
const { completeModel, apiKey, baseUrl } = useRobot().robotSettingState?.selectedModel || {}
199+
if (!completeModel || !apiKey || !baseUrl) {
200+
throw new Error(`"model" & "apiKey" & "baseUrl" cannot be empty`)
201201
}
202202
const referenceContext = generateBaseReference()
203203
return getMetaApi(META_SERVICE.Http).post(
204204
`${baseUrl}/chat/completions`,
205205
{
206-
model,
206+
model: completeModel,
207207
messages: [
208208
{
209209
role: 'user',

0 commit comments

Comments
 (0)