Add web search fee notice for OpenRouter Closes #3833
| @@ -1963,6 +1963,9 @@ | |||
| 1963 | <span data-i18n="Use search capabilities provided by the backend."> | 1963 | <span data-i18n="Use search capabilities provided by the backend."> |
| 1964 | Use search capabilities provided by the backend. | 1964 | Use search capabilities provided by the backend. |
| 1965 | </span> | 1965 | </span> |
| 1966 | <b data-source="openrouter" data-i18n="openrouter_web_search_fee"> | ||
| 1967 | Not free, adds a $0.02 fee to each prompt. | ||
| 1968 | </b> | ||
| 1966 | </div> | 1969 | </div> |
| 1967 | </div> | 1970 | </div> |
| 1968 | <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai"> | 1971 | <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai"> |
| @@ -1693,6 +1693,11 @@ function calculateOpenRouterCost() { | |||
| 1693 | } | 1693 | } |
| 1694 | } | 1694 | } |
| 1695 | 1695 | ||
| 1696 | if (oai_settings.enable_web_search) { | ||
| 1697 | const webSearchCost = (0.02).toFixed(2); | ||
| 1698 | cost = t`${cost} + $${webSearchCost}`; | ||
| 1699 | } | ||
| 1700 | |||
| 1696 | $('#openrouter_max_prompt_cost').text(cost); | 1701 | $('#openrouter_max_prompt_cost').text(cost); |
| 1697 | } | 1702 | } |
| 1698 | 1703 | ||
| @@ -5700,6 +5705,7 @@ export function initOpenAI() { | |||
| 5700 | 5705 | ||
| 5701 | $('#openai_enable_web_search').on('input', function () { | 5706 | $('#openai_enable_web_search').on('input', function () { |
| 5702 | oai_settings.enable_web_search = !!$(this).prop('checked'); | 5707 | oai_settings.enable_web_search = !!$(this).prop('checked'); |
| 5708 | calculateOpenRouterCost(); | ||
| 5703 | saveSettingsDebounced(); | 5709 | saveSettingsDebounced(); |
| 5704 | }); | 5710 | }); |
| 5705 | 5711 | ||