Skip to content

Commit ca926e7

Browse files
committed
fix: read env variables
1 parent 2afb11f commit ca926e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/api/models/bedrock.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,16 @@
5959
# This ensures the consumer and auth check happen at module load time
6060
try:
6161
_langfuse = Langfuse(
62+
public_key=os.environ.get("LANGFUSE_PUBLIC_KEY"),
63+
secret_key=os.environ.get("LANGFUSE_SECRET_KEY"),
64+
host=os.environ.get("LANGFUSE_HOST"),
6265
debug=DEBUG
6366
)
67+
# Configure the global langfuse_context to use our explicit client instance
68+
# This ensures @observe decorator and langfuse_context use the same client
69+
langfuse_context.configure(_langfuse)
6470
if DEBUG:
65-
logger.info("Langfuse client initialized successfully")
71+
logger.info("Langfuse client initialized and configured successfully")
6672
except Exception as e:
6773
logger.warning(f"Failed to initialize Langfuse client: {e}")
6874
_langfuse = None

0 commit comments

Comments
 (0)