Yes, please do share some more specifics of how you’re trying to use it and what you’re running into. While we do not yet have LangChain.js examples, we are happy to support your use case and you do have a couple options to build this.
Since the Cloud API is backward-compatible with conventions of OpenAI API, you could use that LangChain integration with a customBaseURL.
Try this code (thanks to @jorge.piedrahita):
import { ChatOpenAI } from "@langchain/openai";
const SambaNovaCloudBaseURL = "https://api.sambanova.ai/v1";
const apiKey = "*******************";
const SambaNovaCloudChatModel = new ChatOpenAI({
temperature: 0.9,
model: "Meta-Llama-3.1-70B-Instruct",
configuration: {
baseURL: SambaNovaCloudBaseURL,
apiKey: apiKey,
},
});
const response = await SambaNovaCloudChatModel.invoke("Hi there, tell me a joke!");
console.log(response.content);
Please message us if you run into any issues!