View Javadoc
1   package io.github.magwas.coder.conversation;
2   
3   import org.springframework.beans.factory.annotation.Autowired;
4   import org.springframework.stereotype.Service;
5   
6   @Service
7   public class ConversationHasSystemInstructionsService implements ConversationStateConstants {
8   	@Autowired
9   	private ConversationStateRepository conversationStateRepository;
10  
11  	public Boolean apply() {
12  		return conversationStateRepository
13  				.findById(STATE_ID)
14  				.orElseThrow(() -> new IllegalStateException("Conversation not initialized"))
15  				.hasSystemInstructions();
16  	}
17  }