feat: expand companion platform, device controls, and memoir workflows
ci / verify (push) Canceled after 0s
ci / verify (push) Canceled after 0s
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package contentmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"data-terminal-cloud/internal/callmemory"
|
||||
"data-terminal-cloud/internal/extraction"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/jackc/pgx/v5"
|
||||
)
|
||||
|
||||
func (r *Registry) ExtractMemoryIntents(ctx context.Context, tenant string, turns []callmemory.SourceTurn, records []map[string]any) ([]callmemory.Intent, error) {
|
||||
var generator extraction.Generator = r.fallback
|
||||
item, e := r.active(ctx, tenant)
|
||||
if e != nil && !errors.Is(e, pgx.ErrNoRows) {
|
||||
return nil, e
|
||||
}
|
||||
if e == nil {
|
||||
generator, e = r.generator(item)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
}
|
||||
structured, ok := generator.(interface {
|
||||
GenerateJSON(context.Context, string, string) (json.RawMessage, error)
|
||||
})
|
||||
if !ok {
|
||||
return nil, errors.New("memory intent model is not configured")
|
||||
}
|
||||
raw, e := structured.GenerateJSON(ctx, callmemory.IntentInput(turns, records), callmemory.IntentPrompt)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
return callmemory.ParseIntents(raw)
|
||||
}
|
||||
Reference in New Issue
Block a user