# 结构化输出请求（Structured Outputs）

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/generate:
    post:
      summary: 结构化输出请求（Structured Outputs）
      deprecated: false
      description: ''
      tags:
        - 生成补全
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                prompt:
                  type: string
                stream:
                  type: boolean
                format:
                  type: object
                  properties:
                    type:
                      type: string
                    properties:
                      type: object
                      properties:
                        age:
                          type: object
                          properties:
                            type:
                              type: string
                          required:
                            - type
                          x-apifox-orders:
                            - type
                        available:
                          type: object
                          properties:
                            type:
                              type: string
                          required:
                            - type
                          x-apifox-orders:
                            - type
                      required:
                        - age
                        - available
                      x-apifox-orders:
                        - age
                        - available
                    required:
                      type: array
                      items:
                        type: string
                  required:
                    - type
                    - properties
                    - required
                  x-apifox-orders:
                    - type
                    - properties
                    - required
              required:
                - model
                - prompt
                - stream
                - format
              x-apifox-orders:
                - model
                - prompt
                - stream
                - format
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    type: string
                  created_at:
                    type: string
                  response:
                    type: string
                  done:
                    type: boolean
                  done_reason:
                    type: string
                  context:
                    type: array
                    items:
                      type: integer
                  total_duration:
                    type: integer
                  load_duration:
                    type: integer
                  prompt_eval_count:
                    type: integer
                  prompt_eval_duration:
                    type: integer
                  eval_count:
                    type: integer
                  eval_duration:
                    type: integer
                required:
                  - model
                  - created_at
                  - response
                  - done
                  - done_reason
                  - context
                  - total_duration
                  - load_duration
                  - prompt_eval_count
                  - prompt_eval_duration
                  - eval_count
                  - eval_duration
                x-apifox-orders:
                  - model
                  - created_at
                  - response
                  - done
                  - done_reason
                  - context
                  - total_duration
                  - load_duration
                  - prompt_eval_count
                  - prompt_eval_duration
                  - eval_count
                  - eval_duration
              example:
                model: llama3.1:8b
                created_at: '2024-12-06T00:48:09.983619Z'
                response: |-
                  {
                    "age": 22,
                    "available": true
                  }
                done: true
                done_reason: stop
                context:
                  - 1
                  - 2
                  - 3
                total_duration: 1075509083
                load_duration: 567678166
                prompt_eval_count: 28
                prompt_eval_duration: 236000000
                eval_count: 16
                eval_duration: 269000000
          headers: {}
          x-apifox-name: Success
      security: []
      x-apifox-folder: 生成补全
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/6041320/apis/api-272428815-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: http://localhost:11434/api/
    description: 正式环境
security: []

```
