# 带图像的对话请求（with Images）

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/chat:
    post:
      summary: 带图像的对话请求（with Images）
      deprecated: false
      description: >-
        Send a chat message with images. The images should be provided as an
        array, with the individual images encoded in Base64.
      tags:
        - 生成对话补全
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 模型名称
                  examples:
                    - gpt-4
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        description: 消息角色
                        examples:
                          - user
                      content:
                        type: string
                        description: 消息内容
                        examples:
                          - 你好，请帮我解答这个问题
                      images:
                        type: array
                        items:
                          type: string
                          description: 图片base64编码
                          examples:
                            - data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
                    required:
                      - role
                      - content
              required:
                - model
                - messages
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    type: string
                  created_at:
                    type: string
                  message:
                    type: object
                    properties:
                      role:
                        type: string
                      content:
                        type: string
                      images:
                        type: 'null'
                    required:
                      - role
                      - content
                      - images
                    x-apifox-orders:
                      - role
                      - content
                      - images
                  done:
                    type: boolean
                  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
                  - message
                  - done
                  - total_duration
                  - load_duration
                  - prompt_eval_count
                  - prompt_eval_duration
                  - eval_count
                  - eval_duration
                x-apifox-orders:
                  - model
                  - created_at
                  - message
                  - done
                  - total_duration
                  - load_duration
                  - prompt_eval_count
                  - prompt_eval_duration
                  - eval_count
                  - eval_duration
              example:
                model: llava
                created_at: '2023-12-13T22:42:50.203334Z'
                message:
                  role: assistant
                  content: ' The image features a cute, little pig with an angry facial expression. It''s wearing a heart on its shirt and is waving in the air. This scene appears to be part of a drawing or sketching project.'
                  images: null
                done: true
                total_duration: 1668506709
                load_duration: 1986209
                prompt_eval_count: 26
                prompt_eval_duration: 359682000
                eval_count: 83
                eval_duration: 1303285000
          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-272428827-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: http://localhost:11434/api/
    description: 正式环境
security: []

```
