0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/ee/hogai/trends/test/test_prompt.py

23 lines
726 B
Python
Raw Normal View History

from langchain_core.prompts import ChatPromptTemplate
from ee.hogai.trends.prompts import REACT_SYSTEM_PROMPT
from posthog.test.base import BaseTest
class TestTrendsPrompts(BaseTest):
def test_planner_prompt_has_groups(self):
prompt = ChatPromptTemplate.from_messages(
[
("system", REACT_SYSTEM_PROMPT),
],
template_format="mustache",
).format(
groups=["org", "account"],
react_format="",
react_format_reminder="",
)
self.assertIn("unique orgs", prompt)
self.assertIn("unique accounts", prompt)
self.assertIn("orgs, accounts,", prompt)
self.assertIn("org, account.", prompt)