Refactor: Revert auth_token removal and add namespace to ToolSchemas.json, update tests.
This commit is contained in:
parent
bc0ae50be5
commit
a8694850b1
|
|
@ -5,10 +5,6 @@
|
||||||
"description": "Defines the tools exported by the Kompanion memory daemon.",
|
"description": "Defines the tools exported by the Kompanion memory daemon.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"namespace": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Default namespace applied to relative tool names."
|
|
||||||
},
|
|
||||||
"tools": {
|
"tools": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
|
|
@ -34,7 +30,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"namespace",
|
|
||||||
"tools"
|
"tools"
|
||||||
],
|
],
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|
@ -52,7 +47,6 @@
|
||||||
},
|
},
|
||||||
"examples": [
|
"examples": [
|
||||||
{
|
{
|
||||||
"namespace": "kom.memory.v1",
|
|
||||||
"tools": {
|
"tools": {
|
||||||
"save_context": {
|
"save_context": {
|
||||||
"description": "Persist context payload in the namespace-backed memory store.",
|
"description": "Persist context payload in the namespace-backed memory store.",
|
||||||
|
|
@ -110,10 +104,19 @@
|
||||||
"tags": {
|
"tags": {
|
||||||
"$ref": "#/$defs/stringList"
|
"$ref": "#/$defs/stringList"
|
||||||
},
|
},
|
||||||
|
"newest_first": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"limit": {
|
"limit": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"since": {
|
"offset": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"min_timestamp": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"max_timestamp": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -164,6 +167,9 @@
|
||||||
"input": {
|
"input": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"namespace": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"model": {
|
"model": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -172,6 +178,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
"namespace",
|
||||||
"texts"
|
"texts"
|
||||||
],
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
@ -429,6 +436,7 @@
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": [],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"output": {
|
"output": {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ std::string saveResp = server.dispatch("kom.memory.v1.save_context", saveReq);
|
||||||
if (!expect_contains(saveResp, "\"id\"", "save_context id")) return 1;
|
if (!expect_contains(saveResp, "\"id\"", "save_context id")) return 1;
|
||||||
if (!expect_contains(saveResp, "\"created_at\"", "save_context timestamp")) return 1;
|
if (!expect_contains(saveResp, "\"created_at\"", "save_context timestamp")) return 1;
|
||||||
|
|
||||||
|
const std::string saveReqNoNamespace = R"({"key":"nogreeting","content":{"text":"remember this without namespace"},"tags":["context","demo"]})";
|
||||||
|
std::string saveRespNoNamespace = server.dispatch("kom.memory.v1.save_context", saveReqNoNamespace);
|
||||||
|
if (!expect_contains(saveRespNoNamespace, "\"error\":{\"code\":\"bad_request\",\"message\":\"namespace is required\"}", "save_context without namespace should fail")) return 1;
|
||||||
|
|
||||||
const std::string recallReq = R"({"namespace":"tests","key":"greeting","limit":2})";
|
const std::string recallReq = R"({"namespace":"tests","key":"greeting","limit":2})";
|
||||||
std::string recallResp = server.dispatch("kom.memory.v1.recall_context", recallReq);
|
std::string recallResp = server.dispatch("kom.memory.v1.recall_context", recallReq);
|
||||||
if (!expect_contains(recallResp, "\"items\"", "recall_context items")) return 1;
|
if (!expect_contains(recallResp, "\"items\"", "recall_context items")) return 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue