mirror of
https://github.com/fsecada01/Pygentic-AI.git
synced 2025-07-08 20:24:04 +00:00
WIP: initial builds for site components
This commit is contained in:
@ -12,15 +12,18 @@ repos:
|
||||
- id: end-of-file-fixer
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
- hooks:
|
||||
- id: add-trailing-comma
|
||||
repo: 'https://github.com/asottile/add-trailing-comma'
|
||||
rev: v3.1.0
|
||||
- repo: https://github.com/aufdenpunkt/pre-commit-js-beautify
|
||||
rev: 1.13.0 # represents the used version of JS Beautify as well
|
||||
hooks:
|
||||
- id: js-beautify
|
||||
args: ['--html', '--wrap-attributes=force-aligned', '--wrap-line-length=80', "--templating=django"]
|
||||
files: \.(html|jinja)$
|
||||
- hooks:
|
||||
- id: pyupgrade
|
||||
repo: 'https://github.com/asottile/pyupgrade'
|
||||
rev: v3.19.1
|
||||
|
||||
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: "v0.9.2"
|
||||
|
@ -12,6 +12,7 @@ httpx[socks]
|
||||
httpx-html
|
||||
html5lib
|
||||
hypercorn; platform_system == 'Windows'
|
||||
itsdangerous
|
||||
jinjax
|
||||
loguru
|
||||
lxml
|
||||
|
@ -10,7 +10,7 @@ annotated-types==0.7.0
|
||||
# via
|
||||
# pydantic
|
||||
# sqlmodel-crud-utilities
|
||||
anthropic==0.43.0
|
||||
anthropic==0.43.1
|
||||
# via pydantic-ai-slim
|
||||
anyio==4.8.0
|
||||
# via
|
||||
@ -154,6 +154,8 @@ importlib-metadata==8.5.0
|
||||
# via
|
||||
# opentelemetry-api
|
||||
# pyppeteer
|
||||
itsdangerous==2.2.0
|
||||
# via -r core_requirements.in
|
||||
jinja2==3.1.5
|
||||
# via jinjax
|
||||
jinjax==0.48
|
||||
@ -193,7 +195,7 @@ mistralai==1.3.1
|
||||
# via pydantic-ai-slim
|
||||
mypy-extensions==1.0.0
|
||||
# via typing-inspect
|
||||
openai==1.59.7
|
||||
openai==1.59.8
|
||||
# via pydantic-ai-slim
|
||||
opentelemetry-api==1.29.0
|
||||
# via
|
||||
|
@ -398,7 +398,7 @@ urllib3==1.26.20
|
||||
# via
|
||||
# -c core_requirements.txt
|
||||
# requests
|
||||
virtualenv==20.29.0
|
||||
virtualenv==20.29.1
|
||||
# via pre-commit
|
||||
wcwidth==0.2.13
|
||||
# via
|
||||
|
@ -79,7 +79,7 @@ dependencies = [
|
||||
"aiomysql==0.2.0",
|
||||
"amqp==5.3.1",
|
||||
"annotated-types==0.7.0",
|
||||
"anthropic==0.43.0",
|
||||
"anthropic==0.43.1",
|
||||
"anyio==4.8.0",
|
||||
"appdirs==1.4.4",
|
||||
"asgiref==3.8.1",
|
||||
@ -124,6 +124,7 @@ dependencies = [
|
||||
"hyperframe==6.0.1",
|
||||
"idna==3.10",
|
||||
"importlib-metadata==8.5.0",
|
||||
"itsdangerous==2.2.0",
|
||||
"jinja2==3.1.5",
|
||||
"jinjax==0.48",
|
||||
"jiter==0.8.2",
|
||||
@ -139,7 +140,7 @@ dependencies = [
|
||||
"mdurl==0.1.2",
|
||||
"mistralai==1.3.1",
|
||||
"mypy-extensions==1.0.0",
|
||||
"openai==1.59.7",
|
||||
"openai==1.59.8",
|
||||
"opentelemetry-api==1.29.0",
|
||||
"opentelemetry-exporter-otlp-proto-common==1.29.0",
|
||||
"opentelemetry-exporter-otlp-proto-http==1.29.0",
|
||||
@ -332,7 +333,7 @@ dev = [
|
||||
"typing-extensions==4.12.2",
|
||||
"uri-template==1.3.0",
|
||||
"urllib3==1.26.20",
|
||||
"virtualenv==20.29.0",
|
||||
"virtualenv==20.29.1",
|
||||
"wcwidth==0.2.13",
|
||||
"webcolors==24.11.1",
|
||||
"webencodings==0.5.1",
|
||||
|
@ -121,7 +121,7 @@ if app_settings.DEBUG in (True, "True"):
|
||||
|
||||
app.add_middleware(
|
||||
DebugToolbarMiddleware,
|
||||
panels=["app.SQLModelPanel"],
|
||||
panels=["app.SQLAModelPanel"],
|
||||
disable_panels=["debug_toolbar.panels.profiling.ProfilingPanel"],
|
||||
)
|
||||
|
||||
|
@ -24,7 +24,7 @@ class SwotAgentDeps(Base):
|
||||
|
||||
request: Any | None = None
|
||||
update_status_func: Callable | None = None
|
||||
tool_history: list[str]
|
||||
tool_history: list[str] | None = None
|
||||
|
||||
|
||||
swot_agent = Agent(
|
||||
|
@ -26,7 +26,7 @@ catalog = Catalog(jinja_env=templates.env)
|
||||
list(
|
||||
map(
|
||||
lambda folder: catalog.add_folder(
|
||||
os.path.join(frontend, "components", folder), # noqa
|
||||
os.path.join(frontend, "templates", "components", folder), # noqa
|
||||
),
|
||||
("main", "forms", "snippets"),
|
||||
),
|
||||
|
@ -57,7 +57,7 @@ def get_val(val: str, default: str | int | bool | None = None, **kwargs):
|
||||
val = os.environ.get(val)
|
||||
elif config(val, None, **kwargs) is not None:
|
||||
val = config(val)
|
||||
elif default:
|
||||
elif default is not None:
|
||||
val = default
|
||||
else:
|
||||
raise ValueError(
|
||||
|
23
src/frontend/templates/components/main/Base.jinja
Normal file
23
src/frontend/templates/components/main/Base.jinja
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<Header title="Pygentic AI">
|
||||
<meta http-equiv="X-UA-Compatible"
|
||||
content="IE-edge, chrome=1">
|
||||
<Css url="{{ url_for('static', path='/css/bulma.min.css') }}"></Css>
|
||||
<Css url="{{ url_for('static', path='/css/bulma-calendar.min.css') }}">
|
||||
</Css>
|
||||
<Css url="{{ url_for('static', path='/css/bulmatags-input.min-css') }}">
|
||||
</Css>
|
||||
<Css
|
||||
url="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
|
||||
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
</Css>
|
||||
</Header>
|
||||
|
||||
<body>
|
||||
{{ content }}
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,9 +1,12 @@
|
||||
{# def
|
||||
title: str
|
||||
#}
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }}</title>
|
||||
{{ slot }}
|
||||
</head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }}</title>
|
||||
{{ content }}
|
||||
<Stylesheets></Stylesheets>
|
||||
</head>
|
@ -0,0 +1,8 @@
|
||||
<nav class="navbar is-link">
|
||||
<NavbarBrand url=''
|
||||
brand_title="Pygentic AI"></NavbarBrand>
|
||||
<NavbarMenu>
|
||||
<a href="#"
|
||||
class="navbar-item">Coming Soon</a>
|
||||
</NavbarMenu>
|
||||
</nav>
|
3
src/frontend/templates/components/main/Scripts.jinja
Normal file
3
src/frontend/templates/components/main/Scripts.jinja
Normal file
@ -0,0 +1,3 @@
|
||||
<Js url="{{ url_for('static', path="/js/htmx.js") }}">type="modules"</Js>
|
||||
<Js url="{{ url_for('static', path="/js/bulma.js") }}"></Js>
|
||||
<Js url="{{ url_for('static', path="/js/bulma-collapsible.min.js") }}"></Js>
|
9
src/frontend/templates/components/main/Stylesheets.jinja
Normal file
9
src/frontend/templates/components/main/Stylesheets.jinja
Normal file
@ -0,0 +1,9 @@
|
||||
<Css url="{{ url_for('static', path='css/bulma.min.css') }}"></Css>
|
||||
<Css url="{{ url_for('static', path='css/bulma.css.map') }}"></Css>
|
||||
<Css url="{{ url_for('static', path='css/bulma-collapsible.css') }}"></Css>
|
||||
<Css
|
||||
url="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
|
||||
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
</Css>
|
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<Header title="Pygentic AI">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE-edge, chrome=1">
|
||||
<Css url="{{ url_for('static', path='/css/bulma.min.css') }}"></Css>
|
||||
<Css url="{{ url_for('static', path='/css/bulma-calendar.min.css') }}"></Css>
|
||||
<Css url="{{ url_for('static', path='/css/bulmatags-input.min-css') }}"></Css>
|
||||
<Css url="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
|
||||
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
</Css>
|
||||
</Header>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -5,5 +5,4 @@
|
||||
|
||||
<link rel={{ rel }}
|
||||
href={{ url }}
|
||||
{{ slot }}
|
||||
/>
|
||||
{{ content }} />
|
@ -1,8 +1,6 @@
|
||||
{# def
|
||||
url: str
|
||||
url: str,
|
||||
#}
|
||||
|
||||
<script
|
||||
src={{ url }}
|
||||
{{ slot }}
|
||||
></script>
|
||||
<script src={{ url }}
|
||||
{{ content }}></script>
|
18
src/frontend/templates/components/snippets/NavbarBrand.jinja
Normal file
18
src/frontend/templates/components/snippets/NavbarBrand.jinja
Normal file
@ -0,0 +1,18 @@
|
||||
{# def
|
||||
url: str,
|
||||
brand_title: str
|
||||
#}
|
||||
|
||||
<div class="navbar-brand">
|
||||
<a href={{ url }}
|
||||
class="navbar-item">{{ brand_title }}</a>
|
||||
<a class="navbar-burger"
|
||||
role='button'
|
||||
aria-label='menu'
|
||||
aria-expanded='false'
|
||||
data-target='mainNavbar'>
|
||||
<span aria-hidden='true'></span>
|
||||
<span aria-hidden='true'></span>
|
||||
<span aria-hidden='true'></span>
|
||||
</a>
|
||||
</div>
|
17
src/frontend/templates/components/snippets/NavbarMenu.jinja
Normal file
17
src/frontend/templates/components/snippets/NavbarMenu.jinja
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="navbar-menu"
|
||||
id="mainNavbar">
|
||||
<div class="navbar-end">
|
||||
{% if request.user.is_authenticated %}
|
||||
{{ content }}
|
||||
<a href="#"
|
||||
class="havar-item">Logout</a>
|
||||
{% else %}
|
||||
<a href="#"
|
||||
class="havbar-item">Log In</a>
|
||||
<a href="#"
|
||||
class="havbar-item">Create Account</a>
|
||||
<a href=""
|
||||
class="havbar-item"></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
3
src/frontend/templates/home.html
Normal file
3
src/frontend/templates/home.html
Normal file
@ -0,0 +1,3 @@
|
||||
<Base>
|
||||
<p>foo bar</p>
|
||||
</Base>
|
35
uv.lock
generated
35
uv.lock
generated
@ -55,6 +55,7 @@ dependencies = [
|
||||
{ name = "hyperframe" },
|
||||
{ name = "idna" },
|
||||
{ name = "importlib-metadata" },
|
||||
{ name = "itsdangerous" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "jinjax" },
|
||||
{ name = "jiter" },
|
||||
@ -276,7 +277,7 @@ requires-dist = [
|
||||
{ name = "aiomysql", specifier = "==0.2.0" },
|
||||
{ name = "amqp", specifier = "==5.3.1" },
|
||||
{ name = "annotated-types", specifier = "==0.7.0" },
|
||||
{ name = "anthropic", specifier = "==0.43.0" },
|
||||
{ name = "anthropic", specifier = "==0.43.1" },
|
||||
{ name = "anyio", specifier = "==4.8.0" },
|
||||
{ name = "appdirs", specifier = "==1.4.4" },
|
||||
{ name = "asgiref", specifier = "==3.8.1" },
|
||||
@ -321,6 +322,7 @@ requires-dist = [
|
||||
{ name = "hyperframe", specifier = "==6.0.1" },
|
||||
{ name = "idna", specifier = "==3.10" },
|
||||
{ name = "importlib-metadata", specifier = "==8.5.0" },
|
||||
{ name = "itsdangerous", specifier = "==2.2.0" },
|
||||
{ name = "jinja2", specifier = "==3.1.5" },
|
||||
{ name = "jinjax", specifier = "==0.48" },
|
||||
{ name = "jiter", specifier = "==0.8.2" },
|
||||
@ -336,7 +338,7 @@ requires-dist = [
|
||||
{ name = "mdurl", specifier = "==0.1.2" },
|
||||
{ name = "mistralai", specifier = "==1.3.1" },
|
||||
{ name = "mypy-extensions", specifier = "==1.0.0" },
|
||||
{ name = "openai", specifier = "==1.59.7" },
|
||||
{ name = "openai", specifier = "==1.59.8" },
|
||||
{ name = "opentelemetry-api", specifier = "==1.29.0" },
|
||||
{ name = "opentelemetry-exporter-otlp-proto-common", specifier = "==1.29.0" },
|
||||
{ name = "opentelemetry-exporter-otlp-proto-http", specifier = "==1.29.0" },
|
||||
@ -529,7 +531,7 @@ dev = [
|
||||
{ name = "typing-extensions", specifier = "==4.12.2" },
|
||||
{ name = "uri-template", specifier = "==1.3.0" },
|
||||
{ name = "urllib3", specifier = "==1.26.20" },
|
||||
{ name = "virtualenv", specifier = "==20.29.0" },
|
||||
{ name = "virtualenv", specifier = "==20.29.1" },
|
||||
{ name = "wcwidth", specifier = "==0.2.13" },
|
||||
{ name = "webcolors", specifier = "==24.11.1" },
|
||||
{ name = "webencodings", specifier = "==0.5.1" },
|
||||
@ -594,7 +596,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "anthropic"
|
||||
version = "0.43.0"
|
||||
version = "0.43.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
@ -605,9 +607,9 @@ dependencies = [
|
||||
{ name = "sniffio" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e1/0a/973d2ac6c9f7d1be41829c7b878cbe399385b25cc2ebe80ad0eec9999b8c/anthropic-0.43.0.tar.gz", hash = "sha256:06801f01d317a431d883230024318d48981758058bf7e079f33fb11f64b5a5c1", size = 194826 }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ca/d8/238c2bc59e41a787e7b62460adfc7b2edd88f28b0a14e292801a72725369/anthropic-0.43.1.tar.gz", hash = "sha256:c7f13e4b7b515ac4a3111142310b214527c0fc561485e5bc9b582e49fe3adba2", size = 195298 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d7/88/ded3ba979a2218a448cbc1a1e762d998b92f30529452c5104b35b6cb71f8/anthropic-0.43.0-py3-none-any.whl", hash = "sha256:f748a703f77b3244975e1aace3a935840dc653a4714fb6bba644f97cc76847b4", size = 207867 },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/2b/63b167d76401f759c8c4ff0266042e60aac6fd3cc0685b27437ceaaf95eb/anthropic-0.43.1-py3-none-any.whl", hash = "sha256:20759c25cd0f4072eb966b0180a41c061c156473bbb674da6a3f1e92e1ad78f8", size = 208170 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1484,6 +1486,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/b3/8def84f539e7d2289a02f0524b944b15d7c75dab7628bedf1c4f0992029c/isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6", size = 92310 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itsdangerous"
|
||||
version = "2.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9c/cb/8ac0172223afbccb63986cc25049b154ecfb5e85932587206f42317be31d/itsdangerous-2.2.0.tar.gz", hash = "sha256:e0050c0b7da1eea53ffaf149c0cfbb5c6e2e2b69c4bef22c81fa6eb73e5f6173", size = 54410 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/04/96/92447566d16df59b2a776c0fb82dbc4d9e07cd95062562af01e408583fc4/itsdangerous-2.2.0-py3-none-any.whl", hash = "sha256:c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef", size = 16234 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jedi"
|
||||
version = "0.19.2"
|
||||
@ -2074,7 +2085,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "openai"
|
||||
version = "1.59.7"
|
||||
version = "1.59.8"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
@ -2086,9 +2097,9 @@ dependencies = [
|
||||
{ name = "tqdm" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f9/d5/25cf04789c7929b476c4d9ef711f8979091db63d30bfc093828fe4bf5c72/openai-1.59.7.tar.gz", hash = "sha256:043603def78c00befb857df9f0a16ee76a3af5984ba40cb7ee5e2f40db4646bf", size = 345007 }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e0/c4/b4482784de63c7158f6c0afcb07fd66450ea6c912d6bddf9d7599f2eda25/openai-1.59.8.tar.gz", hash = "sha256:ac4bda5fa9819fdc6127e8ea8a63501f425c587244bc653c7c11a8ad84f953e1", size = 346775 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/47/7b92f1731c227f4139ef0025b5996062e44f9a749c54315c8bdb34bad5ec/openai-1.59.7-py3-none-any.whl", hash = "sha256:cfa806556226fa96df7380ab2e29814181d56fea44738c2b0e581b462c268692", size = 454844 },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/cf/5b235e12ead3cd2098f9792776c966994c1bc558cba5799e12f3045227df/openai-1.59.8-py3-none-any.whl", hash = "sha256:a8b8ee35c4083b88e6da45406d883cf6bd91a98ab7dd79178b8bc24c8bfb09d9", size = 455567 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3315,16 +3326,16 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "virtualenv"
|
||||
version = "20.29.0"
|
||||
version = "20.29.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "distlib" },
|
||||
{ name = "filelock" },
|
||||
{ name = "platformdirs" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5a/5d/8d625ebddf9d31c301f85125b78002d4e4401fe1c15c04dca58a54a3056a/virtualenv-20.29.0.tar.gz", hash = "sha256:6345e1ff19d4b1296954cee076baaf58ff2a12a84a338c62b02eda39f20aa982", size = 7658081 }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a7/ca/f23dcb02e161a9bba141b1c08aa50e8da6ea25e6d780528f1d385a3efe25/virtualenv-20.29.1.tar.gz", hash = "sha256:b8b8970138d32fb606192cb97f6cd4bb644fa486be9308fb9b63f81091b5dc35", size = 7658028 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/d3/12687ab375bb0e077ea802a5128f7b45eb5de7a7c6cb576ccf9dd59ff80a/virtualenv-20.29.0-py3-none-any.whl", hash = "sha256:c12311863497992dc4b8644f8ea82d3b35bb7ef8ee82e6630d76d0197c39baf9", size = 4282443 },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/9b/599bcfc7064fbe5740919e78c5df18e5dceb0887e676256a1061bb5ae232/virtualenv-20.29.1-py3-none-any.whl", hash = "sha256:4e4cb403c0b0da39e13b46b1b2476e505cb0046b25f242bee80f62bf990b2779", size = 4282379 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
Reference in New Issue
Block a user