Non-supported models
If you're not using LangChain or OpenAI, you can still integrate Lunary with your own LLMs.
Method 1: wrapModel
In addition to the lunary.wrapAgent
& lunary.wrapTool
methods, we provide a wrapModel
method.
It allows to wrap any async function. It also takes the following options:
Method 2: .trackEvent
If you don't want to wrap your model, you can also use the lunary.trackEvent
method.
First, track the start of your query:
Run your model:
Then, track the result of your query:
Note
Input & output can be any object or array of object, however we recommend using the ChatMessage format: