其他资讯
综合资讯
Gemini自定义输出格式方法:JSON/表格/流程图导出
摘要
通过API设置response_mime_type为application json可输出JSON;网页端用Markdown表格指令或表头模板导
= model.generate_content(
prompt="从以下简历中提取姓名、电话、邮箱、工作年限,并以JSON格式返回",
generation_config={
"response_mime_type": "application/json",
"response_schema": {"type": "object", "properties": {"name": {"type": "string"}, "phone": {"type": "string"}, "email": {"type": "string"}, "years": {"type": "integer"}}}
} )
来源:互联网
免责声明
本网站新闻资讯均来自公开渠道,力求准确但不保证绝对无误,内容观点仅代表作者本人,与本站无关。若涉及侵权,请联系我们处理。本站保留对声明的修改权,最终解释权归本站所有。