refactor: use Nuxt 4 directory structure
This commit is contained in:
@ -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')}
|
||||
`
|
||||
}
|
@ -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))
|
||||
}
|
Reference in New Issue
Block a user