Metadata-Version: 2.4
Name: trustmemory-sdk
Version: 0.1.0
Summary: SDK Python officiel pour l'API TrustMemory (memoire fiable et verification pour agents IA)
Author: d-e-c-d
License: MIT
Project-URL: Homepage, https://github.com/d-e-c-d/trustmemory
Project-URL: Repository, https://github.com/d-e-c-d/trustmemory
Project-URL: Issues, https://github.com/d-e-c-d/trustmemory/issues
Keywords: ai,llm,agents,chatbot,memory,fact-checking,hallucination,verification
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Dynamic: license-file

# trustmemory (SDK Python)

Client Python officiel pour l'API TrustMemory.

## Installation

```bash
pip install trustmemory-sdk
```

(en developpement local : `pip install -e sdk/python`)

## Usage

```python
from trustmemory import TrustMemoryClient

client = TrustMemoryClient(api_key="tm_votre_cle", base_url="http://localhost:8000")

# Enregistrer une interaction
client.save_memory(end_user_id="user-42", content="J'aime le cafe sans sucre")

# Recuperer le contexte pertinent pour une nouvelle conversation
context = client.get_context(end_user_id="user-42", query="preferences boisson")
print(context["summary"])
print(context["relevant_history"])

# Verifier une reponse avant de l'envoyer a l'utilisateur final
verification = client.verify_response("Paris est la capitale de la France.")
print(verification["overall_score"])

client.close()
```

Utilisation avec context manager (fermeture automatique) :

```python
with TrustMemoryClient(api_key="tm_votre_cle") as client:
    client.save_memory(end_user_id="user-42", content="...")
```

## Usage asynchrone

```python
import asyncio
from trustmemory import TrustMemoryAsyncClient

async def main():
    async with TrustMemoryAsyncClient(api_key="tm_votre_cle") as client:
        await client.save_memory(end_user_id="user-42", content="...")

asyncio.run(main())
```

## Gestion des erreurs

```python
from trustmemory import TrustMemoryClient, TrustMemoryError

client = TrustMemoryClient(api_key="cle_invalide")
try:
    client.save_memory(end_user_id="u1", content="test")
except TrustMemoryError as e:
    print(e.status_code, e.detail)
```
