mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-12 13:11:05 +08:00
Fix: 修复文本资源解析为空
This commit is contained in:
@@ -57,7 +57,7 @@ public class TextPromptResource extends AbstractPromptResource {
|
||||
return Optional
|
||||
.ofNullable(location)
|
||||
.filter(s -> s.startsWith(prefix))
|
||||
.map(s -> s.startsWith(prefix) ? s.substring(prefix.length()) : s)
|
||||
.orElse("");
|
||||
.map(s -> s.substring(prefix.length()))
|
||||
.orElse(location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.yomahub.liteflow.test.cmp;
|
||||
|
||||
import com.yomahub.liteflow.ai.annotation.AIChat;
|
||||
import com.yomahub.liteflow.ai.annotation.AIComponent;
|
||||
import com.yomahub.liteflow.ai.annotation.AIInput;
|
||||
import com.yomahub.liteflow.ai.annotation.InputField;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
@@ -18,7 +20,14 @@ import com.yomahub.liteflow.ai.annotation.AIComponent;
|
||||
model = "qwen3:32b"
|
||||
)
|
||||
@AIChat(
|
||||
userPrompt = "Why sky is blue?"
|
||||
systemPrompt = "classpath:system_prompt.txt",
|
||||
userPrompt = "{{question}}, {{answer}}"
|
||||
)
|
||||
@AIInput(
|
||||
mapping = {
|
||||
@InputField(name = "question", expression = "test", defaultValue = "Why sky is blue?"),
|
||||
@InputField(name = "answer", expression = "test", defaultValue = "The sky appears blue due to the scattering of sunlight by the atmosphere.")
|
||||
}
|
||||
)
|
||||
public interface AICmp {
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
You are a chatbot that helps users with their questions about the LiteFlow framework.
|
||||
Reference in New Issue
Block a user