Galileo allows you to integrate with your Langchain application natively through callbacks
langchain
. To log these chains, we require using the callback from our Python client promptquality
.
For logging your data, first login:
GalileoPromptCallback
:
run
, invoke
or batch
), just include the callback instance created earlier in the callbacks as:
If using .run()
:
.invoke()
:
.batch()
:
finish
step uploads the run to Galileo and starts the execution of the scorers server-side. This step will also display the link you can use to interact with the run on the Galileo console.
A full example can be found here.
Note 1: Please make sure to set the callback at execution time, not at definition time so that the callback is invoked for all nodes of the chain.
Note 2: We recommend using .invoke
instead of .batch
because langchain
reports latencies for the entire batch instead of each individual chain execution.