# 创建任务:[AI]通过GPT生成PPT

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/job/ppt_create_by_gpt:
    post:
      summary: 创建任务:[AI]通过GPT生成PPT
      deprecated: false
      description: |2+

          :::caution

          生成PPT是 **异步任务**

          该请求会生成异步任务, 并返回任务id ,此时的 `ppt_url` 为空

          生成时间预计: **1-2分钟**


          需要 后续轮询调用 **获取单个任务数据** `/v1/job/get` 协议获取任务的最新状态 (推荐每隔5秒请求一次,直到任务成功)

          :::
          :::caution
          消耗积分规则： 每次扣除11~12个积分, ppt生成10积分 + gpt调用 1-2 积分。
          :::




      tags:
        - PPT生成
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  description: '模板id, 默认使用智能匹配的模版   '
                  default: ''
                  examples:
                    - 1xxxxxxxxx
                  type: string
                speaker:
                  description: '演讲者 '
                  examples:
                    - 演讲者名称
                  type: string
                type:
                  description: '方案类型  topic: 通过标题生成ppt,  outline: 通过大纲生成PPT'
                  type: string
                content:
                  description: 'type=topic 为标题, type=outline: markdown大纲'
                  type: string
                content_ex_info:
                  description: >-
                    内容扩展信息 , 生成大纲时的得到的，type=outline 时使用   如果设置了，后续的 配置 model,
                    desc_info,qa_list, resource_id_list无需填写。  
                  default: ''
                  type: string
                model:
                  description: '使用模型. `ali` :阿里，`deepseek`: "Deepseek" ,  '
                  default: ali
                  type: string
                page_count:
                  description: '建议生成的页面个数  '
                  default: 0
                  examples:
                    - '15'
                  type: integer
                language:
                  description: >-
                    分类: `zh`: 简体中文, `zh_hant`: 繁体中文,  `en`: 英文, `jp`: 日文,
                    `kr`:韩文.   
                  default: zh
                  examples:
                    - ''
                  type: string
                scene:
                  description: '在什么样场景下使用, 如：`分析报告`， `教学课件`, `产品介绍`, `公众演讲`, `财务分析` ...  '
                  default: ''
                  examples:
                    - ''
                  type: string
                target_audience:
                  description: '目标受众, 如：`学生`， `大众`, `员工`  ...  '
                  default: ''
                  examples:
                    - ''
                  type: string
                desc_info:
                  description: '备注，关于该主题的更多说明,或用户对话内容 '
                  default: ''
                  examples:
                    - ''
                  type: string
                qa_list:
                  type: array
                  description: '问答列表  '
                  items:
                    description: ''
                    default:
                      question: ''
                      answer: ''
                    type: object
                    properties:
                      question:
                        description: 问题
                        type: string
                      answer:
                        description: 回答
                        type: string
                    required:
                      - question
                      - answer
                    x-apifox-orders:
                      - question
                      - answer
                resource_id_list:
                  type: array
                  description: '参考的文件id列表:["xxxx1","xxxx2"], '
                  items:
                    description: ''
                    default:
                      - xxxx
                    examples:
                      - - xxxxxxxx
                    type: string
                create_preview_image_type:
                  description: >-
                    创建预览图.（会减慢生成速度!）   `null` :无需生成，`title`: "标题页" ,  `top3`
                    :"前3张" ,   
                  default: 'null'
                  type: string
                create_ppt_flag:
                  description: '是否生成ppt,  '
                  default: true
                  type: boolean
                with_create_log_flag:
                  description: ' 是否生成过程图片,用于移动端显示生成过程,   会多扣 *10积分*'
                  default: false
                  type: boolean
                aigc_implicit_label:
                  description: '合规性要求( 互联网安全-人工智能合成内容表示的 JSON) 内容:    '
                  default: >-
                    {"Label":"Mindshow","ContentProducer":"Mindshow
                    API","ProduceID":"Mindshow","ReservedCode1":"0","ContentPropagator":"0","PropagateID":"0","ReservedCode2":"1"}
                  type: string
              required:
                - speaker
                - type
                - content
              x-apifox-orders:
                - template_id
                - speaker
                - type
                - content
                - content_ex_info
                - model
                - page_count
                - language
                - scene
                - target_audience
                - desc_info
                - qa_list
                - resource_id_list
                - create_preview_image_type
                - create_ppt_flag
                - with_create_log_flag
                - aigc_implicit_label
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                title: ResponseModel
                properties:
                  code:
                    type: integer
                    description: 错误码( 0:成功. 其它值:失败[无data数据区])
                  info:
                    type: string
                    description: 错误信息
                    examples:
                      - succ
                  request_id:
                    type: string
                    description: 请求id,用于定位请求
                    examples:
                      - 21al1389334aal4f
                  data:
                    type: object
                    properties:
                      job:
                        description: 任务消息
                        type: object
                        properties:
                          id:
                            description: '任务id  '
                            examples:
                              - 1dk13k3hgfk
                            type: string
                          title:
                            description: '标题 '
                            examples:
                              - 标题
                            type: string
                          status:
                            description: >-
                              状态 [ `queued`:排队中, `running`:进行中 , 
                              `succeeded`:完成, `failed`:失败  ]  
                            examples:
                              - succeeded
                            type: string
                          queue_wait_count:
                            description: 队列等待个数.
                            type: integer
                          progress_percent:
                            description: '进度: 0-100 , status=`running` 有效 '
                            examples:
                              - 0
                            type: integer
                          created_at:
                            description: '任务创建时间 '
                            examples:
                              - '2020-01-01T00:00:00+08:00'
                            type: string
                          finished_at:
                            description: '任务完成时间 '
                            examples:
                              - '2020-01-01T00:00:00+08:00'
                            type: string
                          ppt_url:
                            description: >-
                              生成ppt 对应的url, 注意：该链接带签名需要完整的链接才能下载,
                              `有效时间为一周,请及时下载到本地`
                            type: string
                          template_id:
                            description: (任务：生成模版才有值) 生成的模版ID, 可用用于后续生成PPT
                            type: string
                          preview_img_list:
                            type: array
                            description: PPT前3张预览图的图片列表, `有效时间为一周,请及时下载到本地`
                            items:
                              description: ''
                              type: string
                          error:
                            description: 任务错误情况下的报错信息
                            type: string
                        required:
                          - id
                          - title
                          - status
                          - queue_wait_count
                          - progress_percent
                          - created_at
                          - finished_at
                          - ppt_url
                          - template_id
                          - preview_img_list
                          - error
                        x-apifox-orders:
                          - id
                          - title
                          - status
                          - queue_wait_count
                          - progress_percent
                          - created_at
                          - finished_at
                          - ppt_url
                          - template_id
                          - preview_img_list
                          - error
                      create_log_url:
                        description: 生成过程的 sse 链接：  with_create_log_flag,
                        type: string
                    required:
                      - job
                      - create_log_url
                    description: 数据区
                    x-apifox-orders:
                      - job
                      - create_log_url
                required:
                  - code
                  - info
                  - request_id
                x-apifox-orders:
                  - code
                  - info
                  - request_id
                  - data
          headers: {}
          x-apifox-name: 成功
      security:
        - bearer: []
      x-apifox-folder: PPT生成
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/3930068/apis/api-287045646-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.mindshow.vip
    description: 正式环境
security:
  - bearer: []

```
