fix(memory): simplify presentation labels
This commit is contained in:
1 parent
8f534e61c6
commit
c60e44cd31
6 files changed
+40
-6
No files matched your search
+1
-1
Submodule AgentKit updated: 78fe0990f5...4540847d47.
@@ -73,7 +73,7 @@ nonisolated enum AgentKnowledgeToolPresentation {
|
||||
AgentToolDetailFormatting.nonempty(args[key]?.stringValue)
|
||||
}
|
||||
let skills = localized("skills")
|
||||
let memory = localized("persistent memory")
|
||||
let memory = AppLocalization.resolve(AppStrings.Assistant.memorySearchScope, locale: locale)
|
||||
let sessions = localized("saved conversations")
|
||||
switch kind {
|
||||
case .skillsList:
|
||||
|
||||
@@ -1171,7 +1171,7 @@ nonisolated public enum AgentToolPresentation {
|
||||
case .secret: localized("a secret", locale: locale)
|
||||
case .skill: localized("a skill", locale: locale)
|
||||
case .skills: localized("skills", locale: locale)
|
||||
case .memory: localized("persistent memory", locale: locale)
|
||||
case .memory: localized(AppStrings.Assistant.memorySearchScope, locale: locale)
|
||||
case .sessions: localized("saved conversations", locale: locale)
|
||||
case .sshCommand: localized("a command", locale: locale)
|
||||
case .suggestion: localized("a suggestion", locale: locale)
|
||||
|
||||
@@ -1102,6 +1102,40 @@ struct AgentToolPresentationTests {
|
||||
struct AgentKnowledgeSearchPresentationTests {
|
||||
private let store = PresentationMemoryAccess()
|
||||
|
||||
@Test func memoryToolUsesMemoryInSummariesApprovalsAndBatches() {
|
||||
let descriptor = MemoryTool(store: store).descriptor
|
||||
let arguments: [String: AgentJSONValue] = [
|
||||
"operations": .array([
|
||||
.object(["action": .string("add"), "target": .string("memory"), "content": .string("Remember")])
|
||||
])
|
||||
]
|
||||
var memory = card(descriptor, arguments: arguments)
|
||||
memory.state = .completed
|
||||
#expect(AgentToolPresentation.summary(for: memory, locale: Locale(identifier: "en")) == "Updated memory")
|
||||
#expect(
|
||||
AgentToolPresentation.batchSummary(for: [memory, memory], locale: Locale(identifier: "en"))
|
||||
== "Updated memory (2 times)")
|
||||
#expect(AgentToolPresentation.summary(for: memory, locale: Locale(identifier: "zh-Hans")) == "已更新记忆")
|
||||
#expect(AgentToolPresentation.summary(for: memory, locale: Locale(identifier: "zh-Hant")) == "已更新記憶")
|
||||
|
||||
let request = AgentApprovalRequest(
|
||||
invocation: memory.invocation, descriptor: descriptor, userIntent: "Remember")
|
||||
#expect(
|
||||
AgentToolPresentation.approval(for: request, locale: Locale(identifier: "en")).title
|
||||
== "Update memory")
|
||||
#expect(
|
||||
AgentToolPresentation.approval(for: request, locale: Locale(identifier: "zh-Hans")).title
|
||||
== "更新记忆")
|
||||
|
||||
var fallback = card(
|
||||
.init(
|
||||
name: "other_memory_tool", summary: "Other memory tool", inputSchema: .object([:]),
|
||||
target: .local, approvalPolicy: .approve,
|
||||
presentation: .init(symbol: "brain", activity: .semanticLabel(.memory), actionKind: .read)))
|
||||
fallback.state = .completed
|
||||
#expect(AgentToolPresentation.summary(for: fallback, locale: Locale(identifier: "en")) == "Read memory")
|
||||
}
|
||||
|
||||
@Test func searchedQueryAndScopeAppearInSingleToolBatchHeaders() {
|
||||
let memory = MemorySearchTool(store: store).descriptor
|
||||
let chats = SessionSearchTool(store: store).descriptor
|
||||
|
||||
@@ -2866,7 +2866,7 @@
|
||||
repositoryURL = "https://github.com/AkinoKaede/AgentKit.git";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 0.15.1;
|
||||
minimumVersion = 0.15.2;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/AkinoKaede/AgentKit.git",
|
||||
"state" : {
|
||||
"revision" : "78fe0990f5b21247cca2f275e02b16279e2c335c",
|
||||
"version" : "0.15.1"
|
||||
"revision" : "4540847d4762f9040be7a8bab4cadd82e494c36d",
|
||||
"version" : "0.15.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user