Tüm Ürünler
Search
Belge Merkezi

:ContextualAnswer

Son Güncelleme:Oct 02, 2026

AI Asistanı için ikinci aşama soru-cevap API'sini sağlar.

Operation description

Dikkat Edilmesi Gerekenler

  • Bu arayüzü kullanmadan önce, Akıllı Medya Yönetimi ürününün faturalandırma yöntemini ve fiyatlandırmasını tam olarak anladığınızdan emin olun.

  • Bu arayüzü çağırmadan önce, dosyaları bağlama (CreateBinding) veya aktif indeksleme (IndexFileMeta veya BatchIndexFileMeta) yoluyla veri kümesine (Dataset) indekslediğinizden emin olun.

  • Döndürülen sonuç yalnızca bir örnektir. İş akışı şablonu yapılandırmasına bağlı olarak, elde edilen dosya meta verisi bilgilerinin kategorileri ve içeriği örnekten farklı olabilir. Herhangi bir sorunuz varsa, lütfen DingTalk'ta 21714099 grup numarasını arayarak DingTalk grubuna katılın.

Kullanım Kısıtlamaları

  • Hem kullanıcı hem de asistan mesajları dahil olmak üzere, geçmiş konuşmanın maksimum uzunluğu 100'dür.

  • Her mesaj 1000 karakteri aşmamalıdır.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

imm:ContextualAnswer

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

Yes

Proje adı. Nasıl elde edileceği hakkında bilgi için Proje Oluşturma bölümüne bakın.

test-project

Messages

array

Yes

Evet, konuşmaların ve araç çağrılarının geçmişi. En son mesaj sondadır (dizin n-1) ve en eski mesaj baştadır (dizin 0). Kullanıcı-asistan çiftleri şeklinde olmalı, toplam sayısı 2*n+1 olmalı ve en son sorunun uzunluğu 1000 karakteri aşmamalıdır. Geçmiş konuşmanın uzunluğu 100 ile sınırlıdır.

ContextualMessage

No

Konuşma mesajları listesi.

Files

array

No

Mevcut soru-cevap işleminde yer alan dosyaların içeriği. Girdi olarak ContextualRetrieval arayüzünün dönüş değerinin kullanılması önerilir.

ContextualFile

No

Soru-cevap işleminde yer alan dosyaların listesi.

Response elements

Element

Type

Description

Example

object

Yanıt şeması.

RequestId

string

Mevcut isteğin kimliği.

22F081FB-90D7-525A-BFE4-D28DC906A28F

Answer Answer

Büyük modelden gelen yanıtın içeriği.

Code

string

Hata kodu.

ResourceNotFound

Message

string

Hata mesajı.

The specified resource project is not found.

Examples

Success response

JSON format

{
  "RequestId": "22F081FB-90D7-525A-BFE4-D28DC906A28F",
  "Answer": {
    "Content": "你好",
    "References": [
      {
        "ProjectName": "test-project",
        "DatasetName": "test-dataset",
        "ObjectId": "75d5de2c50754e3dadd5c35dbca5f9949369e37eb342a73821f690c94c36c7f7",
        "URI": "oss://test-bucket/test-object.jpg"
      }
    ]
  },
  "Code": "ResourceNotFound",
  "Message": "The specified resource project is not found."
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.