mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:43:59 +01:00
parent
7cb8aa0b4a
commit
d2da2a3b7c
|
@ -9,7 +9,7 @@ import { _defaultChatConfig } from '@constants/chat';
|
||||||
import { officialAPIEndpoint } from '@constants/auth';
|
import { officialAPIEndpoint } from '@constants/auth';
|
||||||
|
|
||||||
const useSubmit = () => {
|
const useSubmit = () => {
|
||||||
const { t } = useTranslation('api');
|
const { t, i18n } = useTranslation('api');
|
||||||
const error = useStore((state) => state.error);
|
const error = useStore((state) => state.error);
|
||||||
const setError = useStore((state) => state.setError);
|
const setError = useStore((state) => state.setError);
|
||||||
const apiEndpoint = useStore((state) => state.apiEndpoint);
|
const apiEndpoint = useStore((state) => state.apiEndpoint);
|
||||||
|
@ -156,7 +156,7 @@ const useSubmit = () => {
|
||||||
|
|
||||||
const message: MessageInterface = {
|
const message: MessageInterface = {
|
||||||
role: 'user',
|
role: 'user',
|
||||||
content: `Generate a title in less than 6 words for the following message:\nUser: ${user_message}\nAssistant: ${assistant_message}`,
|
content: `Generate a title in less than 6 words for the following message (language: ${i18n.language}):\n"""\nUser: ${user_message}\nAssistant: ${assistant_message}\n"""`,
|
||||||
};
|
};
|
||||||
|
|
||||||
let title = (await generateTitle([message])).trim();
|
let title = (await generateTitle([message])).trim();
|
||||||
|
|
Loading…
Reference in a new issue