Skip to content

Commit

Permalink
Add functionSignatures.json
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ccreutzi committed May 21, 2024
1 parent 1365049 commit 3d8794d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions functionSignatures.json
Original file line number Diff line number Diff line change
@@ -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"}
]
}
}

0 comments on commit 3d8794d

Please sign in to comment.