Download examples/quickstart.py from ayjays132/PhillNet_Recall: direct link, hf CLI and curl.
- Browser
- Download file 728 Bytes
-
https://huggingface.co/ayjays132/PhillNet_Recall/resolve/main/examples/quickstart.py
- Command line
-
hf download hf://ayjays132/PhillNet_Recall/examples/quickstart.py
-
curl -L -o quickstart.py https://huggingface.co/ayjays132/PhillNet_Recall/resolve/main/examples/quickstart.py
728 Bytes
| from phillnet_recall import RecallMemory | |
| from phillnet_recall.context import pack_context | |
| with RecallMemory('recall.sqlite3',tenant='phillip',namespace='project-willow') as memory: | |
| # A write is explicit. Model output is not stored automatically. | |
| memory.remember('Project Willow uses port 7442.',source='operator:configuration', | |
| entity='Project Willow',predicate='service_port',value='7442',idempotency_key='willow-port-v1') | |
| result=memory.retrieve('What port does Project Willow use?') | |
| print(result['items'][0]['text']) | |
| # Without a tokenizer, the budget is explicitly measured in UTF-8 bytes. | |
| packet=pack_context(memory,'What port does Project Willow use?',budget=2048) | |
| print(packet['text']) | |