@maximai/maxim-js-langchain
v0.2.1
Published
This is the langchain wrapper built for (Maxim JS SDK)[https://www.npmjs.com/package/@maximai/maxim-js].
Downloads
6
Readme
Maxim SDK : Langchain wrapper
This is the langchain wrapper built for Maxim JS SDK.
Simplifies integrating Maxim logger with langchain
Install
npm install @maximai/maxim-js-langchain
Initialize Maxim logger
const maxim = new Maxim({apiKey: "maxim-api-key"});
const logger = await maxim.logger({ id: "log-repository-id" });
Start logging
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);
Version changelog
0.2.1
- Improvement: easy logging of retrieval and generation
0.1.1
- Breaking: Dropping support for Langchain versions below 0.3.x
0.0.4
- Improvement: Changed pining for core Maxim SDK
0.0.3
- Fix: Token usage were not getting captured for streaming responses
0.0.2
- Fix: Adds empty tags as {}
0.0.1
- Early preview