mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 07:14:20 +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")
|
||||
def get_memory_banks(
|
||||
self,
|
||||
self
|
||||
) -> 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(
|
||||
self,
|
||||
bank_uuid: str,
|
||||
documents: List[MemoryBankDocument],
|
||||
) -> 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(
|
||||
self,
|
||||
bank_uuid: str,
|
||||
document_uuids: List[str],
|
||||
) -> None: ...
|
||||
|
||||
@webmethod(route="/memory_banks/drop")
|
||||
def remove_memory_bank(
|
||||
self,
|
||||
bank_uuid: str,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
@dataclass
|
||||
class KPromptGenerations:
|
||||
|
|
|
@ -520,7 +520,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/memory_banks/delete": {
|
||||
"/memory_bank/delete": {
|
||||
"post": {
|
||||
"responses": {
|
||||
"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": {
|
||||
"responses": {
|
||||
"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": {
|
||||
"delete": {
|
||||
"responses": {
|
||||
|
@ -2694,6 +2815,53 @@
|
|||
],
|
||||
"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": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -3149,27 +3317,27 @@
|
|||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"name": "SyntheticDataGeneration"
|
||||
},
|
||||
{
|
||||
"name": "MemoryBanks"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystem"
|
||||
},
|
||||
{
|
||||
"name": "PostTraining"
|
||||
},
|
||||
{
|
||||
"name": "Inference"
|
||||
},
|
||||
{
|
||||
"name": "RewardScoring"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystem"
|
||||
},
|
||||
{
|
||||
"name": "MemoryBanks"
|
||||
},
|
||||
{
|
||||
"name": "Inference"
|
||||
},
|
||||
{
|
||||
"name": "Datasets"
|
||||
},
|
||||
{
|
||||
"name": "SyntheticDataGeneration"
|
||||
},
|
||||
{
|
||||
"name": "ShieldConfig",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldConfig\" />"
|
||||
|
@ -3286,6 +3454,10 @@
|
|||
"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\" />"
|
||||
},
|
||||
{
|
||||
"name": "MemoryBankDocument",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/MemoryBankDocument\" />"
|
||||
},
|
||||
{
|
||||
"name": "DPOAlignmentConfig",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/DPOAlignmentConfig\" />"
|
||||
|
@ -3366,6 +3538,7 @@
|
|||
"KScoredPromptGenerations",
|
||||
"LoraFinetuningConfig",
|
||||
"MemoryBank",
|
||||
"MemoryBankDocument",
|
||||
"Message",
|
||||
"OptimizerConfig",
|
||||
"PostTrainingJobArtifactsResponse",
|
||||
|
|
|
@ -1008,6 +1008,32 @@ components:
|
|||
- uuid
|
||||
- name
|
||||
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:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
|
@ -1655,6 +1681,142 @@ paths:
|
|||
description: OK
|
||||
tags:
|
||||
- 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:
|
||||
post:
|
||||
parameters:
|
||||
|
@ -1705,27 +1867,6 @@ paths:
|
|||
description: OK
|
||||
tags:
|
||||
- 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:
|
||||
delete:
|
||||
parameters:
|
||||
|
@ -1751,51 +1892,6 @@ paths:
|
|||
description: OK
|
||||
tags:
|
||||
- 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:
|
||||
get:
|
||||
parameters:
|
||||
|
@ -1916,13 +2012,13 @@ security:
|
|||
servers:
|
||||
- url: http://llama.meta.com
|
||||
tags:
|
||||
- name: SyntheticDataGeneration
|
||||
- name: MemoryBanks
|
||||
- name: AgenticSystem
|
||||
- name: PostTraining
|
||||
- name: Inference
|
||||
- name: RewardScoring
|
||||
- name: AgenticSystem
|
||||
- name: MemoryBanks
|
||||
- name: Inference
|
||||
- name: Datasets
|
||||
- name: SyntheticDataGeneration
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldConfig" />
|
||||
name: ShieldConfig
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemCreateRequest"
|
||||
|
@ -2046,6 +2142,9 @@ tags:
|
|||
<SchemaDefinition schemaRef="#/components/schemas/SyntheticDataGenerationResponse"
|
||||
/>'
|
||||
name: SyntheticDataGenerationResponse
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/MemoryBankDocument"
|
||||
/>
|
||||
name: MemoryBankDocument
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/DPOAlignmentConfig"
|
||||
/>
|
||||
name: DPOAlignmentConfig
|
||||
|
@ -2120,6 +2219,7 @@ x-tagGroups:
|
|||
- KScoredPromptGenerations
|
||||
- LoraFinetuningConfig
|
||||
- MemoryBank
|
||||
- MemoryBankDocument
|
||||
- Message
|
||||
- OptimizerConfig
|
||||
- PostTrainingJobArtifactsResponse
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue