Created
June 11, 2023 15:32
-
-
Save WhiteyDude/a0bb315fef6c9fa76268fe41ee634b1b to your computer and use it in GitHub Desktop.
Langchain example for oobabooga API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.env.OPENAI_API_BASE = 'http://127.0.0.1:5001/v1'; | |
const { OpenAI } = require("langchain/llms/openai"); | |
const model = new OpenAI( | |
{ | |
openAIApiKey: 'sk-dummy', | |
temperature: 0.9, | |
}, | |
{ | |
basePath: process.env.OPENAI_API_BASE | |
}); | |
model.call("What are the names of the planeteers from the TV show Captain Planet?") | |
.then( (res) => { | |
console.log(res); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note you need to load a model first.