75c67150d0
build / build (3.13) (push) Waiting to run
release-please / release-please (push) Waiting to run
release-please / build wheels (macos-aarch64) (push) Blocked by required conditions
release-please / build wheels (macos-x86_64) (push) Blocked by required conditions
release-please / build wheels (windows-x86_64) (push) Blocked by required conditions
release-please / build wheels (linux-aarch64) (push) Blocked by required conditions
release-please / build wheels (linux-x86_64) (push) Blocked by required conditions
release-please / build sdist (push) Blocked by required conditions
release-please / publish release artifacts (push) Blocked by required conditions
32 lines
791 B
Python
32 lines
791 B
Python
from typing import Any
|
|
|
|
import aiohttp
|
|
|
|
from ..config import memorize_config
|
|
|
|
BASE_URL = "https://api.memu.so"
|
|
API_KEY = "your memu api key"
|
|
USER_ID = "claude_user"
|
|
AGENT_ID = "claude_agent"
|
|
|
|
|
|
async def memorize(conversation_messages: list[dict[str, Any]]) -> str | None:
|
|
payload = {
|
|
"conversation": conversation_messages,
|
|
"user_id": USER_ID,
|
|
"agent_id": AGENT_ID,
|
|
"override_config": memorize_config,
|
|
}
|
|
|
|
async with (
|
|
aiohttp.ClientSession() as session,
|
|
session.post(
|
|
f"{BASE_URL}/api/v3/memory/memorize",
|
|
headers={"Authorization": f"Bearer {API_KEY}"},
|
|
json=payload,
|
|
) as response,
|
|
):
|
|
result = await response.json()
|
|
task_id = result["task_id"]
|
|
return task_id
|