Remove dots from the prompt template placeholder names
The ST library doesn't permit dots in the placeholder names.
This commit is contained in:
@@ -62,7 +62,7 @@ class OpenAiChatClientIT extends AbstractIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
void roleTest() {
|
||||
void call() {
|
||||
|
||||
// @formatter:off
|
||||
ChatResponse response = ChatClient.builder(chatModel).build().prompt()
|
||||
|
||||
@@ -576,12 +576,12 @@ public interface ChatClient {
|
||||
ChatClientRequest advisedRequest = adviseOnRequest(inputRequest, context);
|
||||
|
||||
var processedUserText = StringUtils.hasText(formatParam)
|
||||
? advisedRequest.userText + System.lineSeparator() + "{spring.ai.soc.format}"
|
||||
? advisedRequest.userText + System.lineSeparator() + "{spring_ai_soc_format}"
|
||||
: advisedRequest.userText;
|
||||
|
||||
Map<String, Object> userParams = new HashMap<>(advisedRequest.userParams);
|
||||
if (StringUtils.hasText(formatParam)) {
|
||||
userParams.put("spring.ai.soc.format", formatParam);
|
||||
userParams.put("spring_ai_soc_format", formatParam);
|
||||
}
|
||||
|
||||
var messages = new ArrayList<Message>(advisedRequest.messages);
|
||||
|
||||
@@ -29,9 +29,9 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class AbstractChatMemoryAdvisor<T> implements RequestResponseAdvisor {
|
||||
|
||||
public static final String CHAT_MEMORY_CONVERSATION_ID_KEY = "chat.memory.conversation.id";
|
||||
public static final String CHAT_MEMORY_CONVERSATION_ID_KEY = "chat_memory_conversation_id";
|
||||
|
||||
public static final String CHAT_MEMORY_RETRIEVE_SIZE_KEY = "chat.memory.response.size";
|
||||
public static final String CHAT_MEMORY_RETRIEVE_SIZE_KEY = "chat_memory_response_size";
|
||||
|
||||
public static final String DEFAULT_CHAT_MEMORY_CONVERSATION_ID = "default";
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class QuestionAnswerAdvisor implements RequestResponseAdvisor {
|
||||
private static final String DEFAULT_USER_TEXT_ADVISE = """
|
||||
Context information is below.
|
||||
---------------------
|
||||
{context}
|
||||
{question_answer_context}
|
||||
---------------------
|
||||
Given the context and provided history information and not prior knowledge,
|
||||
reply to the user comment. If the answer is not in the context, inform
|
||||
@@ -85,7 +85,7 @@ public class QuestionAnswerAdvisor implements RequestResponseAdvisor {
|
||||
|
||||
// 4. Advise the user parameters.
|
||||
Map<String, Object> advisedUserParams = new HashMap<>(request.userParams());
|
||||
advisedUserParams.put("context", documentContext);
|
||||
advisedUserParams.put("question_answer_context", documentContext);
|
||||
|
||||
AdvisedRequest advisedRequest = AdvisedRequest.from(request)
|
||||
.withUserText(advisedUserText)
|
||||
|
||||
Reference in New Issue
Block a user