gyliu513 / langX101

Apache License 2.0
6 stars 4 forks source link

test code for traceloop #183

Open gyliu513 opened 4 months ago

gyliu513 commented 4 months ago
--- a/packages/sample-app/sample_app/langchain_app.py
+++ b/packages/sample-app/sample_app/langchain_app.py
@@ -1,11 +1,16 @@
+from dotenv import load_dotenv
+load_dotenv()
+
 from langchain.schema import SystemMessage, HumanMessage
 from langchain.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
 from langchain_community.chat_models import ChatOpenAI
 from langchain.chains import LLMChain, SequentialChain, TransformChain

 from traceloop.sdk import Traceloop
+import os
+os.environ['OTEL_EXPORTER_OTLP_INSECURE'] = 'True'

-Traceloop.init(app_name="langchain_example")
+Traceloop.init(app_name="langchain_example_0528", disable_batch=True)