July 5, 2023
Chain LLM calls
We’ve introduced sessions to Humanloop, allowing you to link multiple calls together when building a chain or agent.
Using sessions with your LLM calls helps you troubleshoot and improve your chains and agents.
Adding a datapoint to a session
To log your LLM calls to a session, you just need to define a unique identifier for the session and pass it into your Humanloop calls with session_reference_id
.
For example, using uuid4()
to generate this ID,
Similarly, our other methods such as humanloop.complete_deployed()
, humanloop.chat()
, and humanloop.log()
etc. support session_reference_id
.
If you’re using our API directly, you can pass session_reference_id
within the request body in your POST /v4/completion
etc. endpoints.
Further details
For a more detailed walkthrough on how to use session_reference_id
, check out our guide that runs through how to record datapoints to a session in an example script.