mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-02 08:38:51 +01:00
* chore(ChatGPTClient.js): add support for OpenRouter API chore(OpenAIClient.js): add support for OpenRouter API * chore: comment out token debugging * chore: add back streamResult assignment * chore: remove double condition/assignment from merging * refactor(routes/endpoints): -> controller/services logic * feat: add openrouter model fetching * chore: remove unused endpointsConfig in cleanupPreset function * refactor: separate models concern from endpointsConfig * refactor(data-provider): add TModels type and make TEndpointsConfig adaptible to new endpoint keys * refactor: complete models endpoint service in data-provider * refactor: onMutate for refreshToken and login, invalidate models query * feat: complete models endpoint logic for frontend * chore: remove requireJwtAuth from /api/endpoints and /api/models as not implemented yet * fix: endpoint will not be overwritten and instead use active value * feat: openrouter support for plugins * chore(EndpointOptionsDialog): remove unused recoil value * refactor(schemas/parseConvo): add handling of secondaryModels to use first of defined secondary models, which includes last selected one as first, or default to the convo's secondary model value * refactor: remove hooks from store and move to hooks refactor(switchToConversation): make switchToConversation use latest recoil state, which is necessary to get the most up-to-date models list, replace wrapper function refactor(getDefaultConversation): factor out logic into 3 pieces to reduce complexity. * fix: backend tests * feat: optimistic update by calling newConvo when models are fetched * feat: openrouter support for titling convos * feat: cache models fetch * chore: add missing dep to AuthContext useEffect * chore: fix useTimeout types * chore: delete old getDefaultConvo file * chore: remove newConvo logic from Root, remove console log from api models caching * chore: ensure bun is used for building in b:client script * fix: default endpoint will not default to null on a completely fresh login (no localStorage/cookies) * chore: add openrouter docs to free_ai_apis.md and .env.example * chore: remove openrouter console logs * feat: add debugging env variable for Plugins
61 lines
1.8 KiB
TypeScript
61 lines
1.8 KiB
TypeScript
export const user = () => '/api/user';
|
|
|
|
export const userPlugins = () => '/api/user/plugins';
|
|
|
|
export const messages = (conversationId: string, messageId?: string) =>
|
|
`/api/messages/${conversationId}${messageId ? `/${messageId}` : ''}`;
|
|
|
|
const keysEndpoint = '/api/keys';
|
|
|
|
export const keys = () => keysEndpoint;
|
|
|
|
export const userKeyQuery = (name: string) => `${keysEndpoint}?name=${name}`;
|
|
|
|
export const revokeUserKey = (name: string) => `${keysEndpoint}/${name}`;
|
|
|
|
export const revokeAllUserKeys = () => `${keysEndpoint}?all=true`;
|
|
|
|
export const abortRequest = (endpoint: string) => `/api/ask/${endpoint}/abort`;
|
|
|
|
export const conversations = (pageNumber: string) => `/api/convos?pageNumber=${pageNumber}`;
|
|
|
|
export const conversationById = (id: string) => `/api/convos/${id}`;
|
|
|
|
export const updateConversation = () => '/api/convos/update';
|
|
|
|
export const deleteConversation = () => '/api/convos/clear';
|
|
|
|
export const search = (q: string, pageNumber: string) =>
|
|
`/api/search?q=${q}&pageNumber=${pageNumber}`;
|
|
|
|
export const searchEnabled = () => '/api/search/enable';
|
|
|
|
export const presets = () => '/api/presets';
|
|
|
|
export const deletePreset = () => '/api/presets/delete';
|
|
|
|
export const aiEndpoints = () => '/api/endpoints';
|
|
|
|
export const models = () => '/api/models';
|
|
|
|
export const tokenizer = () => '/api/tokenizer';
|
|
|
|
export const login = () => '/api/auth/login';
|
|
|
|
export const logout = () => '/api/auth/logout';
|
|
|
|
export const register = () => '/api/auth/register';
|
|
|
|
export const loginFacebook = () => '/api/auth/facebook';
|
|
|
|
export const loginGoogle = () => '/api/auth/google';
|
|
|
|
export const refreshToken = () => '/api/auth/refresh';
|
|
|
|
export const requestPasswordReset = () => '/api/auth/requestPasswordReset';
|
|
|
|
export const resetPassword = () => '/api/auth/resetPassword';
|
|
|
|
export const plugins = () => '/api/plugins';
|
|
|
|
export const config = () => '/api/config';
|