( ctx context.Context, query string, selection hostAPIMemoryRecallSelection, )
| 1952 | } |
| 1953 | |
| 1954 | func (h *HostAPIHandler) recallMemory( |
| 1955 | ctx context.Context, |
| 1956 | query string, |
| 1957 | selection hostAPIMemoryRecallSelection, |
| 1958 | ) (memcontract.Packaged, error) { |
| 1959 | workspaceID, err := h.resolveWorkspaceID(ctx, selection.Workspace) |
| 1960 | if err != nil { |
| 1961 | return memcontract.Packaged{}, err |
| 1962 | } |
| 1963 | if selection.Scope.Normalize() == memcontract.ScopeGlobal { |
| 1964 | workspaceID = "" |
| 1965 | } |
| 1966 | if providerRecall, ok, err := h.recallMemoryFromProvider( |
| 1967 | ctx, |
| 1968 | query, |
| 1969 | workspaceID, |
| 1970 | selection.Limit, |
| 1971 | ); ok || |
| 1972 | err != nil { |
| 1973 | return providerRecall, err |
| 1974 | } |
| 1975 | return h.recallMemoryFromStore(ctx, query, workspaceID, selection) |
| 1976 | } |
| 1977 | |
| 1978 | func (h *HostAPIHandler) recallMemoryFromProvider( |
| 1979 | ctx context.Context, |
no test coverage detected