-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for gpt-4-turbo #193
Comments
Potential solutionThe task requires adding support for a new model type, "gpt-4-turbo", to the existing How to implementTo implement the solution, you need to modify the const { OpenAI } = require('langchain/llms');
function getModel(modelType){
let model
if (['gpt-3.5-turbo', 'gpt-4', 'gpt-4-turbo'].includes(modelType)) {
model = new OpenAI({
modelName: modelType,
maxTokens: parseInt(process.env.OPENAI_MAX_TOKEN_REPLY),
temperature: parseFloat(process.env.MODEL_TEMPERATURE),
presencePenalty: parseFloat(process.env.MODEL_PRESENCE_PENALTY),
frequencyPenalty: parseFloat(process.env.MODEL_FREQUENCY_PENALTY),
user: process.env.MODEL_USER,
openAIApiKey: process.env.OPENAI_API_KEY,
})
} else {
throw new Error(`Model type: ${modelType} not supported.`)
}
return model
}
module.exports = { getModel } This updated function now includes "gpt-4-turbo" in the list of supported models and will create an instance of the OpenAI class with the correct model name when "gpt-4-turbo" is specified. No other changes are needed for this specific task. After updating the code, ensure to test the function with the new model type to verify that it works as expected. Click here to create a Pull Request with the proposed solution Files used for this task: Changes on modules/model.jsTo add support for "gpt-4-turbo" in the Updated
|
Background story explaining the current situation:
https://github.com/fjrdomingues/autopilot/blob/main/modules/model.js
Please add support for "gpt-4-turbo", as it costs less, and performs better.
Desired new situation:
Added support for "gpt-4-turbo"
Implementation details:
I am assuming, adding "gpt-4-turbo" to the if statement.
The text was updated successfully, but these errors were encountered: