Section 5 · Capture your first generation

A framework integration, a provider helper, or manual capture, and how your agent's model calls decide which one fits.

Estimated time: 2 min

How to capture a generation

You can capture a generation with manual capture, a framework integration, or a provider helper. In this journey, you capture your first generation manually. The other two are options to switch to afterwards, if one fits how your agent makes its model calls.

Manual capture

To instrument calls without a framework, use manual capture, where your own code captures the generation manually, starting it and setting its result.

Manual capture needs only the SDK and the credentials you set in the previous section, with no framework or provider client, so the same steps work whichever method fits your agent in the long run. The rest of this journey builds on that manually captured generation. In .NET, the sample uses the OpenAI provider helper instead, because the .NET page has no manual-capture sample.

Framework integration

If you use an agent framework, for example LangChain, LangGraph, or Google ADK, use a framework integration: install the corresponding framework package for automatic generation capture. Framework integrations capture generations automatically by attaching to your agent framework, so you don’t need to instrument each LLM call manually.

Note

Framework integrations are available for Python, TypeScript, Go, and Java (supported frameworks table).

Provider helper

A provider helper wraps your calls to an OpenAI, Anthropic, or Gemini client and captures generations from them automatically.

Caution

If a framework integration or a provider helper fits your agent, switch to it after you finish the journey, following the instructions for your language on your language page and in Instrument agents with framework integrations. Don’t install one in place of the manual sample. The rest of this section describes the values in that sample, and a framework integration maps the conversation ID from the framework context for you.

Three capture methods side by side: manual capture, used in this journey and needing only the SDK and your credentials; and, after the journey if one fits your agent, a framework integration when the supported frameworks table lists your framework for your language, or a provider helper when your agent calls an OpenAI, Anthropic, or Gemini client