From 3d8794d0d5275d40b863ff91a238dd53ad9f3625 Mon Sep 17 00:00:00 2001 From: Christopher Creutzig Date: Tue, 21 May 2024 09:47:51 +0100 Subject: [PATCH] Add functionSignatures.json Cf. https://www.mathworks.com/help/matlab/matlab_prog/customize-code-suggestions-and-completions.html for details about the file format. JSON unfortunately does not allow comments. Some of the "type" definitions in the file do not match accepted values exactly: I have not listed that several name value pairs accept empties, and have not found a good way to say that StopSequences can have at most four entries. Nothing in here removes the existing input validations. --- functionSignatures.json | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 functionSignatures.json diff --git a/functionSignatures.json b/functionSignatures.json new file mode 100644 index 0000000..a786406 --- /dev/null +++ b/functionSignatures.json @@ -0,0 +1,43 @@ +{ + "_schemaVersion": "1.0.0", + "openAIChat.openAIChat": + { + "inputs": + [ + {"name":"systemPrompt","kind":"ordered","type":["string","scalar"]}, + {"name":"Tools","kind":"namevalue","type":"openAIFunction"}, + {"name":"ModelName","kind":"namevalue","type":"choices=llms.openai.models"}, + {"name":"Temperature","kind":"namevalue","type":["numeric","scalar",">=0","<=2"]}, + {"name":"TopProbabilityMass","kind":"namevalue","type":["numeric","scalar",">=0","<=1"]}, + {"name":"StopSequences","kind":"namevalue","type":["string","vector"]}, + {"name":"ResponseFormat","kind":"namevalue","type":"choices={'text','json'}"}, + {"name":"ApiKey","kind":"namevalue","type":["string","scalar"]}, + {"name":"PresencePenalty","kind":"namevalue","type":["numeric","scalar","<=2",">=-2"]}, + {"name":"FrequencyPenalty","kind":"namevalue","type":["numeric","scalar","<=2",">=-2"]}, + {"name":"TimeOut","kind":"namevalue","type":["numeric","scalar","real","positive"]}, + {"name":"StreamFun","kind":"namevalue","type":"function_handle"} + ], + "outputs": + [ + {"name":"this","type":"openAIChat"} + ] + }, + "openAIChat.generate": + { + "inputs": + [ + {"name":"this","kind":"required","type":["openAIChat","scalar"]}, + {"name":"messages","kind":"required","type":[["openAIMessages","row"],["string","scalar"]]}, + {"name":"NumCompletions","kind":"namevalue","type":["numeric","scalar","integer","positive"]}, + {"name":"MaxNumTokens","kind":"namevalue","type":["numeric","scalar","positive"]}, + {"name":"ToolChoice","kind":"namevalue","type":"choices=[\"none\",\"auto\",this.FunctionNames]"}, + {"name":"Seed","kind":"namevalue","type":["numeric","integer","scalar"]} + ], + "outputs": + [ + {"name":"text","type":"string"}, + {"name":"message","type":"struct"}, + {"name":"response","type":"matlab.net.http.ResponseMessage"} + ] + } +}