This is the langchain wrapper built for Maxim JS SDK.
npm install @maximai/maxim-js-langchain
const maxim = new Maxim({apiKey: "maxim-api-key"});
const logger = await maxim.logger({ id: "log-repository-id" });
const maximTracer = new MaximLangchainTracer(logger);
const llm = new ChatOpenAI({
openAIApiKey: openAIKey,
modelName: "gpt-4o",
temperature: 0,
callbacks: [maximTracer],
metadata: {
maxim: { // optional: add metadata to the generation
generationName: "maths-gen",
generationTags: { tag: "test" }
}
}
});
const query = "What's the sum of 3 and 2?";
const result = await llm.invoke(query);
- Improvement: easy logging of retrieval and generation
- Breaking: Dropping support for Langchain versions below 0.3.x
- Improvement: Changed pining for core Maxim SDK
- Fix: Token usage were not getting captured for streaming responses
- Fix: Adds empty tags as {}
- Early preview