refactor: use Nuxt 4 directory structure

This commit is contained in:
AnotiaWang
2025-02-28 16:16:02 +08:00
parent 7a87ed5def
commit c45d75fad2
31 changed files with 33 additions and 28 deletions

View File

@ -1,14 +0,0 @@
import type { ResearchFeedbackResult } from '~/components/ResearchFeedback.vue'
import type { ResearchInputData } from '~/components/ResearchForm.vue'
export function getCombinedQuery(
form: ResearchInputData,
feedback: ResearchFeedbackResult[],
) {
return `Initial Query: ${form.query}
Follow-up Questions and Answers:
${feedback
.map((qa) => `Q: ${qa.assistantQuestion}\nA: ${qa.userAnswer}`)
.join('\n')}
`
}

View File

@ -1,28 +0,0 @@
export function isChildNode(parentId: string, childId: string) {
return childId.length > parentId.length && childId.startsWith(parentId)
}
export function isParentNode(parentId: string, childId: string) {
return childId.length < parentId.length && childId.startsWith(parentId)
}
export function isRootNode(nodeId: string) {
return nodeId === '0' // equal to `nodeDepth(nodeId) === 1`
}
export function parentNodeId(nodeId: string) {
return nodeId.split('-').shift()
}
export function nodeIndex(nodeId: string) {
return parseInt(nodeId.split('-').pop()!)
}
export function nodeDepth(nodeId: string) {
return nodeId.split('-').length
}
/** Returns the next search breadth at a given node */
export function searchBreadth(initialBreadth: number, nodeId: string) {
return Math.ceil(initialBreadth / Math.pow(2, nodeDepth(nodeId) - 1))
}