アシスタント API は、大規模言語モデル (LLM) アプリケーションの一種であるアシスタントの構築を簡素化します。このトピックでは、アシスタント API が提供する、アシスタントの作成、リスト化、取得、更新、削除などの管理メソッドについて説明します。
アシスタント API は非推奨になりました。代替として Responses API に移行してください。Responses API には、複数の組み込みツールが含まれており、マルチターンコンテキスト管理をサポートしています。
特徴:アシスタント API の特徴と基本的な使用方法の詳細については、「アシスタント API の概要」をご参照ください。
永続性:すべてのアシスタントインスタンスは Alibaba Cloud Model Studio サーバーに保存され、有効期限はありません。`assistant.id` を使用してアシスタントを取得できます。
エージェントアプリケーションとアシスタントは、特徴と使用方法が異なる 2 種類の LLM アプリケーションです。
エージェントアプリケーション:コンソールでのみエージェントアプリケーションの作成、表示、更新、削除が可能です。アプリケーション呼び出し API を使用して呼び出すことができます。
アシスタント:アシスタント API を使用してのみ、アシスタントの作成、表示、更新、削除、呼び出しが可能です。
アシスタントの作成
新しいアシスタントを作成します。
HTTP
コード例
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/assistants' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data '{
"model": "qwen-max",
"name": "Intelligent assistant",
"description": "This is an intelligent assistant",
"instructions": "You are an intelligent assistant that can call different tools based on user query and then give responses. Please use tools when needed.",
"tools": [
{
"type": "code_interpreter"
}
],
"metadata": {}
}'リクエストパラメーター
パラメーター名 | 説明 | タイプ | 必須 |
model | アシスタントが使用するモデル。 | str | はい |
name | アシスタントの名前。 | str | いいえ |
description | アシスタントの説明。 | str | いいえ |
instructions | アシスタント内の LLM のシステムプロンプト。 | str | いいえ |
tools | アシスタントが呼び出すことができるツールのリスト。 カスタムプラグインの認証情報を渡します。 | Optional[List[Dict]] | いいえ (デフォルト:[]) |
metadata | アシスタントに関連するその他のパラメーター。このパラメーターは、他の関連パラメーターを格納するために使用されます。 | Dict | いいえ |
temperature | ランダム性と多様性の度合いを制御します。 | float | いいえ |
top_p | 生成時の核サンプリング法の確率しきい値。 | float | いいえ |
top_k | 生成時のサンプリングのためのサンプル候補セットのサイズ。 | integer | いいえ |
レスポンス
{
"id": "asst_49079f4b-d1e8-4015-a12e-2dcdd1f18d84",
"object": "assistant",
"created_at": 1711713885724,
"model": "qwen-max",
"name": "Intelligent Assistant",
"description": "This is an intelligent assistant.",
"instructions": "You are an intelligent assistant. You can call different tools based on user needs to provide answers. Use tools as needed.",
"tools": [
{
"type": "code_interpreter"
}
],
"metadata": {},
"temperature": null,
"top_p": null,
"top_k": null,
"max_tokens": null,
"request_id": "b1778226-3865-9006-9e95-56329a710322"
}レスポンスパラメーター
SDK
コード例
from dashscope import Assistants
import os
import dashscope
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
assistant = Assistants.create(
# 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
api_key=os.getenv("DASHSCOPE_API_KEY"),
# この例では qwen-max を使用しています。必要に応じて、別のモデル名に置き換えることができます。モデルのリストについては、https://www.alibabacloud.com/help/model-studio/getting-started/models をご参照ください
model='qwen-max',
name='smart helper',
description='A tool helper.',
instructions='You are a helpful assistant. When asked a question, use tools wherever possible.',
tools=[{
'type': 'search'
}, {
'type': 'function',
'function': {
'name': 'big_add',
'description': 'Add to number',
'parameters': {
'type': 'object',
'properties': {
'left': {
'type': 'integer',
'description': 'The left operator'
},
'right': {
'type': 'integer',
'description': 'The right operator.'
}
},
'required': ['left', 'right']
}
}
}],
)
print(assistant)
import com.alibaba.dashscope.assistants.Assistant;
import com.alibaba.dashscope.assistants.AssistantParam;
import com.alibaba.dashscope.assistants.Assistants;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.InvalidateParameter;
import com.alibaba.dashscope.exception.NoApiKeyException;
import java.lang.System;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
public class Main {
static {
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
public static void main(String[] args) throws ApiException, NoApiKeyException, InputRequiredException, InvalidateParameter, InterruptedException {
Assistants assistants = new Assistants();
// アシスタントパラメーターを構築します
AssistantParam param = AssistantParam.builder()
// この例では qwen-max を使用しています。必要に応じて、別のモデル名に置き換えることができます。モデルのリストについては、https://www.alibabacloud.com/help/model-studio/getting-started/models をご参照ください
.model("qwen-max")
.name("intelligent guide")
.description("a smart guide")
.instructions("You are a helpful assistant.")
// 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.build();
Assistant assistant = assistants.create(param);
System.out.println(JsonUtils.toJson(assistant));
// アシスタントを使用します
}
}リクエストパラメーター
パラメーター | タイプ | デフォルト | 説明 |
model | string | - | アシスタントが使用するモデル。 |
name | string | - | アシスタントの名前。 |
description | string | - | アシスタントの説明。 |
instructions | string | - | アシスタントの特徴を指定します。 |
tools | array | [] | アシスタントが使用するツール。 説明 カスタムツールの認証情報を渡します。
アシスタントがプラグインをリクエストすると、ベアラートークンを |
metadata | object | None | アシスタントに関連付けられた情報。 |
workspace | string | None | Model Studio の ワークスペース ID。このパラメーターは、`api_key` がサブワークスペース API キーである場合にのみ必須です。 |
api_key | string | None | Alibaba Cloud Model Studio の API キーについては、環境変数として設定する (このトピックは非公開になり、「API キーの設定」にマージされます) ことを推奨します。 |
レスポンス
{
"tools":[
{
"type":"search"
},
{
"function":{
"name":"big_add",
"description":"Add to number",
"parameters":{
"type":"object",
"properties":{
"left":{
"type":"integer",
"description":"The left operator"
},
"right":{
"type":"integer",
"description":"The right operator."
}
},
"required":[
"left",
"right"
]
}
},
"type":"function"
}
],
"id":"asst_714cac72-81b2-49bf-a75d-c575b90a9398",
"object":"assistant",
"created_at":1726033638848,
"model":"qwen-max",
"name":"smart helper",
"description":"A tool helper.",
"instructions":"You are a helpful assistant. When asked a question, use tools wherever possible.",
"file_ids":[
],
"metadata":{
},
"temperature":"None",
"top_p":"None",
"top_k":"None",
"max_tokens":"None",
"request_id":"00f5962e-8d9f-92fd-9320-3173fa1525d6",
"status_code":200
}レスポンスパラメーター
フィールド名 | タイプ | 説明 |
status_code | integer | 呼び出しの HTTP ステータスコード。値が 200 の場合は成功を示します。その他の値はエラーを示します。 |
name | string | アシスタントの名前。 |
id | string | アシスタント ID。UUID 文字列です。 |
model | string | アシスタントが使用するモデルの名前。 |
description | string | アシスタントの説明。 |
instructions | string | アシスタントの特徴情報を指定できます。 |
metadata | object | アシスタントのメタデータ。 |
tools | array | アシスタントが使用できるツールのリスト。 |
created_at | integer | アシスタントが作成されたときの UNIX タイムスタンプ。 |
code | string | リクエストが失敗したことを示します。これはエラーコードです。リクエストが成功した場合、このパラメーターは無視されます。このパラメーターは、Python からの呼び出しが失敗した場合にのみ返されます。 |
message | string | リクエストが失敗したことを示します。このパラメーターは、失敗に関する詳細を提供します。リクエストが成功した場合、このパラメーターは無視されます。このパラメーターは、Python からの呼び出しが失敗した場合にのみ返されます。 |
アシスタントのリスト
アシスタントのリストを返します。
HTTP
コード例
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/assistants?limit=2&order=desc' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"リクエストパラメーター
入力パラメーター名 | 入力パラメーターの説明 | タイプ | 必須 |
limit | アシスタントの数 | int | いいえ |
order | 作成時間によるソート順。 | str | いいえ (デフォルト: |
レスポンス
{
"object": "list",
"data": [
{
"id": "asst_0678aa33-43e2-4268-95e6-b0010f9f7937",
"object": "assistant",
"created_at": 1711435564909,
"model": "qwen-max",
"name": "Intelligent Assistant",
"description": "This is an intelligent assistant.",
"instructions": "You are an intelligent assistant. You can call different tools based on user needs to provide answers. Use tools as needed.",
"tools": [
{
"type": "search"
},
{
"type": "text_to_image"
},
{
"type": "code_interpreter"
}
],
"metadata": {}
},
{
"id": "asst_7af23142-52bc-4218-aa98-dfdb1128f19c",
"object": "assistant",
"created_at": 1711422620443,
"model": "qwen-max",
"name": "helpful assistant",
"description": "",
"instructions": "You are a helpful assistant.",
"tools": [
{
"type": "text_to_image"
}
],
"file_ids": [],
"metadata": {}
}
],
"first_id": "asst_0678aa33-43e2-4268-95e6-b0010f9f7937",
"last_id": "asst_7af23142-52bc-4218-aa98-dfdb1128f19c",
"has_more": true,
"request_id": "bc257359-ce86-9547-98be-d804effba8d1"
}レスポンスパラメーター
アシスタントオブジェクトのリスト。
SDK
コード例
import dashscope
from dashscope import Assistants
import os
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
assistants = Assistants.list(
# 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
api_key=os.getenv("DASHSCOPE_API_KEY"),
limit=1,
order='desc'
)import com.alibaba.dashscope.assistants.Assistant;
import com.alibaba.dashscope.assistants.Assistants;
import com.alibaba.dashscope.common.GeneralListParam;
import com.alibaba.dashscope.common.ListResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.InvalidateParameter;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
public class Main {
static {
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
public static void main(String[] args) throws ApiException, NoApiKeyException, InputRequiredException, InvalidateParameter, InterruptedException {
Assistants assistants = new Assistants();
GeneralListParam listParam = GeneralListParam.builder()
// 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.limit(10l)
.build();
ListResult<Assistant> assistant = assistants.list(listParam);
}
}リクエストパラメーター
パラメーター | タイプ | デフォルト | 説明 |
limit | string | None | リストするアシスタントの数。このパラメーターが指定されていない場合、サーバーのデフォルト値が使用されます。 |
order | string | None | ソート順。有効な値:`desc` (降順) と `asc` (昇順)。このパラメーターが指定されていない場合、サーバーのデフォルト値が使用されます。 |
workspace | string | None | Model Studio の ワークスペース ID。このパラメーターは、`api_key` がサブワークスペース API キーである場合にのみ必須です。 |
api_key | string | None |
レスポンスパラメーター
フィールド名 | タイプ | 説明 |
has_more | boolean | さらにデータがあるかどうかを示します。 |
last_id | string | データ内の最後のアシスタントの ID。 |
first_id | string | データ内の最初のアシスタントの ID。 |
data | array | アシスタントオブジェクトのリスト。 |
object | string | データのフォーマット。例: |
request_id | string | リクエストの ID。 |
status_code | integer | リクエストのステータスコード。 |
リトリーバルエージェント
HTTP
コード例
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/assistants/asst_0678aa33-43e2-4268-95e6-b0010f9f7937' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"リクエストパラメーター
入力パラメーター名 | 入力パラメーターの説明 | タイプ | 必須 |
assistant_id | 取得するアシスタントの ID。 | str | はい |
レスポンス
{
"id": "asst_0678aa33-43e2-4268-95e6-b0010f9f7937",
"object": "assistant",
"created_at": 1711435564909,
"model": "qwen-max",
"name": "Intelligent Assistant",
"description": "This is an intelligent assistant.",
"instructions": "You are an intelligent assistant. You can call different tools based on user needs to provide answers. Use tools as needed.",
"tools": [
{
"type": "search"
},
{
"type": "text_to_image"
},
{
"type": "code_interpreter"
}
],
"metadata": {},
"request_id": "f0ec05b0-8813-984c-81b5-1166ae3478d1"
}レスポンスパラメーター
取得した アシスタントオブジェクト。
SDK
コード例
from dashscope import Assistants
import dashscope
import os
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
assistant = Assistants.retrieve(
assistant_id='your_assistant_id',
# 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
api_key=os.getenv("DASHSCOPE_API_KEY")
)
print(assistant)
import com.alibaba.dashscope.assistants.Assistant;
import com.alibaba.dashscope.assistants.Assistants;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.InvalidateParameter;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
public class Main {
static {
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
public static void main(String[] args) throws ApiException, NoApiKeyException, InputRequiredException, InvalidateParameter, InterruptedException {
Assistants assistants = new Assistants();
// 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
String apiKey = System.getenv("DASHSCOPE_API_KEY");
Assistant assistant = assistants.retrieve("assistant_id", apiKey);
}
}
リクエストパラメーター
パラメーター | タイプ | デフォルト | 説明 |
assistant_id | string | - | 取得するアシスタントの ID。 |
workspace | string | None | Model Studio の ワークスペース ID。このパラメーターは、`api_key` がサブワークスペース API キーである場合にのみ必須です。 |
api_key | string | None | Model Studio API キー。詳細については、「API キーを環境変数として設定する」をご参照ください。 |
レスポンスパラメーター
詳細については、「アシスタントオブジェクト」をご参照ください。
アシスタントの更新
HTTP
コード例
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/assistants/asst_0678aa33-43e2-4268-95e6-b0010f9f7937' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data '{
"instructions": "You are a search assistant",
"name": "New Application-assistantAPI",
"description": "",
"model": "qwen-max"
}'リクエストパラメーター
入力パラメーター名 | 入力パラメーターの説明 | タイプ | 必須 |
assistant_id | 取得するエージェントの ID | str | はい |
* | その他のオプションの入力パラメーター。 | str | いいえ |
model | アシスタントが使用するモデルの ID。 | str | はい |
name | アシスタントの名前。 | str | いいえ |
description | アシスタントの説明。 | str | いいえ |
instructions | アシスタント内の LLM のシステムプロンプト。 | str | いいえ |
tools | アシスタントが呼び出すことができるツールのリスト。ツールは Alibaba Cloud Model Studio に登録されている必要があります。 | Optional[List[Dict]] | いいえ (デフォルト:[]) |
metadata | アシスタントの他の関連パラメーターを格納します。 | Dict | いいえ |
レスポンス
{
"id": "asst_0678aa33-43e2-4268-95e6-b0010f9f7937",
"object": "assistant",
"created_at": 1711435564909,
"model": "qwen-max",
"name": "New-Application-assistantAPI",
"description": "",
"instructions": "You are a search assistant.",
"tools": [
{
"type": "search"
},
{
"type": "text_to_image"
},
{
"type": "code_interpreter"
}
],
"metadata": {},
"request_id": "b0993831-a98b-9e71-b235-75174df9046e"
}レスポンスパラメーター
更新された アシスタントオブジェクト。
SDK
コード例
from dashscope import Assistants
import dashscope
import os
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
assistants = Assistants.update(
'assistant_id',
model='new_model_name',
# 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
api_key=os.getenv("DASHSCOPE_API_KEY")
)
import com.alibaba.dashscope.assistants.Assistant;
import com.alibaba.dashscope.assistants.AssistantParam;
import com.alibaba.dashscope.assistants.Assistants;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.InvalidateParameter;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
public class Main {
static {
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
public static void main(String[] args) throws ApiException, NoApiKeyException, InputRequiredException, InvalidateParameter, InterruptedException {
Assistants assistants = new Assistants();
AssistantParam param = AssistantParam.builder()
.model("qwen-max")
.name("intelligent guide")
.description("a smart guide")
.instructions("You are a helpful assistant. When asked a question, use tools wherever possible.")
// 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.build();
Assistant assistant = assistants.update("assistant_id", param);
}
}リクエストパラメーター
パラメーター | タイプ | デフォルト | 説明 |
assistant_id | string | - | 更新するアシスタントの ID。 |
model | string | - | アシスタントが使用するモデル。 |
name | string | None | アシスタントの名前。 |
description | string | None | アシスタントの説明。 |
instructions | string | None | アシスタントの特徴情報を指定できます。 |
tools | array | [] | アシスタントが使用するツール。 |
metadata | object | None | アシスタントに関連付けられた情報。 |
workspace | string | None | Model Studio の ワークスペース ID。このパラメーターは、`api_key` がサブワークスペース API キーである場合にのみ必須です。 |
api_key | string | None | Alibaba Cloud Model Studio の API キーについては、API キーを環境変数として設定することを推奨します。 |
レスポンスパラメーター
詳細については、「アシスタントオブジェクト」をご参照ください。
アシスタントの削除
HTTP
コード例
curl --location --request DELETE 'https://dashscope-intl.aliyuncs.com/api/v1/assistants/asst_0678aa33-43e2-4268-95e6-b0010f9f7937' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"リクエストパラメーター
入力パラメーター名 | 説明 | タイプ | 必須 |
assistant_id | 取得するアシスタントの ID。 | str | はい |
レスポンス
{
"id": "asst_0678aa33-43e2-4268-95e6-b0010f9f7937",
"object": "assistant.deleted",
"deleted": true,
"request_id": "6af9320f-0430-9d01-b92f-d1beb6424dc5"
}レスポンスパラメーター
削除されたアシスタントのステータスを出力します。
SDK
コード例
from dashscope import Assistants
import dashscope
import os
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
assistants = Assistants.delete(
'assistant_id',
# 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
api_key=os.getenv("DASHSCOPE_API_KEY")
)import com.alibaba.dashscope.assistants.Assistants;
import com.alibaba.dashscope.common.DeletionStatus;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.InvalidateParameter;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
public class Main {
static {
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
public static void main(String[] args) throws ApiException, NoApiKeyException, InputRequiredException, InvalidateParameter, InterruptedException {
Assistants assistants = new Assistants();
// 環境変数を設定します。設定していない場合は、次の行を Model Studio API キーに置き換えます: api_key="sk-xxx"
String apiKey = System.getenv("DASHSCOPE_API_KEY");
DeletionStatus assistant = assistants.delete("assistant_id", apiKey);
}
}リクエストパラメーター
パラメーター | タイプ | デフォルト | 説明 |
assistant_id | string | - | 削除するアシスタントの ID。 |
workspace | string | None | Model Studio の ワークスペース ID。このパラメーターは、`api_key` がサブワークスペース API キーである場合にのみ必須です。 |
api_key | string | None | ご利用の Alibaba Cloud Model Studio API キーについては、環境変数として設定する (このトピックは非公開になり、「API キーの設定」にマージされます) ことを推奨します。 |
レスポンスパラメーター
フィールド名 | タイプ | 説明 |
id | string | 削除されたオブジェクトの ID。 |
object | string | リクエストのターゲット。例: |
deleted | boolean | 削除の確認 |
request_id | string | リクエストの ID。 |
status_code | integer | リクエストのステータスコード。 |
アシスタントオブジェクト
モデルを呼び出し、ツールを使用できる Assistant オブジェクト。
アシスタントオブジェクトの例
{
"id": "asst_49079f4b-d1e8-4015-a12e-2dcdd1f18d84",
"object": "assistant",
"created_at": 1711713885724,
"model": "qwen-max",
"name": "Intelligent Assistant",
"description": "This is an intelligent assistant.",
"instructions": "You are an intelligent assistant. You can call different tools based on user needs to provide answers. Use tools as needed.",
"tools": [
{
"type": "code_interpreter"
}
],
"metadata": {},
"temperature": null,
"top_p": null,
"top_k": null,
"max_tokens": null,
"request_id": "b1778226-3865-9006-9e95-56329a710322"
}パラメーター名 | データ型 | 説明 |
id | string | アシスタントの一意の識別子。アシスタント ID です。 |
object | string | オブジェクトタイプ。常に |
created_at | integer | アシスタントが作成されたときの 13 桁の Unix タイムスタンプ (ミリ秒単位)。 |
model | string | アシスタントが使用するモデルの名前。利用可能なすべてのモデルは、「アシスタント API の概要」で表示するか、詳細については「モデルリスト」をご参照ください。 |
name | string | アシスタントの名前。 |
description | string | アシスタントの説明。 |
instructions | string | アシスタントが使用するシステム命令。 |
tools | array | アシスタントで有効になっているツールのリスト。ツールは、公式プラグイン (`code_interpreter`、`quark_search`、`text_to_image` など)、検索拡張生成 (RAG)、または関数呼び出しにすることができます。 |
metadata | dict | 構造化されたフォーマットで格納されたアシスタントオブジェクトに関する追加情報。 |
temperature | float | サンプリング温度。0 から 2 の間の値です。1 などの高い値は出力をよりランダムにし、0.2 などの低い値は出力をより集中的かつ決定論的にします。 |
top_p | float | 温度サンプリングの代替で、核サンプリングと呼ばれます。このサンプリング方法では、LLM は累積確率質量が `top_p` であるトークンの結果を選択します。値が 0.1 の場合、確率質量のトップ 10% を構成するトークンのみが考慮されることを意味します。 このパラメーターまたは |
top_k | integer | `top_p` と同様ですが、サンプルは累積確率質量に関係なく、最も確率の高い k 個のトークンから選択されます。 このパラメーターと |
max_tokens | integer | アシスタントが一度に生成できるトークンの最大数。 |
request_id | string | アシスタントに関連付けられた呼び出しの一意の識別子。 |
エラーコード
モデルの呼び出しが失敗し、エラーメッセージが返された場合は、「エラーメッセージ」でトラブルシューティング情報をご参照ください。