

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 了解不同模型推論方法的使用案例
<a name="inference-methods"></a>

您可採用下列方式，直接執行模型推論：


****  

| Method | 使用案例 | 
| --- | --- | 
| [Amazon Bedrock 主控台遊樂場](playgrounds.md) | 在易於使用的圖形界面中執行推論。方便探索。 | 
| [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) 或 [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) | 使用統一 API 實作對話式應用程式以進行模型輸入。 | 
| [InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) 或 [InvokeModelWithResponseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html) | 提交單一提示並同步產生回應。可用於即時產生回應或搜尋查詢。 | 
| [StartAsyncInvoke](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_StartAsyncInvoke.html) | 提交單一提示並以非同步方式產生回應。適用於大規模產生回應。 | 
| [CreateModelInvocationJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelInvocationJob.html) | 準備提示的資料集，並批次產生回應。 | 
| [回應 API](https://platform.openai.com/docs/api-reference/responses) | 將 Responses API 用於需要內建工具 （搜尋、程式碼解譯器）、多模式輸入和具狀態對話的現代客服人員應用程式。 | 
| [聊天完成](https://platform.openai.com/docs/api-reference/chat) | 將聊天完成 API 用於輕量、無狀態、以文字為主的任務，其中您需要完全控制聊天歷史記錄管理和更低延遲。 | 

下列 Amazon Bedrock 功能也會使用模型推論作為較大工作流程中的步驟：
+ 在您提交 [CreateEvaluationJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateEvaluationJob.html) 請求後，[模型評估](evaluation.md)會使用模型調用程序來評估不同模型的效能。
+ [知識庫](knowledge-base.md)使用 [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html) API 以根據從知識庫擷取到的結果產生回應時，會使用模型調用。
+ [代理程式](agents.md)在 [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) 請求期間會使用模型調用在各個階段產生回應。
+ [流程](flows.md)包括使用模型調用的 Amazon Bedrock 資源，例如提示、知識庫和代理程式。

使用不同的提示和推論參數測試不同的基礎模型之後，您可以設定應用程式，以使用所需的規格來呼叫這些 API。