Gentrace integrates with OpenAI Agents SDK using OpenInference instrumentation to automatically trace agent conversations, tool calls, and agent handoffs.
# Pass context in the system message or as part of the conversationcontext = {"user_preferences": "budget-friendly", "currency": "USD"}response = client.chat.completions.create( model="gpt-4", messages=[ { "role": "system", "content": f"{travel_agent['instructions']}\nContext: {context}" }, {"role": "user", "content": "Plan a trip to Paris"} ], tools=travel_agent["tools"],)