会話と同期
AI アシスタントにメッセージを送信し、応答を取得します。
curl -X POST \ 'https://api.maiagent.ai/api/v1/chatbots/{chatbot_id}/completions/' \ -H 'Authorization: Api-Key YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "conversation": "string|null", "message": { "content": "string", "attachments": [] }, "is_streaming": boolean }'
パラメータ:
chatbot_id(パスパラメータ): チャットボット ID
chatbot_id
conversation(リクエストボディ): 会話を継続するために使用する、任意指定の会話 ID
conversation
message.content(リクエストボディ): 送信するメッセージの内容
message.content
message.attachments(リクエストボディ): 添付ファイルの配列(ある場合)
message.attachments
is_streaming(リクエストボディ): ストリーミング応答を使用するかどうか
is_streaming
応答(非ストリーミング):
応答(ストリーミング):
サーバー送信イベントの形式は以下のとおりです。
注意事項:
ストリーミング応答の場合、サーバーは応答が完了するまで、部分的な内容を含む複数のイベントを送信します
応答で返される会話 ID は、後続のリクエストで会話を継続するために使用できます
Last updated 15 days ago
Was this helpful?
{ "content": "string", "conversationId": "string" }
data: { "content": "string", "conversation_id": "string", "done": boolean }