mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
added memory_bank endpoint
This commit is contained in:
parent
86c2993296
commit
067ec4ce50
3 changed files with 380 additions and 93 deletions
|
@ -270,29 +270,43 @@ class MemoryBanks(Protocol):
|
||||||
|
|
||||||
@webmethod(route="/memory_banks/get")
|
@webmethod(route="/memory_banks/get")
|
||||||
def get_memory_banks(
|
def get_memory_banks(
|
||||||
self,
|
self
|
||||||
) -> List[MemoryBank]: ...
|
) -> List[MemoryBank]: ...
|
||||||
|
|
||||||
@webmethod(route="/memory_banks/insert")
|
@webmethod(route="/memory_banks/drop")
|
||||||
|
def remove_memory_bank(
|
||||||
|
self,
|
||||||
|
bank_uuid: str,
|
||||||
|
) -> None: ...
|
||||||
|
|
||||||
|
@webmethod(route="/memory_bank/insert")
|
||||||
def post_insert_memory_documents(
|
def post_insert_memory_documents(
|
||||||
self,
|
self,
|
||||||
bank_uuid: str,
|
bank_uuid: str,
|
||||||
documents: List[MemoryBankDocument],
|
documents: List[MemoryBankDocument],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
@webmethod(route="/memory_banks/delete")
|
@webmethod(route="/memory_bank/update")
|
||||||
|
def post_update_memory_documents(
|
||||||
|
self,
|
||||||
|
bank_uuid: str,
|
||||||
|
documents: List[MemoryBankDocument],
|
||||||
|
) -> None: ...
|
||||||
|
|
||||||
|
@webmethod(route="/memory_bank/get")
|
||||||
|
def post_get_memory_documents(
|
||||||
|
self,
|
||||||
|
bank_uuid: str,
|
||||||
|
document_uuids: List[str],
|
||||||
|
) -> List[MemoryBankDocument]: ...
|
||||||
|
|
||||||
|
@webmethod(route="/memory_bank/delete")
|
||||||
def post_delete_memory_documents(
|
def post_delete_memory_documents(
|
||||||
self,
|
self,
|
||||||
bank_uuid: str,
|
bank_uuid: str,
|
||||||
document_uuids: List[str],
|
document_uuids: List[str],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
@webmethod(route="/memory_banks/drop")
|
|
||||||
def remove_memory_bank(
|
|
||||||
self,
|
|
||||||
bank_uuid: str,
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class KPromptGenerations:
|
class KPromptGenerations:
|
||||||
|
|
|
@ -520,7 +520,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/memory_banks/delete": {
|
"/memory_bank/delete": {
|
||||||
"post": {
|
"post": {
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
|
@ -585,7 +585,49 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/memory_banks/insert": {
|
"/memory_bank/get": {
|
||||||
|
"post": {
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"content": {
|
||||||
|
"application/jsonl": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/MemoryBankDocument"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"MemoryBanks"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "bank_uuid",
|
||||||
|
"in": "query",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/memory_bank/insert": {
|
||||||
"post": {
|
"post": {
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
|
@ -740,6 +782,85 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/memory_bank/update": {
|
||||||
|
"post": {
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"MemoryBanks"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "bank_uuid",
|
||||||
|
"in": "query",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"uuid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"type": "string",
|
||||||
|
"contentEncoding": "base64"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mime_type": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"uuid",
|
||||||
|
"content",
|
||||||
|
"metadata",
|
||||||
|
"mime_type"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/memory_banks/drop": {
|
"/memory_banks/drop": {
|
||||||
"delete": {
|
"delete": {
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -2694,6 +2815,53 @@
|
||||||
],
|
],
|
||||||
"title": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold."
|
"title": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold."
|
||||||
},
|
},
|
||||||
|
"MemoryBankDocument": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"uuid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"type": "string",
|
||||||
|
"contentEncoding": "base64"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mime_type": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"uuid",
|
||||||
|
"content",
|
||||||
|
"metadata",
|
||||||
|
"mime_type"
|
||||||
|
]
|
||||||
|
},
|
||||||
"DPOAlignmentConfig": {
|
"DPOAlignmentConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -3149,27 +3317,27 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
{
|
|
||||||
"name": "SyntheticDataGeneration"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MemoryBanks"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AgenticSystem"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "PostTraining"
|
"name": "PostTraining"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "Inference"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "RewardScoring"
|
"name": "RewardScoring"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "AgenticSystem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MemoryBanks"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Inference"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Datasets"
|
"name": "Datasets"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "SyntheticDataGeneration"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ShieldConfig",
|
"name": "ShieldConfig",
|
||||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldConfig\" />"
|
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldConfig\" />"
|
||||||
|
@ -3286,6 +3454,10 @@
|
||||||
"name": "SyntheticDataGenerationResponse",
|
"name": "SyntheticDataGenerationResponse",
|
||||||
"description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/SyntheticDataGenerationResponse\" />"
|
"description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/SyntheticDataGenerationResponse\" />"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "MemoryBankDocument",
|
||||||
|
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/MemoryBankDocument\" />"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "DPOAlignmentConfig",
|
"name": "DPOAlignmentConfig",
|
||||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/DPOAlignmentConfig\" />"
|
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/DPOAlignmentConfig\" />"
|
||||||
|
@ -3366,6 +3538,7 @@
|
||||||
"KScoredPromptGenerations",
|
"KScoredPromptGenerations",
|
||||||
"LoraFinetuningConfig",
|
"LoraFinetuningConfig",
|
||||||
"MemoryBank",
|
"MemoryBank",
|
||||||
|
"MemoryBankDocument",
|
||||||
"Message",
|
"Message",
|
||||||
"OptimizerConfig",
|
"OptimizerConfig",
|
||||||
"PostTrainingJobArtifactsResponse",
|
"PostTrainingJobArtifactsResponse",
|
||||||
|
|
|
@ -1008,6 +1008,32 @@ components:
|
||||||
- uuid
|
- uuid
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
|
MemoryBankDocument:
|
||||||
|
additionalProperties: false
|
||||||
|
properties:
|
||||||
|
content:
|
||||||
|
contentEncoding: base64
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
additionalProperties:
|
||||||
|
oneOf:
|
||||||
|
- type: 'null'
|
||||||
|
- type: boolean
|
||||||
|
- type: number
|
||||||
|
- type: string
|
||||||
|
- type: array
|
||||||
|
- type: object
|
||||||
|
type: object
|
||||||
|
mime_type:
|
||||||
|
type: string
|
||||||
|
uuid:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- uuid
|
||||||
|
- content
|
||||||
|
- metadata
|
||||||
|
- mime_type
|
||||||
|
type: object
|
||||||
Message:
|
Message:
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
properties:
|
properties:
|
||||||
|
@ -1655,6 +1681,142 @@ paths:
|
||||||
description: OK
|
description: OK
|
||||||
tags:
|
tags:
|
||||||
- Datasets
|
- Datasets
|
||||||
|
/memory_bank/delete:
|
||||||
|
post:
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: bank_uuid
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
tags:
|
||||||
|
- MemoryBanks
|
||||||
|
/memory_bank/get:
|
||||||
|
post:
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: bank_uuid
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/jsonl:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/MemoryBankDocument'
|
||||||
|
description: OK
|
||||||
|
tags:
|
||||||
|
- MemoryBanks
|
||||||
|
/memory_bank/insert:
|
||||||
|
post:
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: bank_uuid
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
additionalProperties: false
|
||||||
|
properties:
|
||||||
|
content:
|
||||||
|
contentEncoding: base64
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
additionalProperties:
|
||||||
|
oneOf:
|
||||||
|
- type: 'null'
|
||||||
|
- type: boolean
|
||||||
|
- type: number
|
||||||
|
- type: string
|
||||||
|
- type: array
|
||||||
|
- type: object
|
||||||
|
type: object
|
||||||
|
mime_type:
|
||||||
|
type: string
|
||||||
|
uuid:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- uuid
|
||||||
|
- content
|
||||||
|
- metadata
|
||||||
|
- mime_type
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
tags:
|
||||||
|
- MemoryBanks
|
||||||
|
/memory_bank/update:
|
||||||
|
post:
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: bank_uuid
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
additionalProperties: false
|
||||||
|
properties:
|
||||||
|
content:
|
||||||
|
contentEncoding: base64
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
additionalProperties:
|
||||||
|
oneOf:
|
||||||
|
- type: 'null'
|
||||||
|
- type: boolean
|
||||||
|
- type: number
|
||||||
|
- type: string
|
||||||
|
- type: array
|
||||||
|
- type: object
|
||||||
|
type: object
|
||||||
|
mime_type:
|
||||||
|
type: string
|
||||||
|
uuid:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- uuid
|
||||||
|
- content
|
||||||
|
- metadata
|
||||||
|
- mime_type
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
tags:
|
||||||
|
- MemoryBanks
|
||||||
/memory_banks/create:
|
/memory_banks/create:
|
||||||
post:
|
post:
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -1705,27 +1867,6 @@ paths:
|
||||||
description: OK
|
description: OK
|
||||||
tags:
|
tags:
|
||||||
- MemoryBanks
|
- MemoryBanks
|
||||||
/memory_banks/delete:
|
|
||||||
post:
|
|
||||||
parameters:
|
|
||||||
- in: query
|
|
||||||
name: bank_uuid
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
type: array
|
|
||||||
required: true
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: OK
|
|
||||||
tags:
|
|
||||||
- MemoryBanks
|
|
||||||
/memory_banks/drop:
|
/memory_banks/drop:
|
||||||
delete:
|
delete:
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -1751,51 +1892,6 @@ paths:
|
||||||
description: OK
|
description: OK
|
||||||
tags:
|
tags:
|
||||||
- MemoryBanks
|
- MemoryBanks
|
||||||
/memory_banks/insert:
|
|
||||||
post:
|
|
||||||
parameters:
|
|
||||||
- in: query
|
|
||||||
name: bank_uuid
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
additionalProperties: false
|
|
||||||
properties:
|
|
||||||
content:
|
|
||||||
contentEncoding: base64
|
|
||||||
type: string
|
|
||||||
metadata:
|
|
||||||
additionalProperties:
|
|
||||||
oneOf:
|
|
||||||
- type: 'null'
|
|
||||||
- type: boolean
|
|
||||||
- type: number
|
|
||||||
- type: string
|
|
||||||
- type: array
|
|
||||||
- type: object
|
|
||||||
type: object
|
|
||||||
mime_type:
|
|
||||||
type: string
|
|
||||||
uuid:
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- uuid
|
|
||||||
- content
|
|
||||||
- metadata
|
|
||||||
- mime_type
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
required: true
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: OK
|
|
||||||
tags:
|
|
||||||
- MemoryBanks
|
|
||||||
/post_training/job/artifacts:
|
/post_training/job/artifacts:
|
||||||
get:
|
get:
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -1916,13 +2012,13 @@ security:
|
||||||
servers:
|
servers:
|
||||||
- url: http://llama.meta.com
|
- url: http://llama.meta.com
|
||||||
tags:
|
tags:
|
||||||
- name: SyntheticDataGeneration
|
|
||||||
- name: MemoryBanks
|
|
||||||
- name: AgenticSystem
|
|
||||||
- name: PostTraining
|
- name: PostTraining
|
||||||
- name: Inference
|
|
||||||
- name: RewardScoring
|
- name: RewardScoring
|
||||||
|
- name: AgenticSystem
|
||||||
|
- name: MemoryBanks
|
||||||
|
- name: Inference
|
||||||
- name: Datasets
|
- name: Datasets
|
||||||
|
- name: SyntheticDataGeneration
|
||||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldConfig" />
|
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldConfig" />
|
||||||
name: ShieldConfig
|
name: ShieldConfig
|
||||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemCreateRequest"
|
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemCreateRequest"
|
||||||
|
@ -2046,6 +2142,9 @@ tags:
|
||||||
<SchemaDefinition schemaRef="#/components/schemas/SyntheticDataGenerationResponse"
|
<SchemaDefinition schemaRef="#/components/schemas/SyntheticDataGenerationResponse"
|
||||||
/>'
|
/>'
|
||||||
name: SyntheticDataGenerationResponse
|
name: SyntheticDataGenerationResponse
|
||||||
|
- description: <SchemaDefinition schemaRef="#/components/schemas/MemoryBankDocument"
|
||||||
|
/>
|
||||||
|
name: MemoryBankDocument
|
||||||
- description: <SchemaDefinition schemaRef="#/components/schemas/DPOAlignmentConfig"
|
- description: <SchemaDefinition schemaRef="#/components/schemas/DPOAlignmentConfig"
|
||||||
/>
|
/>
|
||||||
name: DPOAlignmentConfig
|
name: DPOAlignmentConfig
|
||||||
|
@ -2120,6 +2219,7 @@ x-tagGroups:
|
||||||
- KScoredPromptGenerations
|
- KScoredPromptGenerations
|
||||||
- LoraFinetuningConfig
|
- LoraFinetuningConfig
|
||||||
- MemoryBank
|
- MemoryBank
|
||||||
|
- MemoryBankDocument
|
||||||
- Message
|
- Message
|
||||||
- OptimizerConfig
|
- OptimizerConfig
|
||||||
- PostTrainingJobArtifactsResponse
|
- PostTrainingJobArtifactsResponse
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue