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

# 添加评测用例兼容接口

> 与从会话添加评测用例的连字符路径行为一致

仅在启用开发界面的服务中可用，例如 `veadk web` 或 `adk api_server --with_ui`；默认 `adk api_server` 不提供此接口

该下划线路径与对应连字符路径使用相同请求和响应，可供已有调用方继续使用。添加前确认会话与评测集存在，并检查会话中将保存为样本的数据

<Warning>
  写入或删除评测样本会修改评测集中的实际数据
</Warning>

完整调用条件与新接口见[对应评测接口](/productions/api-reference/preview/zh/agent-api-server/add-session-to-eval-set)


## OpenAPI

````yaml productions/api-reference/openapi/zh/agent-api-server.json POST /dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session
openapi: 3.1.0
info:
  title: Agent API Server
  version: google-adk 2.2.0
  description: 基于 Google ADK 2.2.0 的公开 HTTP 接口；/dev 路由仅在启用开发界面的服务中可用
servers:
  - url: http://localhost:8000
    description: 本地服务
security: []
tags:
  - name: 服务与应用
  - name: 会话
  - name: 智能体运行
  - name: 制品
  - name: 记忆
  - name: 评测 · 开发服务
  - name: 调试 · 开发服务
  - name: 兼容接口
paths:
  /dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session:
    post:
      tags:
        - 兼容接口
      summary: 添加评测用例兼容接口
      description: >-
        与从会话添加评测用例的连字符路径行为一致


        仅在启用开发界面的服务中可用，例如 `veadk web` 或 `adk api_server --with_ui`；默认 `adk
        api_server` 不提供此接口
      operationId: agentApiAddSessionToEvalSetLegacy
      parameters:
        - name: app_name
          in: path
          required: true
          schema:
            type: string
            title: App Name
          description: 应用名称
          example: travel_assistant
        - name: eval_set_id
          in: path
          required: true
          schema:
            type: string
            title: Eval Set Id
          description: 评测集 ID
          example: travel-eval
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddSessionToEvalSetRequest'
            example:
              evalId: case-001
              sessionId: session-001
              userId: user-001
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: 'null'
              example: null
        '400':
          description: 请求不符合接口要求，或所需服务/依赖未配置
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: 请求参数验证失败
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddSessionToEvalSetRequest:
      properties:
        evalId:
          type: string
          title: Evalid
          description: 评测用例 ID
        sessionId:
          type: string
          title: Sessionid
          description: 会话 ID
        userId:
          type: string
          title: Userid
          description: 用户 ID
      type: object
      required:
        - evalId
        - sessionId
        - userId
      title: AddSessionToEvalSetRequest
    ApiError:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误详情
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          description: 错误详情
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: 出错字段的位置
        msg:
          type: string
          title: Message
          description: 验证错误说明
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````