メインコンテンツへスキップ
POST
/
v1
/
answers
Antwort erstellen
curl --request POST \
  --url https://api.olostep.com/v1/answers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "task": "<string>",
  "json_format": {}
}
'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "metadata": {},
  "task": "<string>",
  "result": {
    "json_content": "<string>",
    "json_hosted_url": "<string>"
  }
}

概要

このエンドポイントは、新しい回答を作成するために使用されます。回答は、指定された質問に基づいて生成されます。

リクエスト

POST /v1/answers エンドポイントにリクエストを送信することで、新しい回答を作成できます。リクエストボディには、以下のフィールドを含める必要があります。

リクエストボディ

  • question (string): 回答を生成するための質問。
  • context (string, optional): 質問に関連する追加情報。
  • model (string): 使用するモデルの名前。

レスポンス

成功した場合、レスポンスには新しく作成された回答が含まれます。

レスポンスボディ

  • id (string): 作成された回答の一意の識別子。
  • answer (string): 質問に対する生成された回答。
  • created_at (string): 回答が作成された日時。

エラー

  • 400 Bad Request: リクエストボディが無効です。
  • 401 Unauthorized: 認証に失敗しました。
  • 500 Internal Server Error: サーバーでエラーが発生しました。

以下は、POST /v1/answers エンドポイントを使用して回答を作成する例です。
{
  "question": "What is the capital of France?",
  "context": "Geography",
  "model": "text-davinci-003"
}

成功したレスポンス

{
  "id": "answer-123",
  "answer": "The capital of France is Paris.",
  "created_at": "2023-10-05T14:48:00.000Z"
}

エラーレスポンス

{
  "error": {
    "message": "Invalid request body",
    "type": "invalid_request_error"
  }
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

ボディ

application/json
task
string
必須

Die auszuführende Aufgabe.

json_format
object

Das gewünschte Ausgabe-JSON-Objekt mit leeren Werten als Schema oder einfach die Daten, die Sie als String wünschen, beschreiben.

レスポンス

Erfolgreiche Antwort mit der Antwort.

id
string
object
string
created
integer
metadata
object
task
string
result
object