@maximai/maxim-js-langchain
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

npm i @maximai/maxim-js-langchain

Weekly Downloads

218

Version

0.2.1

License

UNLICENSED

Unpacked Size

33.3 kB

Total Files

10

Last publish

Collaborators

  • suresh-mxm
  • madhu-maxim
  • dhwanilatmaxim
  • maxim-dev