NIUBOYI»Home › › › Chatgpt帮助文档 › 中文 | English
微信扫一扫 分享朋友圈

已有 1106 人浏览分享

[api设置]    OpenAI API: What Is Function Calling and How Do You Use It?

api设置 2024-6-6 16:47:581106 0
In API calls, you can describe functions and let the model intelligently choose to output a JSON object containing parameters in order to call one or more functions. The Chat Completions API does not call the function; instead, the model generates JSON that you can use to call the function in your code.

What's new in function calling V2?
OpenAI made three updates to function calling in the API:


  • "JSON mode" now allows the model to output a string that parses as valid JSON
  • The ability to call multiple functions from one message
  • Improved performance in matching required properties or schema (if provided)

What is JSON mode?
By setting response_format: { type: "json_object" } when calling gpt-3.5-turbo-1106 or newer, or gpt-4-1106-preview, these models will constrain their output to generate a string that can be parsed as valid JSON.
  • WeChat Official Account

  • Scan to Visit Mobile Site

QQ|NIUBOYI ( 京ICP备17025393号 )|网站地图

GMT+8, 2026-10-31 07:18 , Processed in 0.468882 second(s), 37 queries .

POWERED BY NIUBOYIAI! 主理人:NIUBOYIAI  点亮哥

Copyright © 2001-2020, NIUBOYI AI.