使用可能なリランカーモデルのリストを取得するには、watsonx.aias a service API のList the available foundation modelsメソッドを使用します。 利用可能なリランカー・モデルのみを返すには、'filters=function_rerankパラメータを指定する。
例:
curl -X GET \
'https://{region}.ml.cloud.ibm.com/ml/v1/foundation_model_specs?version=2024-10-18&filters=function_rerank'
以下の例では、{url}variable with the right value for your instance, such asus-south.ml.cloud.ibm.comを置き換えます。独自のベアラートークンとプロジェクトIDを追加します。
curl -X POST \
'https://{url}/ml/v1/text/rerank?version=2024-10-17' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOi...' \
--data '{
"inputs": [
{
"text": "A foundation model is a large-scale generative AI model that can be adapted to a wide range of downstream tasks."
},
{
"text": "Generative AI is a class of AI algorithms that can produce various types of content including text, source code, imagery, audio, and synthetic data."
},
{
"text": "Agentic AI is a generative AI flow that can decompose a prompt into multiple tasks, assign tasks to appropriate gen AI agents, and synthesize an answer without human intervention."
},
{
"text": "AI ethics is a multidisciplinary field that studies how to optimize AI'\''s beneficial impact while reducing risks and adverse outcomes. Examples of AI ethics issues are data responsibility and privacy, fairness, explainability, robustness, transparency, environmental sustainability, inclusion, moral agency, value alignment, accountability, trust, and technology misuse."
},
{
"text": "AI governance is an organization'\''s act of governing, through its corporate instructions, staff, processes and systems to direct, evaluate, monitor, and take corrective action throughout the AI lifecycle, to provide assurance that the AI system is operating as the organization intends, as its stakeholders expect, and as required by relevant regulation."
}
],
"query": "What is an agent-driven AI workflow?",
"parameters":{
"truncate_input_tokens": 512,
"return_options":{
"inputs":true
}
},
"model_id": "cross-encoder/ms-marco-minilm-l-12-v2",
"project_id": "51f3a990-4372-4ac3-9ddb-ed99d9b50840"
}'
{"model_id":"cross-encoder/ms-marco-minilm-l-12-v2","created_at":"2024-10-17T14:01:47.322Z","results":[{"index":2,"score":5.063366413116455,"input":{"text":"Agentic AI is a generative AI flow that can decompose a prompt into multiple tasks, assign tasks to appropriate gen AI agents, and synthesize an answer without human intervention."}},{"index":4,"score":-0.992393970489502,"input":{"text":"AI governance is an organization's act of governing, through its corporate instructions, staff, processes and systems to direct, evaluate, monitor, and take corrective action throughout the AI lifecycle, to provide assurance that the AI system is operating as the organization intends, as its stakeholders expect, and as required by relevant regulation."}},{"index":1,"score":-3.5372314453125,"input":{"text":"Generative AI is a class of AI algorithms that can produce various types of content including text, source code, imagery, audio, and synthetic data."}},{"index":0,"score":-4.646212100982666,"input":{"text":"A foundation model is a large-scale generative AI model that can be adapted to a wide range of downstream tasks."}},{"index":3,"score":-4.926990032196045,"input":{"text":"AI ethics is a multidisciplinary field that studies how to optimize AI's beneficial impact while reducing risks and adverse outcomes. Examples of AI ethics issues are data responsibility and privacy, fairness, explainability, robustness, transparency, environmental sustainability, inclusion, moral agency, value alignment, accountability, trust, and technology misuse."}}],"input_token_count":292,"system":{"warnings":[{"message":"This model is a Non-IBM Product governed by a third-party license that may impose use restrictions and other obligations. By using this model you agree to its terms as identified in the following URL.","id":"disclaimer_warning","more_info":"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx"}]}}
{"model_id":"cross-encoder/ms-marco-minilm-l-12-v2","created_at":"2024-10-17T20:18:50.867Z","results":[{"index":2,"score":5.063366413116455,"input":{"text":"Agentic AI is a generative AI flow that can decompose a prompt into multiple tasks, assign tasks to appropriate gen AI agents, and synthesize an answer without human intervention."}}],"input_token_count":292,"system":{"warnings":[{"message":"This model is a Non-IBM Product governed by a third-party license that may impose use restrictions and other obligations. By using this model you agree to its terms as identified in the following URL.","id":"disclaimer_warning","more_info":"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx"}]}}