-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated Darabonba for BailianChatBot-2024-11-05.
- Loading branch information
Showing
9 changed files
with
619 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"scope": "alibabacloud", | ||
"name": "BailianChatBot20241105", | ||
"version": "1.0.0", | ||
"main": "./main.tea", | ||
"maintainers": [ | ||
{ | ||
"name": "Alibaba Cloud SDK", | ||
"email": "sdk-team@alibabacloud.com" | ||
} | ||
], | ||
"java": { | ||
"package": "com.aliyun.bailianchatbot20241105", | ||
"enableMinimizeModelName": false, | ||
"packageInfo": { | ||
"description": "Alibaba Cloud BailianChatBot (20241105) SDK for Java", | ||
"url": "https://github.com/aliyun/alibabacloud-java-sdk", | ||
"licenseName": "The Apache License, Version 2.0", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt", | ||
"developerId": "aliyunproducts", | ||
"developerName": "Aliyun SDK", | ||
"developerEmail": "aliyunsdk@aliyun.com" | ||
} | ||
}, | ||
"releases": { | ||
"java": "com.aliyun:bailianchatbot20241105:1.0.0", | ||
"go": "github.com/alibabacloud-go/bailianchatbot-20241105/client:v1.0.0", | ||
"csharp": "AlibabaCloud.SDK.BailianChatBot20241105:1.0.0", | ||
"ts": "@alicloud/bailianchatbot20241105:1.0.0", | ||
"php": "alibabacloud/bailianchatbot-20241105:1.0.0", | ||
"python": "alibabacloud_bailianchatbot20241105:1.0.0", | ||
"python2": "alibabacloud_bailianchatbot20241105_py2:0.0.1", | ||
"swift": "alibabacloud-sdk-swift/bailianchatbot-20241105:1.0.0" | ||
}, | ||
"libraries": { | ||
"OpenApi": "alibabacloud:OpenApi:*", | ||
"Util": "darabonba:Util:*", | ||
"OpenApiUtil": "alibabacloud:OpenApiUtil:*", | ||
"EndpointUtil": "alibabacloud:EndpointUtil:*", | ||
"SPI": "alibabacloud:GatewaySPI:*", | ||
"GatewayClient": "alibabacloud:GatewayPOP:*", | ||
"Paginator": "alibabacloud:Paginator:*" | ||
}, | ||
"csharp": { | ||
"className": "Client", | ||
"namespace": "AlibabaCloud.SDK.BailianChatBot20241105", | ||
"packageInfo": { | ||
"name": "bailianchatbot", | ||
"title": "alibabacloud-bailianchatbot", | ||
"description": "Alibaba Cloud BailianChatBot (20241105) SDK Library for .NET", | ||
"company": "Alibaba Cloud", | ||
"property": { | ||
"PackageTags": "Alibaba Aliyun BailianChatBot SDK", | ||
"Copyright": "©2009-present Alibaba Cloud", | ||
"PackageProjectUrl": "https://github.com/aliyun/alibabacloud-csharp-sdk", | ||
"PackageIconUrl": "https://www.alibabacloud.com/favicon.ico" | ||
} | ||
} | ||
}, | ||
"php": { | ||
"package": "AlibabaCloud.SDK.BailianChatBot.V20241105", | ||
"clientName": "BailianChatBot", | ||
"packageInfo": { | ||
"name": "alibabacloud/bailianchatbot-20241105", | ||
"desc": "Alibaba Cloud BailianChatBot (20241105) SDK Library for PHP", | ||
"github": "https://github.com/aliyun/alibabacloud-php-sdk", | ||
"files": { | ||
"LICENSE": "../LICENSE" | ||
} | ||
} | ||
}, | ||
"python": { | ||
"package": "alibabacloud_bailianchatbot20241105", | ||
"clientName": "client", | ||
"packageInfo": { | ||
"name": "alibabacloud_bailianchatbot20241105", | ||
"desc": "Alibaba Cloud BailianChatBot (20241105) SDK Library for Python", | ||
"github": "https://github.com/aliyun/alibabacloud-python-sdk", | ||
"author": "Alibaba Cloud SDK", | ||
"email": "sdk-team@alibabacloud.com" | ||
} | ||
}, | ||
"python2": { | ||
"package": "alibabacloud_bailianchatbot20241105", | ||
"clientName": "client", | ||
"packageInfo": { | ||
"name": "alibabacloud_bailianchatbot20241105_py2", | ||
"desc": "Alibaba Cloud BailianChatBot (20241105) SDK Library for Python2", | ||
"github": "https://github.com/aliyun/alibabacloud-python2-sdk", | ||
"author": "Alibaba Cloud SDK", | ||
"email": "sdk-team@alibabacloud.com" | ||
} | ||
}, | ||
"cpp": { | ||
"packageInfo": { | ||
"git": { | ||
"scope": "alibabacloud-sdk-cpp", | ||
"project": "bailianchatbot-20241105" | ||
} | ||
} | ||
}, | ||
"swift": { | ||
"clientName": "Client", | ||
"packageInfo": { | ||
"name": "AlibabacloudBailianChatBot20241105", | ||
"desc": "Alibaba Cloud BailianChatBot (20241105) SDK Library for Swift", | ||
"github": "https://github.com/alibabacloud-sdk-swift/bailianchatbot-20241105", | ||
"author": "Alibaba Cloud SDK", | ||
"email": "sdk-team@alibabacloud.com" | ||
} | ||
}, | ||
"go": { | ||
"mapAndSliceWithoutOmitempty": false | ||
}, | ||
"productId": "BailianChatBot", | ||
"apiVersions": "2024-11-05" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"product": "BailianChatBot", | ||
"version": "2024-11-05", | ||
"apiDoc": { | ||
"hasDoc": [ | ||
"SseChat" | ||
], | ||
"noDoc": [] | ||
}, | ||
"deprecated": [], | ||
"endpoints": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"scope": "alibabacloud", | ||
"name": "BailianChatBot20241105-async", | ||
"version": "1.0.0", | ||
"main": "./main.dara", | ||
"productId": "bailianchatbot", | ||
"apiVersions": "20241105", | ||
"signVersion": "v2", | ||
"maintainers": [ | ||
{ | ||
"name": "Alibaba Cloud SDK", | ||
"email": "sdk-team@alibabacloud.com" | ||
} | ||
], | ||
"java": { | ||
"package": "com.aliyun.sdk.service.bailianchatbot20241105", | ||
"className": "DefaultAsyncClient", | ||
"implements": "AsyncClient", | ||
"packageInfo": { | ||
"description": "Alibaba Cloud BailianChatBot (20241105) Async SDK for Java", | ||
"url": "https://github.com/aliyun/alibabacloud-java-async-sdk", | ||
"licenseName": "The Apache License, Version 2.0", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt", | ||
"developerId": "aliyunproducts", | ||
"developerName": "Aliyun SDK", | ||
"developerEmail": "aliyunsdk@aliyun.com" | ||
} | ||
}, | ||
"releases": { | ||
"java": "com.aliyun:alibabacloud-bailianchatbot20241105:0.0.1" | ||
}, | ||
"libraries": { | ||
"TeaRequest": "alibabacloud:DarabonbaCore.TeaRequest:*", | ||
"AsyncRequestBody": "alibabacloud:DarabonbaCore.AsyncRequestBody:*", | ||
"RequestBody": "alibabacloud:DarabonbaCore.RequestBody:*", | ||
"AsyncResponseHandler": "alibabacloud:DarabonbaCore.AsyncResponseHandler:*", | ||
"ClientConfiguration": "alibabacloud:DarabonbaCore.ClientConfiguration:*", | ||
"ClientExecutionParams": "alibabacloud:DarabonbaCore.ClientExecutionParams:*", | ||
"TeaAsyncHandler": "alibabacloud:DarabonbaCore.TeaAsyncHandler:*", | ||
"BaseClientBuilder": "alibabacloud:DarabonbaCore.Pop:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"product": "BailianChatBot", | ||
"version": "2024-11-05", | ||
"apiDoc": { | ||
"hasDoc": [ | ||
"SseChat" | ||
], | ||
"noDoc": [] | ||
}, | ||
"deprecated": [], | ||
"endpoints": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* | ||
*/ | ||
import BaseClientBuilder; | ||
import TeaAsyncHandler; | ||
import TeaRequest; | ||
import AsyncRequestBody; | ||
import RequestBody; | ||
import AsyncResponseHandler; | ||
import ClientConfiguration; | ||
import ClientExecutionParams; | ||
extends BaseClientBuilder; | ||
type @product = string | ||
type @version = string | ||
type @endpointRule = string | ||
type @endpointMap = map[string]string | ||
type @REQUEST = TeaRequest | ||
type @handler = TeaAsyncHandler | ||
|
||
init(configuration: ClientConfiguration){ | ||
@handler = new TeaAsyncHandler(configuration); | ||
@product = 'BailianChatBot'; | ||
@version = '2024-11-05'; | ||
@endpointRule = ''; | ||
@endpointMap = { | ||
}; | ||
} | ||
|
||
function close(): void { | ||
@handler.close(); | ||
} | ||
|
||
model SseChatRequest { | ||
regionId?: string(name='RegionId', position='Host'), | ||
appId: string(name='AppId', description='This parameter is required.', example='chatbot-cn-dDmF3jcdVf', position='Query'), | ||
command?: string(name='Command', example='TIMEOUT', position='Query'), | ||
senderId?: string(name='SenderId', example='uid129312098593', position='Query'), | ||
senderNick?: string(name='SenderNick', position='Query'), | ||
sessionId?: string(name='SessionId', example='15e04f27-acd7-489d-872f-1d68f7535e33', position='Query'), | ||
utterance: string(name='Utterance', description='This parameter is required.', position='Query'), | ||
vendorParam?: string(name='VendorParam', position='Query'), | ||
workspaceId: string(name='WorkspaceId', description='This parameter is required.', example='llm-g7jspxljq8k909h3', position='Query'), | ||
} | ||
|
||
model SseChatResponseBody = { | ||
code?: string(name='Code', example='200'), | ||
data?: any(name='Data'), | ||
message?: string(name='Message', example='success'), | ||
requestId?: string(name='RequestId', example='30D68C4C-4512-58A7-A328-568015B39A02'), | ||
success?: boolean(name='Success', example='True'), | ||
} | ||
|
||
model SseChatResponse = { | ||
headers?: map[string]string(name='headers'), | ||
statusCode?: int32(name='statusCode'), | ||
body?: SseChatResponseBody(name='body'), | ||
} | ||
|
||
/** | ||
* @param request the request parameters of SseChat SseChatRequest | ||
* @return SseChatResponse | ||
*/ | ||
async function sseChat(request: SseChatRequest): SseChatResponse { | ||
@handler.validateRequestModel(request); | ||
return @handler.do('RPC', 'SseChat', 'POST', '/sse/bailian/chat', 'json', false, 'json', request); | ||
} | ||
|
||
function sseChatWithResponseIterable(request: SseChatRequest): iterator[SseChatResponseBody] { | ||
@handler.validateRequestModel(request); | ||
yield @handler.doSSERequest('SSE', 'SseChat', 'POST', '/sse/bailian/chat', 'json', false, 'json', request); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/** | ||
* | ||
*/ | ||
import Util; | ||
import OpenApi; | ||
import OpenApiUtil; | ||
import EndpointUtil; | ||
|
||
extends OpenApi; | ||
|
||
|
||
init(config: OpenApi.Config){ | ||
super(config); | ||
@endpointRule = ''; | ||
|
||
checkConfig(config); | ||
@endpoint = getEndpoint('bailianchatbot', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint); | ||
} | ||
|
||
function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{ | ||
if (!Util.empty(endpoint)) { | ||
return endpoint; | ||
} | ||
|
||
if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) { | ||
return endpointMap[regionId]; | ||
} | ||
return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); | ||
} | ||
|
||
model SseChatRequest { | ||
appId?: string(name='AppId', description='This parameter is required.', example='chatbot-cn-dDmF3jcdVf'), | ||
command?: string(name='Command', example='TIMEOUT'), | ||
senderId?: string(name='SenderId', example='uid129312098593'), | ||
senderNick?: string(name='SenderNick'), | ||
sessionId?: string(name='SessionId', example='15e04f27-acd7-489d-872f-1d68f7535e33'), | ||
utterance?: string(name='Utterance', description='This parameter is required.', nullable=false), | ||
vendorParam?: string(name='VendorParam'), | ||
workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-g7jspxljq8k909h3'), | ||
} | ||
|
||
model SseChatResponseBody = { | ||
code?: string(name='Code', example='200'), | ||
data?: any(name='Data'), | ||
message?: string(name='Message', example='success'), | ||
requestId?: string(name='RequestId', example='30D68C4C-4512-58A7-A328-568015B39A02'), | ||
success?: boolean(name='Success', example='True'), | ||
} | ||
|
||
model SseChatResponse = { | ||
headers?: map[string]string(name='headers'), | ||
statusCode?: int32(name='statusCode'), | ||
body?: SseChatResponseBody(name='body'), | ||
} | ||
|
||
/** | ||
* @summary SSE问答接口 | ||
* | ||
* @param request SseChatRequest | ||
* @param runtime runtime options for this request RuntimeOptions | ||
* @return SseChatResponse | ||
*/ | ||
async function sseChatWithOptions(request: SseChatRequest, runtime: Util.RuntimeOptions): SseChatResponse { | ||
Util.validateModel(request); | ||
var query = {}; | ||
if (!Util.isUnset(request.appId)) { | ||
query['AppId'] = request.appId; | ||
} | ||
if (!Util.isUnset(request.command)) { | ||
query['Command'] = request.command; | ||
} | ||
if (!Util.isUnset(request.senderId)) { | ||
query['SenderId'] = request.senderId; | ||
} | ||
if (!Util.isUnset(request.senderNick)) { | ||
query['SenderNick'] = request.senderNick; | ||
} | ||
if (!Util.isUnset(request.sessionId)) { | ||
query['SessionId'] = request.sessionId; | ||
} | ||
if (!Util.isUnset(request.utterance)) { | ||
query['Utterance'] = request.utterance; | ||
} | ||
if (!Util.isUnset(request.vendorParam)) { | ||
query['VendorParam'] = request.vendorParam; | ||
} | ||
if (!Util.isUnset(request.workspaceId)) { | ||
query['WorkspaceId'] = request.workspaceId; | ||
} | ||
var req = new OpenApi.OpenApiRequest{ | ||
query = OpenApiUtil.query(query), | ||
}; | ||
var params = new OpenApi.Params{ | ||
action = 'SseChat', | ||
version = '2024-11-05', | ||
protocol = 'HTTPS', | ||
pathname = '/', | ||
method = 'POST', | ||
authType = 'AK', | ||
style = 'RPC', | ||
reqBodyType = 'formData', | ||
bodyType = 'json', | ||
}; | ||
if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) { | ||
return callApi(params, req, runtime); | ||
} else { | ||
return execute(params, req, runtime); | ||
} | ||
} | ||
|
||
/** | ||
* @summary SSE问答接口 | ||
* | ||
* @param request SseChatRequest | ||
* @return SseChatResponse | ||
*/ | ||
async function sseChat(request: SseChatRequest): SseChatResponse { | ||
var runtime = new Util.RuntimeOptions{}; | ||
return sseChatWithOptions(request, runtime); | ||
} | ||
|
Oops, something went wrong.