-
-
Save PaulDuvall/14e850afe59630f3ab83160b23aa8a8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from langfuse import Langfuse # Make sure to install the Langfuse Python SDK | |
| from credentials import get_credentials | |
| def main() -> None: | |
| """ | |
| Main function to perform financial analysis based on FRED data. | |
| """ | |
| secret_key, public_key, host = get_credentials() | |
| if not all([secret_key, public_key, host]): | |
| raise ValueError( | |
| "Langfuse credentials not found. Please ensure LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY, " | |
| "and LANGFUSE_HOST are set in environment variables or stored in AWS Parameter Store." | |
| ) | |
| langfuse = Langfuse( | |
| secret_key=secret_key, | |
| public_key=public_key, | |
| host=host | |
| ) | |
| # Start a new trace | |
| trace = langfuse.trace(name="FinancialAnalysisTrace") | |
| trace.update(metadata={ | |
| "system": "Financial Analysis System", | |
| "workflow": "FRED Data Analysis with LLM", | |
| "environment": "production", | |
| "version": "1.0.0", | |
| "model": "OpenAI GPT-4" | |
| }) | |
| # Additional workflow logic goes here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment