Set organization_id for posthog through event (#277)
This commit is contained in:
@@ -629,7 +629,9 @@ class ForgeAgent:
|
|||||||
)
|
)
|
||||||
prompt_template = "extract-action"
|
prompt_template = "extract-action"
|
||||||
if app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(
|
if app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(
|
||||||
"USE_CLAUDE3_SONNET", task.workflow_run_id or task.task_id
|
"USE_CLAUDE3_SONNET",
|
||||||
|
task.workflow_run_id or task.task_id,
|
||||||
|
properties={"organization_id": task.organization_id},
|
||||||
):
|
):
|
||||||
LOG.info("Using Claude3 Sonnet prompt template for action extraction")
|
LOG.info("Using Claude3 Sonnet prompt template for action extraction")
|
||||||
prompt_template = "extract-action-claude3-sonnet"
|
prompt_template = "extract-action-claude3-sonnet"
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ class BaseExperimentationProvider(ABC):
|
|||||||
result_map: dict[str, dict[str, bool]] = {}
|
result_map: dict[str, dict[str, bool]] = {}
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def is_feature_enabled(self, feature_name: str, distinct_id: str) -> bool:
|
def is_feature_enabled(self, feature_name: str, distinct_id: str, properties: dict | None = None) -> bool:
|
||||||
"""Check if a specific feature is enabled."""
|
"""Check if a specific feature is enabled."""
|
||||||
|
|
||||||
def is_feature_enabled_cached(self, feature_name: str, distinct_id: str) -> bool:
|
def is_feature_enabled_cached(self, feature_name: str, distinct_id: str, properties: dict | None = None) -> bool:
|
||||||
if feature_name not in self.result_map:
|
if feature_name not in self.result_map:
|
||||||
self.result_map[feature_name] = {}
|
self.result_map[feature_name] = {}
|
||||||
if distinct_id not in self.result_map[feature_name]:
|
if distinct_id not in self.result_map[feature_name]:
|
||||||
self.result_map[feature_name][distinct_id] = self.is_feature_enabled(feature_name, distinct_id)
|
self.result_map[feature_name][distinct_id] = self.is_feature_enabled(feature_name, distinct_id, properties)
|
||||||
return self.result_map[feature_name][distinct_id]
|
return self.result_map[feature_name][distinct_id]
|
||||||
|
|
||||||
|
|
||||||
class NoOpExperimentationProvider(BaseExperimentationProvider):
|
class NoOpExperimentationProvider(BaseExperimentationProvider):
|
||||||
def is_feature_enabled(self, feature_name: str, distinct_id: str) -> bool:
|
def is_feature_enabled(self, feature_name: str, distinct_id: str, properties: dict | None = None) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user