feat: add {{prompt:start:length}} and {{prompt🔚length}} to title gen

This commit is contained in:
Jun Siang Cheah 2024-04-13 18:26:50 +01:00
parent 8e30948de9
commit db817fcf29
3 changed files with 29 additions and 2 deletions

View file

@ -1,4 +1,5 @@
import { OLLAMA_API_BASE_URL } from '$lib/constants';
import { templatePrompt } from '$lib/utils';
export const getOllamaUrls = async (token: string = '') => {
let error = null;
@ -144,7 +145,7 @@ export const generateTitle = async (
) => {
let error = null;
template = template.replace(/{{prompt}}/g, prompt);
template = templatePrompt(template, prompt);
console.log(template);

View file

@ -1,4 +1,5 @@
import { OPENAI_API_BASE_URL } from '$lib/constants';
import { templatePrompt } from '$lib/utils';
export const getOpenAIUrls = async (token: string = '') => {
let error = null;
@ -273,7 +274,7 @@ export const generateTitle = async (
) => {
let error = null;
template = template.replace(/{{prompt}}/g, prompt);
template = templatePrompt(template, prompt);
console.log(template);