Requirements
Env Variables
Initialize Logger
Initialize MaximGeminiClient
Make LLM Calls Using MaximGeminiClient
Maxim-specific Headers
The Gemini instrumentation supports additional headers via thehttp_options.headers parameter within the config dictionary to enhance trace metadata and organization. You can use the following headers:
x-maxim-trace-id: Associate LLM calls with a specific trace ID (UUID string). All calls with the same trace ID will be grouped together in a single trace.x-maxim-trace-tags: Add custom tags to traces as a JSON string containing key-value pairs. Useful for filtering and organizing traces.x-maxim-generation-name: Assign a custom name to a specific generation/LLM call within a trace (string).x-maxim-session-id: Associate traces with a specific session ID (string).
Example: Using HTTP Headers
Advanced Use-Cases
Function Calling Support
Define function tools
Make calls with function tools
Capture Multiple LLM Calls in One Trace
Initialize Maxim SDK and Gemini Clienttrace_id parameter will be added to the declared trace.
Capture Multi-Turn Conversations
Initialize Maxim SDK and Gemini Clientsession_id:
