Merge remote-tracking branch 'origin/next' into openai

This commit is contained in:
n4ze3m
2024-10-02 20:10:21 +05:30
18 changed files with 264 additions and 117 deletions

View File

@@ -455,7 +455,11 @@ export const useMessageOption = () => {
)
}
if (selectedPrompt) {
const isTempSystemprompt =
currentChatModelSettings.systemPrompt &&
currentChatModelSettings.systemPrompt?.trim().length > 0
if (!isTempSystemprompt && selectedPrompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
@@ -468,6 +472,19 @@ export const useMessageOption = () => {
)
}
if (isTempSystemprompt) {
applicationChatHistory.unshift(
new SystemMessage({
content: [
{
text: currentChatModelSettings.systemPrompt,
type: "text"
}
]
})
)
}
const chunks = await ollama.stream(
[...applicationChatHistory, humanMessage],
{