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

# Get Observation

> 获取当前环境观察、工具列表和完成状态



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/agentlin/openapi.documented.yml post /env/observation
openapi: 3.1.0
info:
  title: Agentlin API
  description: >-
    The Agentlin REST API. Please see https://linxueyuan.online/agentlin/ for
    more details.
  version: 2.3.0
  termsOfService: https://linxueyuan.online/policies/terms-of-use
  contact:
    name: Agentlin Support
    url: https://help.linxueyuan.online/
  license:
    name: MIT
    url: https://github.com/LinXueyuanStdio/agentlin/blob/master/LICENSE
servers:
  - url: https://api.linxueyuan.online/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Tasks
    description: Create, retrieve, and cancel agent tasks.
  - name: Environment
    description: Interact with remote environments.
paths:
  /env/observation:
    post:
      tags:
        - Environment
      summary: Get Observation
      description: 获取当前环境观察、工具列表和完成状态
      operationId: get_observation_v1_env_observation_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvObservationRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvObservationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Client from 'agentlin_client';


            const client = new Client({
              apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.env.observation({ session_id:
            'session_id' });


            console.log(response.state);
        - lang: Python
          source: |-
            import os
            from agentlin_client import Client

            client = Client(
                api_key=os.environ.get("AGENTLIN_API_KEY"),  # This is the default and can be omitted
            )
            response = client.env.observation(
                session_id="session_id",
            )
            print(response.state)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/LinXueyuanStdio/agentlin-client-go\"\n\t\"github.com/LinXueyuanStdio/agentlin-client-go/option\"\n)\n\nfunc main() {\n\tclient := agentlin.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Env.Observation(context.TODO(), agentlin.EnvObservationParams{\n\t\tSessionID: \"session_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.State)\n}\n"
components:
  schemas:
    EnvObservationRequest:
      properties:
        session_id:
          type: string
          title: Session Id
      type: object
      required:
        - session_id
      title: EnvObservationRequest
      description: 获取观察请求
    EnvObservationResponse:
      properties:
        state:
          additionalProperties: true
          type: object
          title: State
        tools:
          items:
            $ref: '#/components/schemas/ToolData'
          type: array
          title: Tools
        done:
          type: boolean
          title: Done
          default: false
      type: object
      required:
        - state
        - tools
      title: EnvObservationResponse
      description: 获取观察响应
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ToolData:
      type: object
      properties:
        type:
          type: string
          enum:
            - function
          default: function
          description: 工具类型，此处固定为 function。
        function:
          $ref: '#/components/schemas/FunctionDefinition'
          description: 函数工具定义（名称/参数/描述）。
      required:
        - type
        - function
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FunctionDefinition:
      type: object
      properties:
        name:
          type: string
          description: 工具/函数名称（唯一标识）。
        description:
          type: string
          description: 函数的用途说明。
        parameters:
          type: object
          description: JSON Schema for the function parameters.
          additionalProperties: true
        strict:
          type: boolean
          default: false
          description: 是否启用严格参数校验。
      required:
        - name
        - parameters
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````