Documentation Index
Fetch the complete documentation index at: https://arizeai-433a7140-update-phoenix-arize-phoenix-evals-3-1-0.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Instrument LLM applications that use the Guardrails AI framework
Documentation Index
Fetch the complete documentation index at: https://arizeai-433a7140-update-phoenix-arize-phoenix-evals-3-1-0.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
pip install openinference-instrumentation-guardrails guardrails-ai
from phoenix.otel import register
# configure the Phoenix tracer
tracer_provider = register(
project_name="my-llm-app", # Default is 'default'
auto_instrument=True # Auto-instrument your app based on installed OI dependencies
)
from guardrails import Guard
from guardrails.hub import TwoWords
import openai
guard = Guard().use(
TwoWords(),
)
response = guard(
llm_api=openai.chat.completions.create,
prompt="What is another name for America?",
model="gpt-3.5-turbo",
max_tokens=1024,
)
print(response)
Was this page helpful?