zlacker

[parent] [thread] 4 comments
1. minima+(OP)[view] [source] 2023-12-27 16:48:30
For posterity, this is the "JSON mode" mentioned at the bottom of the post.

The docs say it's on by default if you use function calling normally: https://platform.openai.com/docs/guides/text-generation/json...

> Note that JSON mode is always enabled when the model is generating arguments as part of function calling.

replies(1): >>JoshMa+N1
2. JoshMa+N1[view] [source] 2023-12-27 16:58:47
>>minima+(OP)
Yes -- the distinction with "function calling" is that you have to play a game of telephone where you describe your target schema in JSON Schema (only, apparently, for OpenAI to turn into a typescript interface internally) vs describing it more directly and succinctly (and with opportunities to include inline comments, order fields ordered however you want, and use advanced TS features... or even use an adhoc schema "language").
replies(2): >>msp26+l5 >>o_____+K71
◧◩
3. msp26+l5[view] [source] [discussion] 2023-12-27 17:20:15
>>JoshMa+N1
Yeah I was using hacky workarounds like this to get Object[] types in my schema. The API seemed to throw a fit if I did this in any other way.

``` {"type": "array", "items": {"type": "object", "properties": {"object": {"type": "object"}}}} ```

Somehow the thought to just write the typescript myself never occurred haha.

◧◩
4. o_____+K71[view] [source] [discussion] 2023-12-27 23:24:13
>>JoshMa+N1
fwiw JSON Schema allows for $comment fields, which seem effective in OAPI function calls.

https://json-schema.org/understanding-json-schema/reference/...

replies(1): >>lukasb+SB1
◧◩◪
5. lukasb+SB1[view] [source] [discussion] 2023-12-28 04:16:01
>>o_____+K71
What do you use $comment for that doesn't work in "description"?
[go to top]