You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the function schema passed to OpenAI APIs and other AI interfaces for getWorkspaceDirectoryStructure does not contain a parameter field. According to standard practice, all function calls by the language models must include a argument object which could contain no argument fields if the arguments are empty. However, it's still necessary to provide the correct parameter object schema in the tool calling request in order to trigger the correct generation behavior in LLMs. E.g. if the parameter field doesn't exist, many models won't be able to generate correct arguments and lead to a chain of problems.
Examples in Theia
Right now the schema for getWorkspaceDirectoryStructure is
{
"type": "function",
"function": {
"name": "getWorkspaceDirectoryStructure",
"description": "Retrieve the complete directory structure of the workspace, listing only directories (no file contents). This structure excludes specific directories,\n such as node_modules and hidden files, ensuring paths are within workspace boundaries."
}
}
This should be amended to something like
{
"type": "function",
"function": {
"name": "getWorkspaceDirectoryStructure",
"description": "Retrieve the complete directory structure of the workspace, listing only directories (no file contents). This structure excludes specific directories,\n such as node_modules and hidden files, ensuring paths are within workspace boundaries."
},
"parameters": {
"type": "object",
"properties": {}
}
}
A few notes on tool calling templates in Theia
Another problem worth noting is the inclusion of predefined function calls in chat templates. Currently it's impossible to control the exact description of each function in the prompt, and you must include the variables for them to be added to the call. This is quite inflexible, in the case for example when the user wants to provide custom introductions/usage prompts to these functions.
The text was updated successfully, but these errors were encountered:
Handling of functions with no parameters in Theia
Right now the function schema passed to OpenAI APIs and other AI interfaces for
getWorkspaceDirectoryStructure
does not contain aparameter
field. According to standard practice, all function calls by the language models must include a argument object which could contain no argument fields if the arguments are empty. However, it's still necessary to provide the correct parameter object schema in the tool calling request in order to trigger the correct generation behavior in LLMs. E.g. if theparameter
field doesn't exist, many models won't be able to generate correct arguments and lead to a chain of problems.Examples in Theia
Right now the schema for
getWorkspaceDirectoryStructure
isThis should be amended to something like
A few notes on tool calling templates in Theia
Another problem worth noting is the inclusion of predefined function calls in chat templates. Currently it's impossible to control the exact description of each function in the prompt, and you must include the variables for them to be added to the call. This is quite inflexible, in the case for example when the user wants to provide custom introductions/usage prompts to these functions.
The text was updated successfully, but these errors were encountered: