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

# GenAI Conversationチャット



## OpenAPI

````yaml /ja/weave/reference/service-api/openapi.json post /agents/conversations/chat
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /agents/conversations/chat:
    post:
      tags:
        - Agents
      summary: GenAI Conversationチャット
      operationId: genai_conversation_chat_agents_conversations_chat_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentConversationChatReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentConversationChatRes'
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    AgentConversationChatReq:
      description: 会話の multi-turn チャット ビューを取得するためのリクエスト。
      properties:
        conversation_id:
          title: Conversation Id
          type: string
        include_feedback:
          default: false
          title: Include Feedback
          type: boolean
        limit:
          default: 50
          description: 返す会話ターンの最大数。
          maximum: 50
          minimum: 0
          title: Limit
          type: integer
        offset:
          default: 0
          description: スキップする直近のターン数。結果は、選択したページ内で時系列順に返されます。
          minimum: 0
          title: Offset
          type: integer
        project_id:
          title: Project Id
          type: string
      required:
        - project_id
        - conversation_id
      title: AgentConversationChatReq
      type: object
    AgentConversationChatRes:
      description: >-
        Multi-turn チャット ビュー: ターンごとのチャット応答を順序どおりに並べた一覧です。


        `turns` 内の各エントリは 1 つの trace_id に対応し、Weave はそれを 1 つの会話ターンとして扱います。これは必ずしも
        1 つの `invoke_agent` スパンであるとは限りません。1 つのターンには、エージェント呼び出しが 0 個、1
        個、または複数含まれる場合があります。フロントエンドでは、エントリ間にターン番号の区切りを表示しつつ、各ターンの描画に
        `AgentTraceChatRes` レンダリングをそのまま再利用できます。
      properties:
        conversation_id:
          title: Conversation Id
          type: string
        feedback:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Feedback
        has_more:
          default: false
          title: Has More
          type: boolean
        limit:
          default: 50
          title: Limit
          type: integer
        offset:
          default: 0
          title: Offset
          type: integer
        total_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Cost Usd
        total_turns:
          default: 0
          title: Total Turns
          type: integer
        turns:
          items:
            $ref: '#/components/schemas/AgentTraceChatRes'
          title: Turns
          type: array
      required:
        - conversation_id
      title: AgentConversationChatRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AgentTraceChatRes:
      description: '構造化チャットビュー: 単一の trace におけるエージェントの軌跡を表す、メッセージの線形シーケンスです。'
      properties:
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
        agent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Version
        feedback:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Feedback
        messages:
          items:
            $ref: '#/components/schemas/AgentChatMessage'
          title: Messages
          type: array
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        root_span_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Span Name
        status_code:
          anyOf:
            - enum:
                - UNSET
                - OK
                - ERROR
              type: string
            - type: 'null'
          title: Status Code
        total_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Cost Usd
        total_duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          description: trace ルート スパンの実時間の継続時間（ミリ秒）です。これは子スパンの継続時間の合計ではありません。
          title: Total Duration Ms
        trace_id:
          title: Trace Id
          type: string
      required:
        - trace_id
      title: AgentTraceChatRes
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AgentChatMessage:
      description: >-
        構造化されたエージェント trajectory / チャット ビュー内の単一要素です。


        共通のイベント フィールドはトップレベルに配置されます。タイプ固有のフィールドは `type` に対応する payload
        の下にグループ化され、設定できる payload は必ず 1 つだけです。これにより、呼び出し元向けの単一の順序付きタイムライン
        モデルを維持しながら、サブタイプの null 許容性を明示的に保てます。
      properties:
        agent_handoff:
          anyOf:
            - $ref: '#/components/schemas/AgentChatAgentHandoff'
            - type: 'null'
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
        agent_start:
          anyOf:
            - $ref: '#/components/schemas/AgentChatAgentStart'
            - type: 'null'
        agent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Version
        assistant_message:
          anyOf:
            - $ref: '#/components/schemas/AgentChatAssistantMessage'
            - type: 'null'
        context_compacted:
          anyOf:
            - $ref: '#/components/schemas/AgentChatContextCompacted'
            - type: 'null'
        feedback:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Feedback
        span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Span Id
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Started At
        status_code:
          anyOf:
            - enum:
                - UNSET
                - OK
                - ERROR
              type: string
            - type: 'null'
          title: Status Code
        tool_call:
          anyOf:
            - $ref: '#/components/schemas/AgentChatToolCall'
            - type: 'null'
        type:
          enum:
            - user_message
            - assistant_message
            - tool_call
            - agent_handoff
            - agent_start
            - context_compacted
          title: Type
          type: string
        user_message:
          anyOf:
            - $ref: '#/components/schemas/AgentChatUserMessage'
            - type: 'null'
      required:
        - type
      title: AgentChatMessage
      type: object
    AgentChatAgentHandoff:
      description: 将来のエージェント間ハンドオフ イベント用の payload。
      properties: {}
      title: AgentChatAgentHandoff
      type: object
    AgentChatAgentStart:
      description: エージェントのライフサイクル境界用の payload。
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        status:
          anyOf:
            - enum:
                - UNSET
                - OK
                - ERROR
              type: string
            - type: 'null'
          title: Status
        system_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: System Instructions
        tool_definitions:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Definitions
      title: AgentChatAgentStart
      type: object
    AgentChatAssistantMessage:
      description: エージェントまたは LLM span によって出力された assistant テキスト用の payload。
      properties:
        content_refs:
          items:
            type: string
          title: Content Refs
          type: array
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
        input_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Input Cost Usd
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        output_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Output Cost Usd
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
        reasoning_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Content
        reasoning_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reasoning Tokens
        status:
          anyOf:
            - enum:
                - UNSET
                - OK
                - ERROR
              type: string
            - type: 'null'
          title: Status
        text:
          title: Text
          type: string
        total_cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Cost Usd
      required:
        - text
      title: AgentChatAssistantMessage
      type: object
    AgentChatContextCompacted:
      description: コンテキスト ウィンドウ圧縮イベント用の payload。
      properties:
        compaction_items_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compaction Items After
        compaction_items_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compaction Items Before
        compaction_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Compaction Summary
      title: AgentChatContextCompacted
      type: object
    AgentChatToolCall:
      description: tool call タイムライン イベント用の payload。
      properties:
        content_refs:
          items:
            type: string
          title: Content Refs
          type: array
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
        status:
          anyOf:
            - enum:
                - UNSET
                - OK
                - ERROR
              type: string
            - type: 'null'
          title: Status
        tool_arguments:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Arguments
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        tool_result:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Result
      title: AgentChatToolCall
      type: object
    AgentChatUserMessage:
      description: チャット タイムライン内のユーザー prompt 用の payload。
      properties:
        content_refs:
          items:
            type: string
          title: Content Refs
          type: array
        text:
          title: Text
          type: string
      required:
        - text
      title: AgentChatUserMessage
      type: object

````