> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bigmodel.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 对话历史

> 查询智能体对话历史，现仅支持 `slides_glm_agent` 智能体。点击 **Try it** 按钮可快速试用。



## OpenAPI

````yaml /openapi/openapi.json post /v1/agents/conversation
openapi: 3.0.1
info:
  title: ZHIPU AI API
  description: ZHIPU AI 接口提供强大的 AI 能力，包括聊天对话、工具调用和视频生成。
  license:
    name: ZHIPU AI 开发者协议和政策
    url: https://chat.z.ai/legal-agreement/terms-of-service
  version: 1.0.0
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api/
    description: 开放平台服务
security:
  - bearerAuth: []
tags:
  - name: 模型 API
    description: Chat API
  - name: 工具 API
    description: Web Search API
  - name: Agent API
    description: Agent API
  - name: 文件 API
    description: File API
  - name: 知识库 API
    description: Knowledge API
  - name: 实时 API
    description: Realtime API
  - name: 批处理 API
    description: Batch API
  - name: 助理 API
    description: Assistant API
  - name: 智能体 API（旧）
    description: QingLiu Agent API
paths:
  /v1/agents/conversation:
    post:
      tags:
        - Agent API
      summary: 对话历史
      description: 查询智能体对话历史，现仅支持 `slides_glm_agent` 智能体。点击 **Try it** 按钮可快速试用。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GlmSlideAgentConversationRequest'
        required: true
      responses:
        '200':
          description: 处理成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GlmSlideAgentConversationResponse'
        default:
          description: 请求失败
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GlmSlideAgentConversationRequest:
      type: object
      properties:
        agent_id:
          type: string
          description: 智能体 `ID`
        conversation_id:
          type: string
          description: 对话 `ID`
        custom_variables:
          type: object
          description: 自定义参数
          properties:
            include_pdf:
              type: boolean
              description: 是否导出 `pdf` 文件
            pages:
              type: array
              description: '`Slide` 页信息'
              items:
                type: object
                properties:
                  position:
                    type: number
                    description: '`Slide` 页码'
                  width:
                    type: number
                    description: '`Slide` 宽度, 单位: `cm`'
                  height:
                    type: number
                    description: '`Slide` 高度, 单位: `cm`'
    GlmSlideAgentConversationResponse:
      type: object
      properties:
        conversation_id:
          type: string
          description: 对话 `ID`
        agent_id:
          type: string
          description: 智能体 `ID`
        choices:
          type: array
          description: Agent output.
          items:
            type: object
            properties:
              message:
                type: array
                items:
                  type: object
                  properties:
                    role:
                      type: string
                      description: 智能体的角色 `role = assistant`
                    content:
                      type: array
                      description: 智能体响应内容
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            description: 响应内容类型：文件下载链接-`file_url`、图片下载链接-`image_url`
                          tag_cn:
                            type: string
                            description: CN Tag.
                          tag_en:
                            type: string
                            description: EN Tag.
                          file_url:
                            type: string
                            description: 如果 `type = file_url`，则这个字段给出文件的具体下载链接
                          image_url:
                            type: string
                            description: 如果 `type = image_url`，则这个字段给出图片的具体下载链接
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code.
            message:
              type: string
              description: Error message.
    Error:
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````