mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	feat: enabled user to set default GPT model for chat
This commit is contained in:
		@@ -38,7 +38,7 @@
 | 
			
		||||
        <el-form-item label="聊天记录">
 | 
			
		||||
          <el-switch v-model="form.chat_config.enable_history"/>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="Model">
 | 
			
		||||
        <el-form-item label="默认模型">
 | 
			
		||||
          <el-select v-model="form.chat_config.model" placeholder="默认会话模型">
 | 
			
		||||
            <el-option
 | 
			
		||||
                v-for="item in models"
 | 
			
		||||
@@ -51,8 +51,9 @@
 | 
			
		||||
        <el-form-item label="MaxTokens">
 | 
			
		||||
          <el-input v-model.number="form.chat_config.max_tokens"/>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="Temperature">
 | 
			
		||||
          <el-input v-model.number="form.chat_config.temperature"/>
 | 
			
		||||
        <el-form-item label="创意度">
 | 
			
		||||
          <el-slider v-model="form.chat_config.temperature" :max="2" :step="0.1"/>
 | 
			
		||||
          <div class="tip">值越大 AI 回答越发散,值越小回答越保守,建议保持默认值</div>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="剩余调用次数">
 | 
			
		||||
          <el-tag>{{ form['calls'] }}</el-tag>
 | 
			
		||||
@@ -80,7 +81,7 @@
 | 
			
		||||
<script setup>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import {computed, onMounted, ref} from "vue"
 | 
			
		||||
import {computed, onMounted, reactive, ref} from "vue"
 | 
			
		||||
import {httpGet, httpPost} from "@/utils/http";
 | 
			
		||||
import {ElMessage} from "element-plus";
 | 
			
		||||
import {Plus} from "@element-plus/icons-vue";
 | 
			
		||||
@@ -174,6 +175,11 @@ const close = function () {
 | 
			
		||||
        position: absolute;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .tip {
 | 
			
		||||
      color #c1c1c1
 | 
			
		||||
      font-size 12px;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -146,6 +146,8 @@ const exportChat = () => {
 | 
			
		||||
          img {
 | 
			
		||||
            width 30px
 | 
			
		||||
            height 30px
 | 
			
		||||
            border-radius: 10px;
 | 
			
		||||
            padding: 1px
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -308,6 +308,9 @@ onMounted(() => {
 | 
			
		||||
  checkSession().then((user) => {
 | 
			
		||||
    loginUser.value = user
 | 
			
		||||
    isLogin.value = true
 | 
			
		||||
    if (user.chat_config?.model !== '') {
 | 
			
		||||
      model.value = user.chat_config.model
 | 
			
		||||
    }
 | 
			
		||||
    // 加载角色列表
 | 
			
		||||
    httpGet(`/api/role/list?user_id=${user.id}`).then((res) => {
 | 
			
		||||
      roles.value = res.data;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user