Environment
The environment feature allows you to specify which environment your traces are coming from. This is useful for separating traces from different environments in "development"
, "staging"
, or "production"
.
Configure Environment
You can configure the environment with the CONFIDENT_TRACE_ENVIRONMENT
environment variable.
export CONFIDENT_TRACE_ENVIRONMENT="staging"
Alternatively, you can set the environment directly in code:
Python
import openai
from deepeval.tracing import observe, trace_manager
trace_manager.configure(environment="production")
@observe()
def llm_app(query: str):
return openai.ChatCompletion.create(
model="gpt-4o",
messages=[
{"role": "user", "content": query}
]
).choices[0].message["content"]
llm_app("Write me a poem.")
The environment
can be either "production"
, "staging"
, or "development"
, and helps you identify where your traces are coming from.
Last updated on