Merge pull request #5389 from STRRL/feat/identify-jan-on-openrouter
feat: identidy jan for openrouter
This commit is contained in:
commit
9696589e79
@ -138,6 +138,14 @@ export const sendCompletion = async (
|
|||||||
baseURL: provider.base_url,
|
baseURL: provider.base_url,
|
||||||
// Use Tauri's fetch to avoid CORS issues only for openai-compatible provider
|
// Use Tauri's fetch to avoid CORS issues only for openai-compatible provider
|
||||||
...(providerName === 'openai-compatible' && { fetch: fetchTauri }),
|
...(providerName === 'openai-compatible' && { fetch: fetchTauri }),
|
||||||
|
// OpenRouter identification headers for Jan
|
||||||
|
// ref: https://openrouter.ai/docs/api-reference/overview#headers
|
||||||
|
...(provider.provider === 'openrouter' && {
|
||||||
|
defaultHeaders: {
|
||||||
|
'HTTP-Referer': 'https://jan.ai',
|
||||||
|
'X-Title': 'Jan',
|
||||||
|
},
|
||||||
|
}),
|
||||||
} as ExtendedConfigOptions)
|
} as ExtendedConfigOptions)
|
||||||
if (
|
if (
|
||||||
thread.model.id &&
|
thread.model.id &&
|
||||||
@ -286,10 +294,10 @@ export const extractToolCall = (
|
|||||||
* @param calls
|
* @param calls
|
||||||
* @param builder
|
* @param builder
|
||||||
* @param message
|
* @param message
|
||||||
* @param content
|
* @param abortController
|
||||||
* @param approvedTools - Record of approved tools per thread
|
* @param approvedTools
|
||||||
* @param showModal - Function to show approval modal, returns true if approved
|
* @param showModal
|
||||||
* @param allowAllMCPPermissions - Global setting to allow all MCP permissions without modal
|
* @param allowAllMCPPermissions
|
||||||
*/
|
*/
|
||||||
export const postMessageProcessing = async (
|
export const postMessageProcessing = async (
|
||||||
calls: ChatCompletionMessageToolCall[],
|
calls: ChatCompletionMessageToolCall[],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user