Instrument your project to enable automatic tracing.
from traceai_portkey import PortkeyInstrumentorPortkeyInstrumentor().instrument(tracer_provider=tracer_provider)
5. Interact with Portkey
Interact with Portkey as you normally would. Our Instrumentor will automatically trace and send the telemetry data to our platform.
client = Portkey(virtual_key=os.environ["PORTKEY_VIRTUAL_KEY"])completion = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Write a 6-word story about a robot who discovers music."}])print(completion.choices[0].message.content)