posthoganalytics 7.8.1__py3-none-any.whl → 7.8.2__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.
- posthoganalytics/ai/prompts.py +3 -3
- posthoganalytics/test/ai/test_prompts.py +4 -4
- posthoganalytics/version.py +1 -1
- {posthoganalytics-7.8.1.dist-info → posthoganalytics-7.8.2.dist-info}/METADATA +1 -1
- {posthoganalytics-7.8.1.dist-info → posthoganalytics-7.8.2.dist-info}/RECORD +8 -8
- {posthoganalytics-7.8.1.dist-info → posthoganalytics-7.8.2.dist-info}/WHEEL +0 -0
- {posthoganalytics-7.8.1.dist-info → posthoganalytics-7.8.2.dist-info}/licenses/LICENSE +0 -0
- {posthoganalytics-7.8.1.dist-info → posthoganalytics-7.8.2.dist-info}/top_level.txt +0 -0
posthoganalytics/ai/prompts.py
CHANGED
|
@@ -15,7 +15,7 @@ from posthoganalytics.utils import remove_trailing_slash
|
|
|
15
15
|
|
|
16
16
|
log = logging.getLogger("posthog")
|
|
17
17
|
|
|
18
|
-
APP_ENDPOINT = "https://
|
|
18
|
+
APP_ENDPOINT = "https://us.posthog.com"
|
|
19
19
|
DEFAULT_CACHE_TTL_SECONDS = 300 # 5 minutes
|
|
20
20
|
|
|
21
21
|
PromptVariables = Dict[str, Union[str, int, float, bool]]
|
|
@@ -50,11 +50,11 @@ class Prompts:
|
|
|
50
50
|
from posthoganalytics.ai.prompts import Prompts
|
|
51
51
|
|
|
52
52
|
# With PostHog client
|
|
53
|
-
posthog = Posthog('phc_xxx', host='https://
|
|
53
|
+
posthog = Posthog('phc_xxx', host='https://us.posthog.com', personal_api_key='phx_xxx')
|
|
54
54
|
prompts = Prompts(posthog)
|
|
55
55
|
|
|
56
56
|
# Or with direct options (no PostHog client needed)
|
|
57
|
-
prompts = Prompts(personal_api_key='phx_xxx', host='https://
|
|
57
|
+
prompts = Prompts(personal_api_key='phx_xxx', host='https://us.posthog.com')
|
|
58
58
|
|
|
59
59
|
# Fetch with caching and fallback
|
|
60
60
|
template = prompts.get('support-system-prompt', fallback='You are a helpful assistant.')
|
|
@@ -33,7 +33,7 @@ class TestPrompts(unittest.TestCase):
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
def create_mock_posthog(
|
|
36
|
-
self, personal_api_key="phx_test_key", host="https://
|
|
36
|
+
self, personal_api_key="phx_test_key", host="https://us.posthog.com"
|
|
37
37
|
):
|
|
38
38
|
"""Create a mock PostHog client."""
|
|
39
39
|
mock = MagicMock()
|
|
@@ -61,7 +61,7 @@ class TestPromptsGet(TestPrompts):
|
|
|
61
61
|
call_args = mock_get.call_args
|
|
62
62
|
self.assertEqual(
|
|
63
63
|
call_args[0][0],
|
|
64
|
-
"https://
|
|
64
|
+
"https://us.posthog.com/api/environments/@current/llm_prompts/name/test-prompt/",
|
|
65
65
|
)
|
|
66
66
|
self.assertIn("Authorization", call_args[1]["headers"])
|
|
67
67
|
self.assertEqual(
|
|
@@ -333,7 +333,7 @@ class TestPromptsGet(TestPrompts):
|
|
|
333
333
|
call_args = mock_get.call_args
|
|
334
334
|
self.assertEqual(
|
|
335
335
|
call_args[0][0],
|
|
336
|
-
"https://
|
|
336
|
+
"https://us.posthog.com/api/environments/@current/llm_prompts/name/prompt%20with%20spaces%2Fand%2Fslashes/",
|
|
337
337
|
)
|
|
338
338
|
|
|
339
339
|
@patch("posthog.ai.prompts._get_session")
|
|
@@ -350,7 +350,7 @@ class TestPromptsGet(TestPrompts):
|
|
|
350
350
|
call_args = mock_get.call_args
|
|
351
351
|
self.assertEqual(
|
|
352
352
|
call_args[0][0],
|
|
353
|
-
"https://
|
|
353
|
+
"https://us.posthog.com/api/environments/@current/llm_prompts/name/test-prompt/",
|
|
354
354
|
)
|
|
355
355
|
self.assertEqual(
|
|
356
356
|
call_args[1]["headers"]["Authorization"], "Bearer phx_direct_key"
|
posthoganalytics/version.py
CHANGED
|
@@ -12,9 +12,9 @@ posthoganalytics/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
12
12
|
posthoganalytics/request.py,sha256=sv5dVU4jg4nFI4BpGCGvyoiz6yZZBLMqoBjhmzoomYo,11844
|
|
13
13
|
posthoganalytics/types.py,sha256=OxGHSmmhVYwA7ecmJXUznDCZ1c4gAGtERzSLSYlyQFM,11540
|
|
14
14
|
posthoganalytics/utils.py,sha256=-0w-OLcCaoldkbBebPzQyBzLJSo9G9yBOg8NDVz7La8,16088
|
|
15
|
-
posthoganalytics/version.py,sha256=
|
|
15
|
+
posthoganalytics/version.py,sha256=VTcfPWbP5D4iI0vLP05VDW58OcsgbbFSpvyu8z-LZq0,87
|
|
16
16
|
posthoganalytics/ai/__init__.py,sha256=Aj7D5QzrxqqrYXJHizNWe6YtYmI80N-EEZDOUzwOF3Q,71
|
|
17
|
-
posthoganalytics/ai/prompts.py,sha256=
|
|
17
|
+
posthoganalytics/ai/prompts.py,sha256=Q-tGfIgd3l0LoWX5HfujggnnfEMYekpZW_Swa16KCHQ,8459
|
|
18
18
|
posthoganalytics/ai/sanitization.py,sha256=Dpx_5gKZfDS38KjmK1C0lvvjm9N8Pp_oIxusac888-g,6057
|
|
19
19
|
posthoganalytics/ai/types.py,sha256=65sj_ZFUx75FiLM4ESdRPyZhrT6rO_gqJ2-zfcUot40,3356
|
|
20
20
|
posthoganalytics/ai/utils.py,sha256=f-vzFLuUDNkKqxfp82PvlhoLaEWBLYTGSlmR63yveC4,25991
|
|
@@ -54,13 +54,13 @@ posthoganalytics/test/test_size_limited_dict.py,sha256=-5IQjIEr_-Dql24M0HusdR_Xr
|
|
|
54
54
|
posthoganalytics/test/test_types.py,sha256=bRPHdwVpP7hu7emsplU8UVyzSQptv6PaG5lAoOD_BtM,7595
|
|
55
55
|
posthoganalytics/test/test_utils.py,sha256=MTz7-Fvffz2a9IRwyKsVy_TnrvIihs-Ap3hhtqGSSAs,9732
|
|
56
56
|
posthoganalytics/test/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
|
-
posthoganalytics/test/ai/test_prompts.py,sha256=
|
|
57
|
+
posthoganalytics/test/ai/test_prompts.py,sha256=mOOjMF6EMuQfWd7KLeUiujDQGHyb48PlGDsATYADOaA,21052
|
|
58
58
|
posthoganalytics/test/ai/test_sanitization.py,sha256=Om1f22Z0q5Y4VSaDwPHgW3IYUZPoMj05ZYcTeCmOBlE,18155
|
|
59
59
|
posthoganalytics/test/ai/test_system_prompts.py,sha256=1IQVvcs-YMxPxXOmkbNCFOhvu_NIx4eAanz1XT-QJ3Y,14371
|
|
60
60
|
posthoganalytics/test/ai/openai_agents/__init__.py,sha256=VGLVcRkGkmj0d4MhjcwQ5IYxoaaMPlw0oR7eXSCcGXI,42
|
|
61
61
|
posthoganalytics/test/ai/openai_agents/test_processor.py,sha256=p65z82yiVjMQUR5coaBMMhzV6xB1CezzsvQD1GIi4o0,30800
|
|
62
|
-
posthoganalytics-7.8.
|
|
63
|
-
posthoganalytics-7.8.
|
|
64
|
-
posthoganalytics-7.8.
|
|
65
|
-
posthoganalytics-7.8.
|
|
66
|
-
posthoganalytics-7.8.
|
|
62
|
+
posthoganalytics-7.8.2.dist-info/licenses/LICENSE,sha256=wGf9JBotDkSygFj43m49oiKlFnpMnn97keiZKF-40vE,2450
|
|
63
|
+
posthoganalytics-7.8.2.dist-info/METADATA,sha256=mEaCZB0Toj4j2ZGLl9kulDpzNyKU2Z0bbtLckxcYmM4,6368
|
|
64
|
+
posthoganalytics-7.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
65
|
+
posthoganalytics-7.8.2.dist-info/top_level.txt,sha256=8QsNIqIkBh1p2TXvKp0Em9ZLZKwe3uIqCETyW4s1GOE,17
|
|
66
|
+
posthoganalytics-7.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|