forked from open-webui/open-webui
		
	feat: enable title generation prompt edit
This commit is contained in:
		
							parent
							
								
									a2088989ca
								
							
						
					
					
						commit
						05ea6cf6fd
					
				
					 4 changed files with 41 additions and 5 deletions
				
			
		|  | @ -742,6 +742,8 @@ | |||
| 		if ($settings.titleAutoGenerate ?? true) { | ||||
| 			const title = await generateTitle( | ||||
| 				localStorage.token, | ||||
| 				$settings?.titleGenerationPrompt ?? | ||||
| 					"Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title': {{prompt}}", | ||||
| 				$settings?.titleAutoGenerateModel ?? selectedModels[0], | ||||
| 				userPrompt | ||||
| 			); | ||||
|  |  | |||
|  | @ -755,7 +755,13 @@ | |||
| 
 | ||||
| 	const generateChatTitle = async (_chatId, userPrompt) => { | ||||
| 		if ($settings.titleAutoGenerate ?? true) { | ||||
| 			const title = await generateTitle(localStorage.token, selectedModels[0], userPrompt); | ||||
| 			const title = await generateTitle( | ||||
| 				localStorage.token, | ||||
| 				$settings?.titleGenerationPrompt ?? | ||||
| 					"Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title': {{prompt}}", | ||||
| 				$settings?.titleAutoGenerateModel ?? selectedModels[0], | ||||
| 				userPrompt | ||||
| 			); | ||||
| 
 | ||||
| 			if (title) { | ||||
| 				await setChatTitle(_chatId, title); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek