Add deleteChatHistory method to PageAssitDatabase class and systemPromptForNonRagOption functions to ollama service

This commit is contained in:
n4ze3m
2024-02-07 21:07:41 +05:30
parent c1efb2d5cb
commit b54527cab5
14 changed files with 393 additions and 66 deletions

View File

@@ -1,6 +1,6 @@
import React from "react"
import { cleanUrl } from "~libs/clean-url"
import { getOllamaURL, systemPromptForNonRag } from "~services/ollama"
import { getOllamaURL, systemPromptForNonRagOption } from "~services/ollama"
import { type ChatHistory, type Message } from "~store/option"
import { ChatOllama } from "@langchain/community/chat_models/ollama"
import {
@@ -139,7 +139,7 @@ export const useMessageOption = () => {
setMessages(newMessage)
try {
const prompt = await systemPromptForNonRag()
const prompt = await systemPromptForNonRagOption()
message = message.trim().replaceAll("\n", " ")