mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-07 23:28:30 +00:00
* feat: set basic structure deploy commands * feat: add first iteration of CLI Deploy * feat: some minor refactor * feat: Add api, Deploy command and update cli * feat: Remove test token * feat: add auth0 lib, update cli and improve code * feat: update code and decouple auth * fix: parts of the code * feat: Add token manager to encrypt access token and get and save tokens * feat: add audience to costants * feat: add subsystem saving credentials and remove comment of type hinting * feat: add get crew version to send on header of request * feat: add docstrings * feat: add tests for authentication module * feat: add tests for utils * feat: add unit tests for cl * feat: add tests * feat: add deploy man tests * feat: fix type checking issue * feat: rename tests to pass ci * feat: fix pr issues * feat: fix get crewai versoin * fix: add timeout for tests.yml
28 lines
654 B
Python
28 lines
654 B
Python
from typing import Any, Dict, Optional
|
|
|
|
from crewai.memory.storage.interface import Storage
|
|
|
|
|
|
class Memory:
|
|
"""
|
|
Base class for memory, now supporting agent tags and generic metadata.
|
|
"""
|
|
|
|
def __init__(self, storage: Storage):
|
|
self.storage = storage
|
|
|
|
def save(
|
|
self,
|
|
value: Any,
|
|
metadata: Optional[Dict[str, Any]] = None,
|
|
agent: Optional[str] = None,
|
|
) -> None:
|
|
metadata = metadata or {}
|
|
if agent:
|
|
metadata["agent"] = agent
|
|
|
|
self.storage.save(value, metadata)
|
|
|
|
def search(self, query: str) -> Dict[str, Any]:
|
|
return self.storage.search(query)
|