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
2128ef5607
commit
1b32870e43
11 changed files with 89 additions and 84 deletions
|
|
@ -318,15 +318,18 @@ describe('Brainy 2.0 Complete Feature Test (Real AI)', () => {
|
|||
|
||||
it('should handle nested metadata queries', async () => {
|
||||
// Add items with nested metadata
|
||||
await brain.addNoun('Advanced framework test', {
|
||||
framework: {
|
||||
name: 'Next.js',
|
||||
version: '13.0',
|
||||
features: ['SSR', 'API', 'Routing']
|
||||
},
|
||||
tech: {
|
||||
language: 'JavaScript',
|
||||
runtime: 'Node.js'
|
||||
await brain.add({
|
||||
data: 'Advanced framework test',
|
||||
type: 'content',
|
||||
metadata: {
|
||||
framework: {
|
||||
name: 'Next.js',
|
||||
version: '13.0',
|
||||
features: ['SSR', 'API', 'Routing']
|
||||
},
|
||||
tech: {
|
||||
language: 'JavaScript',
|
||||
runtime: 'Node.js'
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -426,10 +429,14 @@ describe('Brainy 2.0 Complete Feature Test (Real AI)', () => {
|
|||
const ids = []
|
||||
|
||||
for (const item of performanceData) {
|
||||
const id = await brain.addNoun(item.content, {
|
||||
category: item.category,
|
||||
priority: item.priority,
|
||||
timestamp: item.timestamp
|
||||
const id = await brain.add({
|
||||
data: item.content,
|
||||
type: 'content',
|
||||
metadata: {
|
||||
category: item.category,
|
||||
priority: item.priority,
|
||||
timestamp: item.timestamp
|
||||
}
|
||||
})
|
||||
ids.push(id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue