TypeScript SDK

We now have a fully typed TypeScript SDK to make working with Humanloop even easier.

https://www.npmjs.com/package/humanloop

You can use this with your JavaScript, TypeScript or Node projects.

Installation

npm i humanloop

Example usage

import { Humanloop } from "humanloop"

const humanloop = new Humanloop({
  // Defining the base path is optional and defaults to https://api.humanloop.com/v3
  // basePath: "https://api.humanloop.com/v3",
  apiKey: 'API_KEY',
})


const chatResponse = await humanloop.chat({
  "project": "project_example",
  "messages": [
    {
      "role": "user",
      "content": "Write me a song",
    }
  ],
  "provider_api_keys": {
    "openai": OPENAI_API_KEY
  },
  "model_config": {
    "model": "gpt-4",
    "temperature": 1,
  },
})

console.log(chatResponse)