mirror of
				https://github.com/discourse/discourse-ai.git
				synced 2025-10-31 06:28:48 +00:00 
			
		
		
		
	* FEATURE: Tweak HyDE prompts for better grounding in forum subject and limit response size * fix test * lint
		
			
				
	
	
		
			29 lines
		
	
	
		
			691 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			691 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # frozen_string_literal: true
 | |
| 
 | |
| module DiscourseAi
 | |
|   module Embeddings
 | |
|     module HydeGenerators
 | |
|       class Llama2Ftos < DiscourseAi::Embeddings::HydeGenerators::Llama2
 | |
|         def prompt(search_term)
 | |
|           <<~TEXT
 | |
|               ### System:
 | |
|               You are a helpful bot
 | |
|               You create forum posts about a given subject
 | |
|               
 | |
|               ### User:
 | |
|               #{basic_prompt_instruction}
 | |
|               #{search_term}
 | |
|     
 | |
|               ### Assistant:
 | |
|               Here is a forum post about the above subject:
 | |
|             TEXT
 | |
|         end
 | |
| 
 | |
|         def models
 | |
|           %w[StableBeluga2 Upstage-Llama-2-*-instruct-v2]
 | |
|         end
 | |
|       end
 | |
|     end
 | |
|   end
 | |
| end
 |