Skip to content

Commit

Permalink
don't think I'm on the right path?
Browse files Browse the repository at this point in the history
  • Loading branch information
rubentalstra committed Feb 14, 2025
1 parent 2e02f15 commit df87276
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ ALLOW_SHARED_LINKS_PUBLIC=true
#===================================================#

APP_TITLE=LibreChat
# CUSTOM_WELCOME_MESSAGE="My custom welcome message"
# CUSTOM_FOOTER="My custom footer"
HELP_AND_FAQ_URL=https://librechat.ai

Expand Down
19 changes: 13 additions & 6 deletions client/src/components/Chat/Landing.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { EModelEndpoint, Constants } from 'librechat-data-provider';
import { EModelEndpoint, Constants, getConfigDefaults } from 'librechat-data-provider';
import type * as t from 'librechat-data-provider';
import type { ReactNode } from 'react';
import { useChatContext, useAgentsMapContext, useAssistantsMapContext } from '~/Providers';
Expand All @@ -15,11 +15,17 @@ import { TooltipAnchor } from '~/components/ui';
import { BirthdayIcon } from '~/components/svg';
import ConvoStarter from './ConvoStarter';

const defaultInterface = getConfigDefaults().interface;

export default function Landing({ Header }: { Header?: ReactNode }) {
const { conversation } = useChatContext();
const agentsMap = useAgentsMapContext();
const assistantMap = useAssistantsMapContext();
const { data: startupConfig } = useGetStartupConfig();
const interfaceConfig = useMemo(
() => startupConfig?.interface ?? defaultInterface,
[startupConfig],
);
const { data: endpointsConfig } = useGetEndpointsQuery();
const localize = useLocalize();
const { submitMessage } = useSubmitMessage();
Expand Down Expand Up @@ -85,9 +91,10 @@ export default function Landing({ Header }: { Header?: ReactNode }) {
if (conversation?.greeting) {return conversation.greeting;}
if (isAssistant) {return localize('com_nav_welcome_assistant');}
if (isAgent) {return localize('com_nav_welcome_agent');}
return typeof startupConfig?.customWelcomeMessage === 'string'
? startupConfig.customWelcomeMessage
: localize('com_nav_welcome_message');
return interfaceConfig.customWelcome;
// return typeof interfaceConfig?.customWelcome === 'string'
// ? interfaceConfig.customWelcome
// : localize('com_nav_welcome_message');
};

return (
Expand Down Expand Up @@ -119,8 +126,8 @@ export default function Landing({ Header }: { Header?: ReactNode }) {
<div className="text-center text-2xl font-medium dark:text-white">{name}</div>
<div className="max-w-md text-center text-sm font-normal text-text-primary">
{description ||
(typeof startupConfig?.customWelcomeMessage === 'string'
? startupConfig.customWelcomeMessage
(typeof interfaceConfig?.customWelcome === 'string'
? interfaceConfig.customWelcome
: localize('com_nav_welcome_message'))}
</div>
{/* <div className="mt-1 flex items-center gap-1 text-token-text-tertiary">
Expand Down
8 changes: 5 additions & 3 deletions librechat.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ interface:
By using the Website, you acknowledge that you have read these Terms of Service and agree to be bound by them.
customWelcome: "Welcome to LibreChat! Enjoy your experience."

endpointsMenu: true
modelSelect: true
parameters: true
Expand All @@ -81,7 +83,7 @@ registration:
# model: ''
# voices: ['']

#
#
# stt:
# openai:
# url: ''
Expand Down Expand Up @@ -234,10 +236,10 @@ endpoints:
# Recommended: Drop the stop parameter from the request as Openrouter models use a variety of stop tokens.
dropParams: ['stop']
modelDisplayLabel: 'OpenRouter'

# Portkey AI Example
- name: "Portkey"
apiKey: "dummy"
apiKey: "dummy"
baseURL: 'https://api.portkey.ai/v1'
headers:
x-portkey-api-key: '${PORTKEY_API_KEY}'
Expand Down
2 changes: 1 addition & 1 deletion packages/data-provider/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ export const intefaceSchema = z
})
.optional(),
termsOfService: termsOfServiceSchema.optional(),
customWelcome: z.string().optional(),
endpointsMenu: z.boolean().optional(),
modelSelect: z.boolean().optional(),
parameters: z.boolean().optional(),
Expand Down Expand Up @@ -501,7 +502,6 @@ export type TStartupConfig = {
showBirthdayIcon: boolean;
helpAndFaqURL: string;
customFooter?: string;
customWelcomeMessage?: string;
modelSpecs?: TSpecsConfig;
sharedLinksEnabled: boolean;
publicSharedLinksEnabled: boolean;
Expand Down

0 comments on commit df87276

Please sign in to comment.