feat: modernize API architecture and deprecation handling
- Modernize BrainyInterface to only contain current API methods (add, relate, find, get) - Update all interface consumers to use modern API patterns - Make Brainy class implement clean modernized interface - Update CLI commands to use add() and relate() instead of deprecated methods - Update all source code components to use modern API consistently - Update examples and integration tests to modern patterns - Improve architectural consistency across the entire codebase BREAKING: BrainyInterface no longer contains deprecated methods Migration: Use add() instead of addNoun(), relate() instead of addVerb()
This commit is contained in:
parent
e311a149df
commit
5be5ea5201
11 changed files with 89 additions and 84 deletions
|
|
@ -194,8 +194,8 @@ export class ImportManager {
|
|||
_confidence: item.confidence
|
||||
}
|
||||
|
||||
// Add to brain using proper API signature: addNoun(vectorOrData, nounType, metadata)
|
||||
const id = await this.brain.addNoun(dataToImport, nounType || 'content', metadata)
|
||||
// Add to brain using modern API signature
|
||||
const id = await this.brain.add({ data: dataToImport, type: nounType || 'content', metadata })
|
||||
result.nouns.push(id)
|
||||
result.stats.imported++
|
||||
return id
|
||||
|
|
@ -229,13 +229,13 @@ export class ImportManager {
|
|||
verbType = match.type
|
||||
}
|
||||
|
||||
const verbId = await this.brain.addVerb(
|
||||
rel.sourceId,
|
||||
rel.targetId,
|
||||
verbType as VerbType,
|
||||
rel.metadata,
|
||||
rel.weight
|
||||
)
|
||||
const verbId = await this.brain.relate({
|
||||
from: rel.sourceId,
|
||||
to: rel.targetId,
|
||||
type: verbType as VerbType,
|
||||
metadata: rel.metadata,
|
||||
weight: rel.weight
|
||||
})
|
||||
|
||||
result.verbs.push(verbId)
|
||||
result.stats.relationships++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue