from guardrails import Guardfrom guardrails.hub import TwoWordsimport openaiguard = 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)
Now that you have tracing setup, all invocations of underlying models used by Guardrails (completions, chat completions, embeddings) will be streamed to your running Phoenix for observability and evaluation. Additionally, Guards will be present as a new span kind in Phoenix.