pylogue 0.3__tar.gz → 0.3.29__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {pylogue-0.3 → pylogue-0.3.29}/PKG-INFO +10 -1
  2. pylogue-0.3.29/README.md +117 -0
  3. {pylogue-0.3 → pylogue-0.3.29}/pyproject.toml +10 -2
  4. pylogue-0.3.29/src/pylogue/core.py +804 -0
  5. pylogue-0.3.29/src/pylogue/embeds.py +32 -0
  6. pylogue-0.3.29/src/pylogue/integrations/__init__.py +1 -0
  7. pylogue-0.3.29/src/pylogue/integrations/pydantic_ai.py +417 -0
  8. pylogue-0.3.29/src/pylogue/legacy/cards.py +112 -0
  9. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/chat.py +54 -27
  10. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/chatapp.py +65 -26
  11. pylogue-0.3.29/src/pylogue/legacy/design_system.py +117 -0
  12. pylogue-0.3.29/src/pylogue/legacy/renderer.py +284 -0
  13. pylogue-0.3.29/src/pylogue/shell.py +342 -0
  14. pylogue-0.3.29/src/pylogue/static/pylogue-core.css +372 -0
  15. pylogue-0.3.29/src/pylogue/static/pylogue-core.js +199 -0
  16. pylogue-0.3.29/src/pylogue/static/pylogue-markdown.js +745 -0
  17. {pylogue-0.3 → pylogue-0.3.29}/src/pylogue.egg-info/PKG-INFO +10 -1
  18. pylogue-0.3.29/src/pylogue.egg-info/SOURCES.txt +33 -0
  19. {pylogue-0.3 → pylogue-0.3.29}/src/pylogue.egg-info/requires.txt +9 -0
  20. pylogue-0.3/README.md +0 -271
  21. pylogue-0.3/src/pylogue/cards.py +0 -174
  22. pylogue-0.3/src/pylogue/renderer.py +0 -139
  23. pylogue-0.3/src/pylogue.egg-info/SOURCES.txt +0 -24
  24. {pylogue-0.3 → pylogue-0.3.29}/AUTHORS.md +0 -0
  25. {pylogue-0.3 → pylogue-0.3.29}/CONTRIBUTING.md +0 -0
  26. {pylogue-0.3 → pylogue-0.3.29}/LICENSE +0 -0
  27. {pylogue-0.3 → pylogue-0.3.29}/MANIFEST.in +0 -0
  28. {pylogue-0.3 → pylogue-0.3.29}/setup.cfg +0 -0
  29. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/__init__.py +0 -0
  30. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/__pre_init__.py +0 -0
  31. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/_modidx.py +0 -0
  32. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/health.py +0 -0
  33. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/service.py +0 -0
  34. {pylogue-0.3/src/pylogue → pylogue-0.3.29/src/pylogue/legacy}/session.py +0 -0
  35. {pylogue-0.3 → pylogue-0.3.29}/src/pylogue.egg-info/dependency_links.txt +0 -0
  36. {pylogue-0.3 → pylogue-0.3.29}/src/pylogue.egg-info/entry_points.txt +0 -0
  37. {pylogue-0.3 → pylogue-0.3.29}/src/pylogue.egg-info/top_level.txt +0 -0
  38. {pylogue-0.3 → pylogue-0.3.29}/tests/__init__.py +0 -0
  39. {pylogue-0.3 → pylogue-0.3.29}/tests/test_pylogue.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pylogue
3
- Version: 0.3
3
+ Version: 0.3.29
4
4
  Summary: A Chatbot UI built for AI agents
5
5
  Author-email: Yeshwanth Reddy <yyeshr@gmail.com>
6
6
  Maintainer-email: Yeshwanth Reddy <yyeshr@gmail.com>
@@ -20,6 +20,15 @@ Requires-Dist: mkdocs-minify-plugin>=0.8.0
20
20
  Requires-Dist: mkdocs-git-revision-date-localized-plugin>=1.4.7
21
21
  Requires-Dist: pymdown-extensions>=10.16.1
22
22
  Requires-Dist: python-fasthtml>=0.12.29
23
+ Requires-Dist: monsterui
24
+ Requires-Dist: logfire>=4.20.0
25
+ Requires-Dist: pydantic-ai>=1.48.0
26
+ Requires-Dist: fastsql>=2.1.2
27
+ Requires-Dist: duckdb>=1.4.4
28
+ Requires-Dist: altair>=6.0.0
29
+ Requires-Dist: pandas>=3.0.0
30
+ Requires-Dist: simple-salesforce>=1.12.9
31
+ Requires-Dist: authlib>=1.3.2
23
32
  Provides-Extra: dev
24
33
  Requires-Dist: coverage; extra == "dev"
25
34
  Requires-Dist: mypy; extra == "dev"
