beamlit 0.0.34rc74__py3-none-any.whl → 0.0.34rc75__py3-none-any.whl

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.
@@ -1,4 +1,5 @@
1
1
  from .chat import get_chat_model
2
2
  from .decorator import agent
3
+ from .thread import get_default_thread
3
4
 
4
- __all__ = ["agent", "get_chat_model"]
5
+ __all__ = ["agent", "get_chat_model", "get_default_thread"]
@@ -0,0 +1,14 @@
1
+
2
+ import jwt
3
+ from fastapi import Request
4
+
5
+
6
+ def get_default_thread(request: Request) -> str:
7
+ if request.headers.get("X-Beamlit-Sub"):
8
+ return request.headers.get("X-Beamlit-Sub")
9
+ authorization = request.headers.get("Authorization", request.headers.get("X-Beamlit-Authorization"))
10
+ if authorization and len(authorization.split("Bearer ")) > 1:
11
+ token = authorization.split(" ")[1]
12
+ decoded = jwt.decode(token, options={"verify_signature": False})
13
+ return decoded["sub"]
14
+ return ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.34rc74
3
+ Version: 0.0.34rc75
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -21,6 +21,7 @@ Requires-Dist: opentelemetry-instrumentation-system-metrics>=0.50b0
21
21
  Requires-Dist: opentelemetry-sdk>=1.28.2
22
22
  Requires-Dist: pydantic-settings<2.7.0,>=2.6.1
23
23
  Requires-Dist: pydantic<2.11.0,>=2.10.3
24
+ Requires-Dist: pyjwt>=2.10.1
24
25
  Requires-Dist: python-dateutil>=2.8.0
25
26
  Requires-Dist: pyyaml<6.1.0,>=6.0.2
26
27
  Requires-Dist: requests<2.33.0,>=2.32.3
@@ -4,10 +4,11 @@ beamlit/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
4
4
  beamlit/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
5
5
  beamlit/run.py,sha256=HtDYDjD7oVfQ8r3T5_t4qN5UDJOJfsQILi45Z21ArAg,1446
6
6
  beamlit/types.py,sha256=E1hhDh_zXfsSQ0NCt9-uw90_Mr5iIlsdfnfvxv5HarU,1005
7
- beamlit/agents/__init__.py,sha256=nf1iwQwGtCG6nDqyVhxfWoqR6dv6X3bvSpCeqkTCFaM,101
7
+ beamlit/agents/__init__.py,sha256=4aXI1Sp8NuKJ8yVw9qUFRmFhSrWdT5b0bniqRKzZ42U,162
8
8
  beamlit/agents/chain.py,sha256=vfCjiFHuu02uTTGicxMlFzjyICQkIjpXrBGs-7uJEsg,2826
9
9
  beamlit/agents/chat.py,sha256=6PE2f_tf6l4_-9mZ---ZHvxN52pmLkHkgh1ebPoG1BY,4052
10
10
  beamlit/agents/decorator.py,sha256=_N5uYircuULo2EZ1B0vaD1Rsc64534DtojmUVAJGUAw,5921
11
+ beamlit/agents/thread.py,sha256=LN5Ss-uOf5_hdB0WV1dqpn-N-pDJB3C2hUvlCzdqtdk,519
11
12
  beamlit/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
12
13
  beamlit/api/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
14
  beamlit/api/agents/create_agent.py,sha256=t5Pr62My2EhQlcIY71MrI73-0_q5Djr3a_Ybt9MIiQQ,3587
@@ -283,6 +284,6 @@ beamlit/serve/app.py,sha256=_aG2UVQ3Y85rUW3ehu9TlzLnowkfh54IIz558ftqOMw,3638
283
284
  beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
284
285
  beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
285
286
  beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
286
- beamlit-0.0.34rc74.dist-info/METADATA,sha256=283OC-AAVYiQst3ETIK3niMuOA7ncD77obgO5bR7auo,2412
287
- beamlit-0.0.34rc74.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
288
- beamlit-0.0.34rc74.dist-info/RECORD,,
287
+ beamlit-0.0.34rc75.dist-info/METADATA,sha256=4i1Oh10zy9z1KQHO2ShsMjv7XherVXJaKqIRgNJDp8w,2441
288
+ beamlit-0.0.34rc75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
289
+ beamlit-0.0.34rc75.dist-info/RECORD,,