Support multiple functions per pluging
planned
Marc Bernard
Support multiple functions per plugin. This would avoid having to create/support a large number of plugins. It appears that OpenAI supports this (see https://openai.com/blog/function-calling-and-other-api-updates > Example in Step). But if you try to define an array for the function in TM, then you get an error.
N
Ngoc Nguyen
Merged in a post:
multiple functions in a plugin possible?
U
Unknown Entity
Every time i try to add more than one function into openai func spec field of a plugin, I get an error "OpenAI Function Spec must have a "name" property.". The spec is a list of elements which individually pass, but as soon as i have more than one and a top level array it fails. Either I am doing something wrong or it is not supported?
James Blackwell
Yeah, I just ran into this limitation myself. I was thinking that a temporary workaround for this is to specify a property that that instructs the called function which other functions should be called.
E.G.
async function menu(params, userSettings) {
const { action } = params;
switch(action) {
case "get":
fn_get(params, userSettings);
break;
case "put" : {
fn_put(params, userSettings);
break;
}
}
function fn_get(params, userSettings) {
}
function fn_put(params, userSettings) {
}
Tony Dinh
planned
N
Ngoc Nguyen
is this what you're looking for: https://twitter.com/TypingMindApp/status/1726688360796721330?
M
Marc Bernard
Ngoc Nguyen unfortunately no. In the definition of one plugin, i want to specify several JS functions (instead of creating a plugin for each function)
N
Ngoc Nguyen
Marc Bernard: oh i see. Thank you for clarifying 😊