feat(experimental): FunctionsAgent, uses new function payload for tooling

This commit is contained in:
Daniel Avila 2023-06-13 23:39:22 -04:00 committed by Danny Avila
parent 550e566097
commit 3caddd6854
8 changed files with 227 additions and 52 deletions

View file

@ -39,8 +39,8 @@ router.post('/', requireJwtAuth, async (req, res) => {
if (endpoint !== 'gptPlugins') return handleError(res, { text: 'Illegal request' });
const agentOptions = req.body?.agentOptions ?? {
agent: 'classic',
model: 'gpt-3.5-turbo',
// model: 'gpt-4', // for agent model
temperature: 0,
// top_p: 1,
// presence_penalty: 0,
@ -60,20 +60,12 @@ router.post('/', requireJwtAuth, async (req, res) => {
presence_penalty: req.body?.presence_penalty ?? 0,
frequency_penalty: req.body?.frequency_penalty ?? 0
},
agentOptions
agentOptions: {
...agentOptions,
// agent: 'functions'
}
};
// const availableModels = getOpenAIModels();
// if (availableModels.find((model) => model === endpointOption.modelOptions.model) === undefined) {
// return handleError(res, { text: `Illegal request: model` });
// }
// console.log('ask log', {
// text,
// conversationId,
// endpointOption
// });
console.log('ask log');
console.dir({ text, conversationId, endpointOption }, { depth: null });