您的位置:首页 > 汽车 > 新车 > 哔哩哔哩网页版怎么退出账号_中国临朐门户网站_链爱交易平台_网站链接分析工具

哔哩哔哩网页版怎么退出账号_中国临朐门户网站_链爱交易平台_网站链接分析工具

2024/9/23 11:09:33 来源:https://blog.csdn.net/suiusoar/article/details/142450658  浏览:    关键词:哔哩哔哩网页版怎么退出账号_中国临朐门户网站_链爱交易平台_网站链接分析工具
哔哩哔哩网页版怎么退出账号_中国临朐门户网站_链爱交易平台_网站链接分析工具

题意:OpenAI 聊天完成 API 的工具/函数属性格式是什么

问题背景:

Is there any clear documentation on the format of OpenAI's Chat Completion API tools/functions object format? I understand it's JSON, but there appear to be underlying requirements of what property names/types are allowed inside of the objects.

关于 OpenAI 的聊天完成 API 工具/函数对象格式是否有明确的文档?我知道它是 JSON 格式,但似乎对对象内部允许的属性名称/类型有一些基本要求

I tried figuring out what all property types OpenAI allowed in their tools/functions definition, but their documentation isn't great (they just have links to a simple example and an explanation of JSON schema 💩). They define description and name, but leave parameters pretty much open to interpretation.

我试图弄清楚 OpenAI 在其工具/函数定义中允许的所有属性类型,但他们的文档并不太好(他们只提供了简单示例的链接和 JSON schema 的解释 💩)。他们定义了 description 和 name,但对 parameters 的解释几乎完全开放,留给用户自行理解

Image of tools property definition

问题解决:

After an hour or two of searching around, experimenting, and cobbling something together, I think I finally created a template that I could reference in the future. Hopefully this saves someone else some time in the future.

经过一两个小时的搜索、实验和拼凑,我终于创建了一个可以作为未来参考的模板。希望这能为其他人节省一些时间

{"description": "This is a template that you can start from to build your tool","name": "new_tool","parameters": {"properties": {"array_property_name": {"description": "A property that returns an array of items (can be any type mentioned below, including an object)","items": {"type": "string"},"type": "array"},"boolean_property_name": {"description": "A property that returns a boolean","type": "boolean"},"enum_property_name": {"description": "A property that returns a value from a list of enums (can be any type)","enum": ["option 1","option 2","option 3"],"type": "string"},"number_property_name": {"description": "A property that returns a number","type": "number"},"object_property_name": {"description": "A property that returns an object","properties": {"foo": {"description": "A property on the object called 'foo' that returns a string","type": "string"},"bar": {"description": "A property on the object called 'bar' that returns a number","type": "number"}}},"string_property_name": {"description": "A property that returns a string","type": "string"}},"required": ["array_property_name","number_property_name"],"type": "object"}
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com