forked from open-webui/open-webui
		
	feat: response notification
This commit is contained in:
		
							parent
							
								
									ffaa1b17c5
								
							
						
					
					
						commit
						e34b452509
					
				
					 3 changed files with 100 additions and 33 deletions
				
			
		|  | @ -222,6 +222,21 @@ | |||
| 									eval_duration: data.eval_duration | ||||
| 								}; | ||||
| 								messages = messages; | ||||
| 
 | ||||
| 								if ($settings.responseNotification && !document.hasFocus()) { | ||||
| 									const notification = new Notification( | ||||
| 										selectedModelfile | ||||
| 											? `${ | ||||
| 													selectedModelfile.title.charAt(0).toUpperCase() + | ||||
| 													selectedModelfile.title.slice(1) | ||||
| 											  }` | ||||
| 											: `Ollama - ${model}`, | ||||
| 										{ | ||||
| 											body: responseMessage.content, | ||||
| 											icon: selectedModelfile?.imageUrl ?? '/favicon.png' | ||||
| 										} | ||||
| 									); | ||||
| 								} | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
|  |  | |||
|  | @ -234,6 +234,21 @@ | |||
| 									eval_duration: data.eval_duration | ||||
| 								}; | ||||
| 								messages = messages; | ||||
| 
 | ||||
| 								if ($settings.responseNotification && !document.hasFocus()) { | ||||
| 									const notification = new Notification( | ||||
| 										selectedModelfile | ||||
| 											? `${ | ||||
| 													selectedModelfile.title.charAt(0).toUpperCase() + | ||||
| 													selectedModelfile.title.slice(1) | ||||
| 											  }` | ||||
| 											: `Ollama - ${model}`, | ||||
| 										{ | ||||
| 											body: responseMessage.content, | ||||
| 											icon: selectedModelfile?.imageUrl ?? '/favicon.png' | ||||
| 										} | ||||
| 									); | ||||
| 								} | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek