posthoganalytics 6.9.2__py3-none-any.whl → 6.9.3__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.
@@ -79,6 +79,8 @@ class GenerationMetadata(SpanMetadata):
79
79
  """Base URL of the provider's API used in the run."""
80
80
  tools: Optional[List[Dict[str, Any]]] = None
81
81
  """Tools provided to the model."""
82
+ posthog_properties: Optional[Dict[str, Any]] = None
83
+ """PostHog properties of the run."""
82
84
 
83
85
 
84
86
  RunMetadata = Union[SpanMetadata, GenerationMetadata]
@@ -420,6 +422,8 @@ class CallbackHandler(BaseCallbackHandler):
420
422
  generation.model = model
421
423
  if provider := metadata.get("ls_provider"):
422
424
  generation.provider = provider
425
+
426
+ generation.posthog_properties = metadata.get("posthog_properties")
423
427
  try:
424
428
  base_url = serialized["kwargs"]["openai_api_base"]
425
429
  if base_url is not None:
@@ -566,6 +570,9 @@ class CallbackHandler(BaseCallbackHandler):
566
570
  "$ai_framework": "langchain",
567
571
  }
568
572
 
573
+ if isinstance(run.posthog_properties, dict):
574
+ event_properties.update(run.posthog_properties)
575
+
569
576
  if run.tools:
570
577
  event_properties["$ai_tools"] = run.tools
571
578
 
@@ -1,4 +1,4 @@
1
- VERSION = "6.9.2"
1
+ VERSION = "6.9.3"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  print(VERSION, end="") # noqa: T201
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: posthoganalytics
3
- Version: 6.9.2
3
+ Version: 6.9.3
4
4
  Summary: Integrate PostHog into any python application.
5
5
  Home-page: https://github.com/posthog/posthog-python
6
6
  Author: Posthog
@@ -11,7 +11,7 @@ posthoganalytics/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  posthoganalytics/request.py,sha256=Bsl2c5WwONKPQzwWMmKPX5VgOlwSiIcSNfhXgoz62Y8,6186
12
12
  posthoganalytics/types.py,sha256=Dl3aFGX9XUR0wMmK12r2s5Hjan9jL4HpQ9GHpVcEq5U,10207
13
13
  posthoganalytics/utils.py,sha256=-0w-OLcCaoldkbBebPzQyBzLJSo9G9yBOg8NDVz7La8,16088
14
- posthoganalytics/version.py,sha256=zvqnhz0fFaGVjl6Hb6DGlJacDLQ1AwGr9KdJwg82zOA,87
14
+ posthoganalytics/version.py,sha256=5rEsdm1qsSDo24xnSDirThtR5UCUG8ArSvCHK4-Nk3c,87
15
15
  posthoganalytics/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  posthoganalytics/ai/sanitization.py,sha256=owipZ4eJYtd4JTI-CM_klatclXaeaIec3XJBOUfsOnQ,5770
17
17
  posthoganalytics/ai/types.py,sha256=arX98hR1PIPeJ3vFikxTlACIh1xPp6aEUw1gBLcKoB0,3273
@@ -25,7 +25,7 @@ posthoganalytics/ai/gemini/__init__.py,sha256=JV_9-gBR87leHgZW4XAYZP7LSl4YaXeuhq
25
25
  posthoganalytics/ai/gemini/gemini.py,sha256=A2acjT_m8ru2YwgIk15aN21CRVEl2jh8pbqjmHplMC8,15035
26
26
  posthoganalytics/ai/gemini/gemini_converter.py,sha256=lfd-AqBYdM3_OJtuvkFb9AlSba1gQt4K5TpKqzXykdk,18749
27
27
  posthoganalytics/ai/langchain/__init__.py,sha256=9CqAwLynTGj3ASAR80C3PmdTdrYGmu99tz0JL-HPFgI,70
28
- posthoganalytics/ai/langchain/callbacks.py,sha256=5PQHBt9ddp_HBF3lPpW119mCMEGuuL5Be3p-uBsxDRk,31102
28
+ posthoganalytics/ai/langchain/callbacks.py,sha256=Mzqmb9kC6v-ZAy5KkguIgfs-2xzQqYE2YJsVmBnH_3M,31393
29
29
  posthoganalytics/ai/openai/__init__.py,sha256=u4OuUT7k1NgFj0TrxjuyegOg7a_UA8nAU6a-Hszr0OM,490
30
30
  posthoganalytics/ai/openai/openai.py,sha256=I05NruE9grWezM_EgOZBiG5Ej_gABsDcYKN0pRQWvzU,20235
31
31
  posthoganalytics/ai/openai/openai_async.py,sha256=mIxFZykDgMi3ws_fNWikEhwvkZmKqfYgeeB2yhxlZjQ,22490
@@ -47,8 +47,8 @@ posthoganalytics/test/test_request.py,sha256=Zc0VbkjpVmj8mKokQm9rzdgTr0b1U44vvMY
47
47
  posthoganalytics/test/test_size_limited_dict.py,sha256=-5IQjIEr_-Dql24M0HusdR_XroOMrtgiT0v6ZQCRvzo,774
48
48
  posthoganalytics/test/test_types.py,sha256=bRPHdwVpP7hu7emsplU8UVyzSQptv6PaG5lAoOD_BtM,7595
49
49
  posthoganalytics/test/test_utils.py,sha256=sqUTbfweVcxxFRd3WDMFXqPMyU6DvzOBeAOc68Py9aw,9620
50
- posthoganalytics-6.9.2.dist-info/licenses/LICENSE,sha256=wGf9JBotDkSygFj43m49oiKlFnpMnn97keiZKF-40vE,2450
51
- posthoganalytics-6.9.2.dist-info/METADATA,sha256=J98kRSXrzBD4ISmrdueN7DWccefvIZaqnYAtlZhyG1c,6024
52
- posthoganalytics-6.9.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
- posthoganalytics-6.9.2.dist-info/top_level.txt,sha256=8QsNIqIkBh1p2TXvKp0Em9ZLZKwe3uIqCETyW4s1GOE,17
54
- posthoganalytics-6.9.2.dist-info/RECORD,,
50
+ posthoganalytics-6.9.3.dist-info/licenses/LICENSE,sha256=wGf9JBotDkSygFj43m49oiKlFnpMnn97keiZKF-40vE,2450
51
+ posthoganalytics-6.9.3.dist-info/METADATA,sha256=CUD6Yt6SFR-tuLWgpPrb0N9kAkdWg7-7sCIO5U9aWAY,6024
52
+ posthoganalytics-6.9.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
+ posthoganalytics-6.9.3.dist-info/top_level.txt,sha256=8QsNIqIkBh1p2TXvKp0Em9ZLZKwe3uIqCETyW4s1GOE,17
54
+ posthoganalytics-6.9.3.dist-info/RECORD,,