@@ -0,0 +1,117 @@
1
+ # Pylogue
2
+
3
+ A FastHTML‑first, streaming chat framework with enough structure to stay polite in production — and enough whimsy to keep the lights on.
4
+
5
+ **Core promise:** You bring the agent. Pylogue handles the UI, streaming, and chat plumbing.
6
+
7
+ ## What It Is
8
+ - **Core runtime** for streaming chat over WebSockets
9
+ - **Responder integration** (e.g. Pydantic‑AI) with token streaming
10
+ - **Composable UI** helpers for chat cards, input, markdown, and tool status
11
+ - **Optional history** storage (local or SQLite via FastSQL)
12
+
13
+ ## Separation of Concerns (The USP)
14
+ - **Your business:** build the agent + responder (what it should say).
15
+ - **Pylogue’s business:** render the chat UI, stream tokens, and handle the wire protocol.
16
+
17
+ ## Quick Start (Minimal)
18
+ ```python
19
+ from pylogue.core import main
20
+
21
+ app = main(
22
+ responder=MyResponder(),
23
+ title="My Chat",
24
+ subtitle="Streaming chat with Pylogue",
25
+ )
26
+ ```
27
+
28
+ ## Custom UI + Core WebSocket
29
+ Build your own layout but keep core streaming behavior.
30
+ ```python
31
+ from fasthtml.common import *
32
+ from pylogue.core import get_core_headers, register_ws_routes, render_cards, render_input
33
+
34
+ def app_factory():
35
+ app = FastHTML(exts="ws", hdrs=tuple(get_core_headers()), pico=False)
36
+ register_ws_routes(app, responder=MyResponder())
37
+
38
+ @app.route("/")
39
+ def home():
40
+ return Body(
41
+ Div(
42
+ Div(render_cards([])),
43
+ Form(
44
+ render_input(),
45
+ id="form",
46
+ hx_ext="ws",
47
+ ws_connect="/ws",
48
+ ws_send=True,
49
+ hx_target="#cards",
50
+ hx_swap="outerHTML",
51
+ ),
52
+ )
53
+ )
54
+
55
+ return app
56
+ ```
57
+
58
+ ## Multi‑Chat Example (SQLite)
59
+ See `scripts/examples/chat_app_with_histories/` for:
60
+ - Sidebar history
61
+ - Title editing
62
+ - Delete with confirmation
63
+ - SQLite persistence via FastSQL
64
+
65
+ Run it:
66
+ ```bash
67
+ python -m scripts.examples.chat_app_with_histories.main
68
+ ```
69
+
70
+ ## Architecture
71
+ - **Flow diagram**: `docs/architecture.md`
72
+ - **Integration manual**: `docs/pylogue_integration_manual.md`
73
+
74
+ ## Google Login (OAuth)
75
+ Pylogue now supports opt-in Google login, modeled after the flow used in Vyasa.
76
+
77
+ Set environment variables:
78
+ ```bash
79
+ export PYLOGUE_GOOGLE_CLIENT_ID="your-google-client-id"
80
+ export PYLOGUE_GOOGLE_CLIENT_SECRET="your-google-client-secret"
81
+ export PYLOGUE_SESSION_SECRET="a-long-random-secret"
82
+ ```
83
+
84
+ Optional allow-lists:
85
+ ```bash
86
+ export PYLOGUE_GOOGLE_ALLOWED_DOMAINS="yourcompany.com"
87
+ export PYLOGUE_GOOGLE_ALLOWED_EMAILS="alice@yourcompany.com,bob@yourcompany.com"
88
+ ```
89
+
90
+ Optional auth toggle:
91
+ ```bash
92
+ # defaults to true when Google OAuth is configured
93
+ export PYLOGUE_AUTH_REQUIRED="true"
94
+ ```
95
+
96
+ When enabled, Pylogue registers:
97
+ - `/login`
98
+ - `/login/google`
99
+ - `/auth/google/callback`
100
+ - `/logout`
101
+
102
+ ## How Streaming Works (Short Version)
103
+ - Browser connects to `/ws`.
104
+ - Core (`register_ws_routes`) streams chunks as they arrive.
105
+ - Responder yields tokens; UI updates incrementally.
106
+
107
+ ## Folder Map
108
+ - Core runtime: `src/pylogue/core.py`
109
+ - Pydantic‑AI responder: `src/pylogue/integrations/pydantic_ai.py`
110
+ - Multi‑chat app: `scripts/examples/chat_app_with_histories/`
111
+
112
+ ## Notes
113
+ - If output appears all at once, your responder is not yielding chunks.
114
+ - If WS doesn’t connect, check `ws_connect` path and `base_path`.
115
+
116
+ ## Contributing
117
+ Professional, pragmatic, and a little whimsical. If you add a feature, add a small example.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pylogue"
7
- version = "0.3"
7
+ version = "0.3.29"
8
8
  description = "A Chatbot UI built for AI agents"
9
9
  readme = "README.rst"
10
10
  authors = [
@@ -27,6 +27,15 @@ dependencies = [
27
27
  "mkdocs-git-revision-date-localized-plugin>=1.4.7",
28
28
  "pymdown-extensions>=10.16.1",
29
29
  "python-fasthtml>=0.12.29",
30
+ "monsterui",
31
+ "logfire>=4.20.0",
32
+ "pydantic-ai>=1.48.0",
33
+ "fastsql>=2.1.2",
34
+ "duckdb>=1.4.4",
35
+ "altair>=6.0.0",
36
+ "pandas>=3.0.0",
37
+ "simple-salesforce>=1.12.9",
38
+ "authlib>=1.3.2",
30
39
  ]
31
40
 
32
41
  [project.optional-dependencies]
@@ -68,4 +77,3 @@ warn_no_return = true
68
77
  module = "tests.*"
69
78
  allow_untyped_defs = true
70
79
  disable_error_code = "attr-defined"
71
-