mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-07-30 12:28:41 +00:00
feat(format-history): remove extra :
This commit is contained in:
@ -81,8 +81,7 @@ export const POST = async (req: Request) => {
|
|||||||
if (body.chatModel?.provider === 'custom_openai') {
|
if (body.chatModel?.provider === 'custom_openai') {
|
||||||
llm = new ChatOpenAI({
|
llm = new ChatOpenAI({
|
||||||
modelName: body.chatModel?.name || getCustomOpenaiModelName(),
|
modelName: body.chatModel?.name || getCustomOpenaiModelName(),
|
||||||
apiKey:
|
apiKey: body.chatModel?.customOpenAIKey || getCustomOpenaiApiKey(),
|
||||||
body.chatModel?.customOpenAIKey || getCustomOpenaiApiKey(),
|
|
||||||
temperature: 0.7,
|
temperature: 0.7,
|
||||||
configuration: {
|
configuration: {
|
||||||
baseURL:
|
baseURL:
|
||||||
|
@ -4,7 +4,7 @@ const formatChatHistoryAsString = (history: BaseMessage[]) => {
|
|||||||
return history
|
return history
|
||||||
.map(
|
.map(
|
||||||
(message) =>
|
(message) =>
|
||||||
`${isAIMessage(message) ? 'AI' : 'User:'}: ${message.content}`,
|
`${isAIMessage(message) ? 'AI' : 'User'}: ${message.content}`,
|
||||||
)
|
)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user