跳转至

MaaS_DB Response

流式

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "input": "你好呀。",
    "stream": true
}'

多轮对话

第一轮

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "stream":true,
    "input": "Hi,讲个笑话。"
}'

第二轮

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "previous_response_id":"resp_021760160963639f353939214b94094b6bcbe37e9f4592ed1e320",
    "input": "这个笑话的笑点在哪?"
}'

json_object输出格式

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "previous_response_id":"resp_021760160963639f353939214b94094b6bcbe37e9f4592ed1e320",
    "input": "这个笑话的笑点在哪?"
}'

tools_call

第一次

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "store": true,  
    "input": [
        {
            "type": "message",
            "role": "user",
            "content": "查询北京今天的天气"
        }
    ],
    "tools": [
        {
            "type": "function",
            "name": "get_weather",
            "description": "根据城市名称查询该城市当日天气(含温度、天气状况)",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "城市名称,如北京、上海(仅支持国内地级市)"
                    }
                },
                "required": ["location"]  
            }
        }
    ]
}'

第二次

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "previous_response_id": "resp_02176016133980737f5bc256fcae014a0b7cda6c451aa58d57d11",  
    "input": [
        {
            "arguments": "{\"location\":\"北京\"}",
            "call_id": "call_q0uc3u7hi0nbt64sjr4b00ra",
            "name": "get_weather",
            "type": "function_call"  
        },
        {
            "type": "function_call_output",  
            "call_id": "call_q0uc3u7hi0nbt64sjr4b00ra",  
            "output": "{\"city\":\"北京\",\"date\":\"2024-05-20\",\"temperature\":\"18~28℃\",\"condition\":\"晴转多云\",\"wind\":\"东北风2级\"}"
        }
    ]
}'

多模态-图片

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",

    "input": [
        {
            "role": "user",
            "content": [
                {
                    "type": "input_image",
                    "image_url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/ark_demo_img_1.png"
                },
                {
                    "type": "input_text",
                    "text": "你看见了什么?"
                }
            ]
        }
    ]
}'
curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "stream":true,
    "input": [
        {
            "role": "user",
            "content": [
                {
                    "type": "input_image",
                                 "image_url": "data:image/png;base64,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                {
                    "type": "input_text",
                    "text": "你看见了什么?"
                }
            ]
        }
    ]
}'

多模态-视频

curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "input": [
        {
            "role": "user",
            "content": [
                {    
                    "type": "input_video",
                    "video_url": "https://ark-project.tos-cn-beijing.volces.com/doc_video/ark_vlm_video_input.mp4",
                    "fps":1
                }
            ]
        }
    ]
}'
curl --request POST \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0' \
  --data '{
    "model": "doubao-seed-1-6-250615",
    "stream":true,
    "input": [
        {
            "role": "user",
            "content": [
                {
                    "type": "input_video",
                                 "video_url": "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYX"
                {
                    "type": "input_text",
                    "text": "你看见了什么?"
                }
            ]
        }
    ]
}'

获取状态

curl --request GET \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses/resp_02176016130601337f5bc256fcae014a0b7cda6c451aa5865a1b2 \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0'

获取上下文对话

curl --request GET \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses/resp_02176016130601337f5bc256fcae014a0b7cda6c451aa5865a1b2/input_items \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0'

删除对话

curl --request DELETE \
  --url https://genaiapi.cloudsway.net/v1/ai/xxxx/responses/resp_02176016130601337f5bc256fcae014a0b7cda6c451aa5865a1b2 \
  --header 'Accept: */*' \
  --header 'Accept-Encoding: gzip, deflate, br' \
  --header 'Authorization: Bearer xxxx' \
  --header 'Connection: keep-alive' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: PostmanRuntime-ApipostRuntime/1.1.0'