-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add check before setting up LangSmithTracer #2771
Conversation
Refactor the LangSmithTracer class in langsmith.py to improve error handling during initialization. The setup_langsmith method now checks for the presence of the LANGCHAIN_API_KEY environment variable before proceeding with the setup. This ensures that the tracer is only initialized when the necessary API key is available. Additionally, the order of operations within the __init__ method has been adjusted to ensure that the setup_langsmith method is called after the necessary attributes are assigned. These changes enhance the reliability and robustness of the LangSmithTracer.
Pull Request Validation ReportThis comment is automatically generated by Conventional PR Whitelist Report
Result Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated. Validation Report
Result Pull request satisfies all enabled pull request rules. Last Modified at 17 Jul 24 20:15 UTC |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
… tracer is not ready
* fix: add check before setting up LangSmithTracer Refactor the LangSmithTracer class in langsmith.py to improve error handling during initialization. The setup_langsmith method now checks for the presence of the LANGCHAIN_API_KEY environment variable before proceeding with the setup. This ensures that the tracer is only initialized when the necessary API key is available. Additionally, the order of operations within the __init__ method has been adjusted to ensure that the setup_langsmith method is called after the necessary attributes are assigned. These changes enhance the reliability and robustness of the LangSmithTracer. * fix(langsmith.py): add conditional check to prevent executing code if tracer is not ready --------- Co-authored-by: Lucas Oliveira <[email protected]> (cherry picked from commit 31a3c49)
Refactor the LangSmithTracer class in langsmith.py to improve error handling during initialization. The setup_langsmith method now checks for the presence of the LANGCHAIN_API_KEY environment variable before proceeding with the setup. This ensures that the tracer is only initialized when the necessary API key is available. Additionally, the order of operations within the init method has been adjusted to ensure that the setup_langsmith method is called after the necessary attributes are assigned. These changes enhance the reliability and robustness of the LangSmithTracer.