mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
<WIP> memory changes
- inlined AgenticSystemInstanceConfig so API feels more ergonomic - renamed it to AgentConfig, AgentInstance -> Agent - added a MemoryConfig and `memory` parameter - added `attachments` to input and `output_attachments` to the response - some naming changes
This commit is contained in:
parent
5655266d58
commit
48c6a32edd
12 changed files with 149 additions and 163 deletions
|
@ -6,17 +6,31 @@
|
|||
|
||||
from typing import List, Protocol
|
||||
|
||||
from llama_models.schema_utils import webmethod
|
||||
from llama_models.llama3_1.api.datatypes import InterleavedTextAttachment
|
||||
|
||||
from llama_models.schema_utils import webmethod
|
||||
from .datatypes import * # noqa: F403
|
||||
|
||||
|
||||
class MemoryBanks(Protocol):
|
||||
@json_schema_type
|
||||
class RetrieveMemoryDocumentsRequest(BaseModel):
|
||||
query: InterleavedTextAttachment
|
||||
bank_ids: str
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class RetrieveMemoryDocumentsResponse(BaseModel):
|
||||
documents: List[MemoryBankDocument]
|
||||
scores: List[float]
|
||||
|
||||
|
||||
class Memory(Protocol):
|
||||
@webmethod(route="/memory_banks/create")
|
||||
def create_memory_bank(
|
||||
self,
|
||||
bank_id: str,
|
||||
bank_name: str,
|
||||
embedding_model: str,
|
||||
documents: List[MemoryBankDocument],
|
||||
) -> None: ...
|
||||
|
||||
|
@ -46,6 +60,12 @@ class MemoryBanks(Protocol):
|
|||
documents: List[MemoryBankDocument],
|
||||
) -> None: ...
|
||||
|
||||
@webmethod(route="/memory_bank/get")
|
||||
def retrieve_memory_documents(
|
||||
self,
|
||||
request: RetrieveMemoryDocumentsRequest,
|
||||
) -> List[MemoryBankDocument]: ...
|
||||
|
||||
@webmethod(route="/memory_bank/get")
|
||||
def get_memory_documents(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue