We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8eea9b5 commit cf5de02Copy full SHA for cf5de02
app/actions/chatActions.ts
@@ -165,11 +165,11 @@ export async function askAI(params: ChatParams): Promise<ChatResult> {
165
if (!text) {
166
throw new Error("AIからの応答が空でした");
167
}
168
- let targetSectionId = text.split(/-{3,}/)[0].trim() as SectionId;
+ let targetSectionId = text.split(/\n-{3,}\n/)[0].trim() as SectionId;
169
if (!targetSectionId) {
170
targetSectionId = introSectionId(path);
171
172
- const responseMessage = text.split(/-{3,}/)[1].trim();
+ const responseMessage = text.split(/\n-{3,}\n/)[1].trim();
173
const newChat = await addChat(path, targetSectionId, [
174
{ role: "user", content: userQuestion },
175
{ role: "ai", content: responseMessage },
0 commit comments