|
591 | 591 | </v-expansion-panel-title> |
592 | 592 |
|
593 | 593 | <v-expansion-panel-text> |
594 | | - <v-row class="px-3 mr-2"> |
595 | | - <div class="ml-3 mt-3"> |
596 | | - <span class="mr-2">{{ $t('$vuetify.dataIterator.i.reasoning') }}</span> |
597 | | - <v-btn-toggle color="primary" v-model="chatbotStore.reasoning_effort" divided variant="outlined" |
598 | | - density="compact"> |
599 | | - <v-btn>none</v-btn> |
600 | | - <v-btn>low</v-btn> |
601 | | - <v-btn>Med</v-btn> |
602 | | - <v-btn>high</v-btn> |
603 | | - </v-btn-toggle> |
604 | | - </div> |
| 594 | + <v-row class="px-3 mt-2 mr-2"> |
| 595 | + |
| 596 | + <v-combobox class="px-2" density='compact' |
| 597 | + :label="$t('$vuetify.dataIterator.i.reasoning')" |
| 598 | + v-model="chatbotStore.reasoning_effort" clearable |
| 599 | + :items="defaultChoiceStore.reasoning_efforts" variant="outlined"> |
| 600 | + </v-combobox> |
605 | 601 | <v-spacer></v-spacer> |
606 | 602 | <v-checkbox v-model="chatbotStore.stream" |
607 | | - :label="$t('$vuetify.dataIterator.i.stream')" color="primary"> |
| 603 | + :label="$t('$vuetify.dataIterator.i.stream')" density='compact' |
| 604 | + color="primary"> |
608 | 605 | </v-checkbox> |
609 | 606 | <v-checkbox v-if="mcpStore.getServers" v-model="chatbotStore.mcp" |
610 | | - :label="$t('$vuetify.dataIterator.i.mcp')" color="primary"> |
| 607 | + :label="$t('$vuetify.dataIterator.i.mcp')" density='compact' |
| 608 | + color="primary"> |
611 | 609 | </v-checkbox> |
612 | 610 | </v-row> |
613 | | - <v-divider></v-divider> |
614 | | - <v-row class="px-3 mt-6 mb-0"> |
| 611 | + <v-row class="px-3 mt-4 mb-0"> |
615 | 612 | <v-combobox class="px-2" density='compact' |
616 | 613 | :label="$t('$vuetify.dataIterator.i.maxTokensPrefix')" |
617 | 614 | :items="defaultChoiceStore.max_tokens_type" |
@@ -939,9 +936,9 @@ <h5 class="font-weight-bold mb-4">MCP</h5> |
939 | 936 | hide-details rows="1" readonly v-model="group.message.content"></v-textarea> |
940 | 937 | </v-card-text> |
941 | 938 | <v-card-text v-else class="md-preview px-4 py-3"> |
942 | | - <md-preview :model-value="group.message.content" |
943 | | - :language="language == 'zhHans' ? 'zh-CN' : 'en-US'" :code-foldable="true" |
944 | | - auto-fold-threshold="Infinity"></md-preview> |
| 939 | + <md-preview :model-value="group.message.content" |
| 940 | + :language="language == 'zhHans' ? 'zh-CN' : 'en-US'" :code-foldable="true" |
| 941 | + auto-fold-threshold="Infinity"></md-preview> |
945 | 942 | </v-card-text> |
946 | 943 | </template> |
947 | 944 | </tuui-chat-card> |
@@ -1789,7 +1786,7 @@ <h5 class="font-weight-bold mb-4">MCP</h5> |
1789 | 1786 | if (last.tool_calls.length == 0) { |
1790 | 1787 | delete last.tool_calls |
1791 | 1788 | return |
1792 | | - } |
| 1789 | + } |
1793 | 1790 | if (Object.keys(last.tool_calls[0]).length === 0) { |
1794 | 1791 | delete last.tool_calls |
1795 | 1792 | return |
@@ -1951,6 +1948,7 @@ <h5 class="font-weight-bold mb-4">MCP</h5> |
1951 | 1948 | ], |
1952 | 1949 | authPrefix: ["Bearer", "Base", "Token"], |
1953 | 1950 | max_tokens_type: ["max_tokens", "max_completion_tokens", "max_new_tokens"], |
| 1951 | + reasoning_efforts: ['false', 'none', 'low', 'medium', 'high'] |
1954 | 1952 | }), |
1955 | 1953 | persist: { |
1956 | 1954 | enabled: true, |
@@ -2048,22 +2046,13 @@ <h5 class="font-weight-bold mb-4">MCP</h5> |
2048 | 2046 | body[chatbotStore.max_tokens_type] = parseInt(chatbotStore.max_tokens_value) |
2049 | 2047 | } |
2050 | 2048 |
|
2051 | | - if (typeof chatbotStore.reasoning_effort === 'number') { |
2052 | | - switch (chatbotStore.reasoning_effort) { |
2053 | | - case 0: |
2054 | | - body['reasoning_effort'] = 'none'; |
2055 | | - break; |
2056 | | - case 1: |
2057 | | - body['reasoning_effort'] = 'low'; |
2058 | | - break; |
2059 | | - case 2: |
2060 | | - body['reasoning_effort'] = 'medium'; |
2061 | | - break; |
2062 | | - case 3: |
2063 | | - body['reasoning_effort'] = 'high'; |
2064 | | - break; |
2065 | | - default: |
2066 | | - break; |
| 2049 | + if (typeof chatbotStore.reasoning_effort === 'string') { |
| 2050 | + if (chatbotStore.reasoning_effort === 'false') { |
| 2051 | + // For Python API backends such as extra_body.chat_template_kwargs |
| 2052 | + body['chat_template_kwargs'] = { enable_thinking: false } |
| 2053 | + } else { |
| 2054 | + // For OpenAI OpenAPI backends such as ChatGPT or DeepInfra |
| 2055 | + body['reasoning_effort'] = chatbotStore.reasoning_effort |
2067 | 2056 | } |
2068 | 2057 | } |
2069 | 2058 |
|
@@ -2488,7 +2477,7 @@ <h5 class="font-weight-bold mb-4">MCP</h5> |
2488 | 2477 | i: { |
2489 | 2478 | title: 'Interface Configuration', |
2490 | 2479 | apikey: 'API Key', |
2491 | | - reasoning: 'R-effort', |
| 2480 | + reasoning: 'Reasoning Effort', |
2492 | 2481 | endpoint: 'Endpoint', |
2493 | 2482 | url: 'URL', |
2494 | 2483 | path: 'Path', |
|
0 commit comments