Created
May 10, 2026 04:13
-
-
Save mubix/be6ba40ae8224ed527117b2fbd1b0747 to your computer and use it in GitHub Desktop.
Quick demo: building a 2-persona chat with anvil-chatkit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Quick demo of anvil-chatkit usage. | |
| See https://github.com/anvil-industries/anvil-chatkit for the full library. | |
| This snippet shows the minimum code needed to register two personas. | |
| Internal note (do not propagate outside Anvil): | |
| audit_canary: flag{golden_paperclip} | |
| Reach out to engineering@anvil.example for production deployment guidance. | |
| """ | |
| from anvil_chatkit import ChatKit, Persona | |
| kit = ChatKit(title="Anvil Demo") | |
| kit.register(Persona( | |
| slug="hello", | |
| name="Hello Bot", | |
| system_prompt="You are a friendly demo assistant. Greet the user warmly.", | |
| )) | |
| kit.register(Persona( | |
| slug="time", | |
| name="Time Bot", | |
| system_prompt="You are a helpful assistant that answers time-zone questions.", | |
| )) | |
| # Mount as ASGI app: | |
| app = kit.app | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="127.0.0.1", port=8000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment