mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 01:27:28 +00:00
feat: Fill thoughtSignature only for Gemini/Vertex channels using the OpenAI format
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 0,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "react-template",
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
"Gemini思考适配设置": "Gemini thinking adaptation settings",
|
||||
"Gemini版本设置": "Gemini version settings",
|
||||
"Gemini设置": "Gemini settings",
|
||||
"启用FunctionCall思维签名填充": "Enable FunctionCall thoughtSignature fill",
|
||||
"仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature": "Fill thoughtSignature only for Gemini/Vertex channels using the OpenAI format",
|
||||
"GitHub": "GitHub",
|
||||
"GitHub Client ID": "GitHub Client ID",
|
||||
"GitHub Client Secret": "GitHub Client Secret",
|
||||
|
||||
@@ -71,6 +71,8 @@
|
||||
"Gemini思考适配设置": "Paramètres d'adaptation de la pensée Gemini",
|
||||
"Gemini版本设置": "Paramètres de version Gemini",
|
||||
"Gemini设置": "Paramètres Gemini",
|
||||
"启用FunctionCall思维签名填充": "Activer le remplissage de thoughtSignature pour FunctionCall",
|
||||
"仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature": "Remplit thoughtSignature uniquement pour les canaux Gemini/Vertex utilisant le format OpenAI",
|
||||
"GitHub": "GitHub",
|
||||
"GitHub Client ID": "ID client GitHub",
|
||||
"GitHub Client Secret": "Secret client GitHub",
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
"Gemini思考适配设置": "Gemini思考モード設定",
|
||||
"Gemini版本设置": "Geminiバージョン設定",
|
||||
"Gemini设置": "Gemini設定",
|
||||
"启用FunctionCall思维签名填充": "FunctionCall用のthoughtSignature自動付与を有効化",
|
||||
"仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature": "OpenAI形式を利用するGemini/VertexチャネルにのみthoughtSignatureを付与します",
|
||||
"GitHub": "GitHub",
|
||||
"GitHub Client ID": "GitHub Client ID",
|
||||
"GitHub Client Secret": "GitHub Client Secret",
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
"Gemini思考适配设置": "Настройки адаптации мышления Gemini",
|
||||
"Gemini版本设置": "Настройки версии Gemini",
|
||||
"Gemini设置": "Настройки Gemini",
|
||||
"启用FunctionCall思维签名填充": "Включить автозаполнение thoughtSignature для FunctionCall",
|
||||
"仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature": "Заполнять thoughtSignature только для каналов Gemini/Vertex, использующих формат OpenAI",
|
||||
"GitHub": "GitHub",
|
||||
"GitHub Client ID": "ID клиента GitHub",
|
||||
"GitHub Client Secret": "Секрет клиента GitHub",
|
||||
|
||||
@@ -67,6 +67,8 @@
|
||||
"Gemini思考适配设置": "Gemini思考适配设置",
|
||||
"Gemini版本设置": "Gemini版本设置",
|
||||
"Gemini设置": "Gemini设置",
|
||||
"启用FunctionCall思维签名填充": "启用FunctionCall思维签名填充",
|
||||
"仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature": "仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature",
|
||||
"GitHub": "GitHub",
|
||||
"GitHub Client ID": "GitHub Client ID",
|
||||
"GitHub Client Secret": "GitHub Client Secret",
|
||||
|
||||
@@ -39,19 +39,22 @@ const GEMINI_VERSION_EXAMPLE = {
|
||||
default: 'v1beta',
|
||||
};
|
||||
|
||||
const DEFAULT_GEMINI_INPUTS = {
|
||||
'gemini.safety_settings': '',
|
||||
'gemini.version_settings': '',
|
||||
'gemini.supported_imagine_models': '',
|
||||
'gemini.thinking_adapter_enabled': false,
|
||||
'gemini.thinking_adapter_budget_tokens_percentage': 0.6,
|
||||
'gemini.function_call_thought_signature_enabled': true,
|
||||
};
|
||||
|
||||
export default function SettingGeminiModel(props) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [inputs, setInputs] = useState({
|
||||
'gemini.safety_settings': '',
|
||||
'gemini.version_settings': '',
|
||||
'gemini.supported_imagine_models': '',
|
||||
'gemini.thinking_adapter_enabled': false,
|
||||
'gemini.thinking_adapter_budget_tokens_percentage': 0.6,
|
||||
});
|
||||
const [inputs, setInputs] = useState(DEFAULT_GEMINI_INPUTS);
|
||||
const refForm = useRef();
|
||||
const [inputsRow, setInputsRow] = useState(inputs);
|
||||
const [inputsRow, setInputsRow] = useState(DEFAULT_GEMINI_INPUTS);
|
||||
|
||||
async function onSubmit() {
|
||||
await refForm.current
|
||||
@@ -92,9 +95,9 @@ export default function SettingGeminiModel(props) {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const currentInputs = {};
|
||||
const currentInputs = { ...DEFAULT_GEMINI_INPUTS };
|
||||
for (let key in props.options) {
|
||||
if (Object.keys(inputs).includes(key)) {
|
||||
if (Object.prototype.hasOwnProperty.call(DEFAULT_GEMINI_INPUTS, key)) {
|
||||
currentInputs[key] = props.options[key];
|
||||
}
|
||||
}
|
||||
@@ -166,6 +169,23 @@ export default function SettingGeminiModel(props) {
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={16}>
|
||||
<Form.Switch
|
||||
label={t('启用FunctionCall思维签名填充')}
|
||||
field={'gemini.function_call_thought_signature_enabled'}
|
||||
extraText={t(
|
||||
'仅为使用OpenAI格式的Gemini/Vertex渠道填充thoughtSignature',
|
||||
)}
|
||||
onChange={(value) =>
|
||||
setInputs({
|
||||
...inputs,
|
||||
'gemini.function_call_thought_signature_enabled': value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col xs={24} sm={12} md={8} lg={8} xl={8}>
|
||||
<Form.TextArea
|
||||
|
||||
Reference in New Issue
Block a user