Chris4K commited on
Commit
19a7a7d
·
verified ·
1 Parent(s): d654fbf

Update services/strategy.py

Browse files
Files changed (1) hide show
  1. services/strategy.py +15 -0
services/strategy.py CHANGED
@@ -3,6 +3,21 @@
3
  from abc import ABC, abstractmethod
4
  from typing import List, Tuple
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  @observe()
7
  class GenerationStrategy(ABC):
8
  """Base class for generation strategies."""
 
3
  from abc import ABC, abstractmethod
4
  from typing import List, Tuple
5
 
6
+
7
+
8
+ from langfuse.decorators import observe, langfuse_context
9
+ import os
10
+
11
+ # Initialize Langfuse
12
+ os.environ["LANGFUSE_PUBLIC_KEY"] = "pk-lf-04d2302a-aa5c-4870-9703-58ab64c3bcae"
13
+ os.environ["LANGFUSE_SECRET_KEY"] = "sk-lf-d34ea200-feec-428e-a621-784fce93a5af"
14
+ os.environ["LANGFUSE_HOST"] = "https://chris4k-langfuse-template-space.hf.space" # 🇪🇺 EU region
15
+
16
+ try:
17
+ langfuse = Langfuse()
18
+ except Exception as e:
19
+ print("Langfuse Offline")
20
+
21
  @observe()
22
  class GenerationStrategy(ABC):
23
  """Base class for generation strategies."""