flip some prompting around
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 8m7s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Create Blog Article if new notes exist / prepare_blog_drafts_and_push (push) Failing after 8m7s
				
			This commit is contained in:
		
							parent
							
								
									2fbe47e936
								
							
						
					
					
						commit
						92e9f3dcc2
					
				@ -26,7 +26,7 @@ class OllamaGenerator:
 | 
			
		||||
        self.llm = ChatOllama(model=self.ollama_model, temperature=0.6, top_p=0.5) #This  is the level head in the room
 | 
			
		||||
        self.prompt_inject = f"""
 | 
			
		||||
            You are a journalist, Software Developer and DevOps expert
 | 
			
		||||
            writing a 3000 word draft blog article for other tech enthusiasts.
 | 
			
		||||
            writing a 5000 word draft blog article for other tech enthusiasts.
 | 
			
		||||
            You like to use almost no code examples and prefer to talk
 | 
			
		||||
            in a light comedic tone. You are also Australian
 | 
			
		||||
            As this person write this blog as a markdown document.
 | 
			
		||||
@ -71,8 +71,8 @@ class OllamaGenerator:
 | 
			
		||||
            top_k = int(random.uniform(30, 80))
 | 
			
		||||
            agent_llm = ChatOllama(model=model, temperature=temp, top_p=top_p, top_k=top_k)
 | 
			
		||||
            messages = [
 | 
			
		||||
                ("system", self.prompt_inject),
 | 
			
		||||
                ("human", "make the blog post in a format to be edited easily" )
 | 
			
		||||
                ("system", "You are a creative writer specialising in writing about technology"),
 | 
			
		||||
                ("human", self.prompt_inject )
 | 
			
		||||
            ]
 | 
			
		||||
            response = agent_llm.invoke(messages)
 | 
			
		||||
            # self.response = self.ollama_client.chat(model=model,
 | 
			
		||||
@ -119,10 +119,10 @@ class OllamaGenerator:
 | 
			
		||||
 | 
			
		||||
    def generate_markdown(self) -> str:
 | 
			
		||||
 | 
			
		||||
        prompt_system = f"""
 | 
			
		||||
        prompt_human = f"""
 | 
			
		||||
            You are an editor taking information from {len(self.agent_models)} Software
 | 
			
		||||
            Developers and Data experts
 | 
			
		||||
            writing a 3000 word blog article. You like when they use almost no code examples.
 | 
			
		||||
            writing a 5000 word blog article. You like when they use almost no code examples.
 | 
			
		||||
            You are also Australian. The content may have light comedic elements,
 | 
			
		||||
            you are more professional and will attempt to tone these down
 | 
			
		||||
            As this person produce the final version of this blog as a markdown document
 | 
			
		||||
@ -140,7 +140,7 @@ class OllamaGenerator:
 | 
			
		||||
            print("Showing pertinent info from drafts used in final edited edition")
 | 
			
		||||
            pertinent_draft_info = '\n\n'.join(collection.query(query_embeddings=query_embed, n_results=100)['documents'][0])
 | 
			
		||||
            #print(pertinent_draft_info)
 | 
			
		||||
            prompt_human = f"""Generate the final, 3000 word, draft of the blog using this information from the drafts: <context>{pertinent_draft_info}</context>
 | 
			
		||||
            prompt_system = f"""Generate the final, 5000 word, draft of the blog using this information from the drafts: <context>{pertinent_draft_info}</context>
 | 
			
		||||
                            - Only output in markdown, do not wrap in markdown tags, Only provide the draft not a commentary on the drafts in the context
 | 
			
		||||
                            """
 | 
			
		||||
            print("Generating final document")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user