Skip to content

Commit e80beec

Browse files
committed
Generated python 2024-11-05 for BailianChatBot.
1 parent 20d9a53 commit e80beec

File tree

11 files changed

+612
-0
lines changed

11 files changed

+612
-0
lines changed

bailianchatbot-20241105/.gitignore

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# OS
2+
.DS_Store
3+
4+
# IDE
5+
.idea
6+
.settings
7+
.cache/
8+
.tmp
9+
.vscode/
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
pip-wheel-metadata/
34+
share/python-wheels/
35+
*.egg-info/
36+
.installed.cfg
37+
*.egg
38+
MANIFEST
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.coverage
55+
.hypothesis/
56+
.pytest_cache/
57+
pytestdebug.log
58+
59+
# Sphinx documentation
60+
docs/_build/
61+
62+
# PyBuilder
63+
target/
64+
65+
# pyenv
66+
.python-version
67+
68+
# Environments
69+
.env
70+
.venv
71+
env/
72+
venv/
73+
ENV/
74+
env.bak/
75+
venv.bak/
76+
77+
# Pyre type checker
78+
.pyre/
79+
80+
# pytype static type analyzer
81+
.pytype/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2025-03-07 Version: 1.0.0
2+
- Generated python 2024-11-05 for BailianChatBot.
3+

bailianchatbot-20241105/LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include LICENSE
2+
include *.md
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[English](README.md) | 简体中文
2+
3+
![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
4+
5+
## Alibaba Cloud BailianChatBot SDK for Python
6+
7+
## 要求
8+
9+
- Python >= 3.7
10+
11+
## 安装
12+
13+
- **使用 pip 安装(推荐)**
14+
15+
如未安装 `pip`, 请先至pip官网 [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") 安装pip .
16+
17+
```bash
18+
# 安装 alibabacloud_bailianchatbot20241105
19+
pip install alibabacloud_bailianchatbot20241105
20+
```
21+
22+
## 问题
23+
24+
[提交 Issue](https://github.com/aliyun/alibabacloud-python-sdk/issues/new),不符合指南的问题可能会立即关闭。
25+
26+
## 使用说明
27+
28+
[快速使用](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/docs/0-Usage-CN.md#%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8)
29+
30+
## 发行说明
31+
32+
每个版本的详细更改记录在[发行说明](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/bailianchatbot-20241105/ChangeLog.md)中。
33+
34+
## 相关
35+
36+
- [最新源码](https://github.com/aliyun/alibabacloud-python-sdk/)
37+
38+
## 许可证
39+
40+
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
41+
42+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

bailianchatbot-20241105/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
English | [简体中文](README-CN.md)
2+
![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
3+
4+
## Alibaba Cloud BailianChatBot SDK for Python
5+
6+
## Requirements
7+
8+
- Python >= 3.7
9+
10+
## Installation
11+
12+
- **Install with pip**
13+
14+
Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
15+
16+
```bash
17+
# Install the alibabacloud_bailianchatbot20241105
18+
pip install alibabacloud_bailianchatbot20241105
19+
```
20+
21+
## Issues
22+
23+
[Opening an Issue](https://github.com/aliyun/alibabacloud-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
24+
25+
## Usage
26+
27+
[Quick Examples](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/docs/0-Usage-EN.md#quick-examples)
28+
29+
## Changelog
30+
31+
Detailed changes for each release are documented in the [release notes](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/bailianchatbot-20241105/ChangeLog.md).
32+
33+
## References
34+
35+
- [Latest Release](https://github.com/aliyun/alibabacloud-sdk/tree/master/python)
36+
37+
## License
38+
39+
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
40+
41+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '1.0.0'
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# -*- coding: utf-8 -*-
2+
# This file is auto-generated, don't edit it. Thanks.
3+
from typing import Dict
4+
from Tea.core import TeaCore
5+
6+
from alibabacloud_tea_openapi.client import Client as OpenApiClient
7+
from alibabacloud_tea_openapi import models as open_api_models
8+
from alibabacloud_tea_util.client import Client as UtilClient
9+
from alibabacloud_endpoint_util.client import Client as EndpointUtilClient
10+
from alibabacloud_bailianchatbot20241105 import models as bailian_chat_bot_20241105_models
11+
from alibabacloud_tea_util import models as util_models
12+
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient
13+
14+
15+
class Client(OpenApiClient):
16+
"""
17+
*\
18+
"""
19+
def __init__(
20+
self,
21+
config: open_api_models.Config,
22+
):
23+
super().__init__(config)
24+
self._endpoint_rule = ''
25+
self.check_config(config)
26+
self._endpoint = self.get_endpoint('bailianchatbot', self._region_id, self._endpoint_rule, self._network, self._suffix, self._endpoint_map, self._endpoint)
27+
28+
def get_endpoint(
29+
self,
30+
product_id: str,
31+
region_id: str,
32+
endpoint_rule: str,
33+
network: str,
34+
suffix: str,
35+
endpoint_map: Dict[str, str],
36+
endpoint: str,
37+
) -> str:
38+
if not UtilClient.empty(endpoint):
39+
return endpoint
40+
if not UtilClient.is_unset(endpoint_map) and not UtilClient.empty(endpoint_map.get(region_id)):
41+
return endpoint_map.get(region_id)
42+
return EndpointUtilClient.get_endpoint_rules(product_id, region_id, endpoint_rule, network, suffix)
43+
44+
def sse_chat_with_options(
45+
self,
46+
request: bailian_chat_bot_20241105_models.SseChatRequest,
47+
runtime: util_models.RuntimeOptions,
48+
) -> bailian_chat_bot_20241105_models.SseChatResponse:
49+
"""
50+
@summary SSE问答接口
51+
52+
@param request: SseChatRequest
53+
@param runtime: runtime options for this request RuntimeOptions
54+
@return: SseChatResponse
55+
"""
56+
UtilClient.validate_model(request)
57+
query = {}
58+
if not UtilClient.is_unset(request.app_id):
59+
query['AppId'] = request.app_id
60+
if not UtilClient.is_unset(request.command):
61+
query['Command'] = request.command
62+
if not UtilClient.is_unset(request.sender_id):
63+
query['SenderId'] = request.sender_id
64+
if not UtilClient.is_unset(request.sender_nick):
65+
query['SenderNick'] = request.sender_nick
66+
if not UtilClient.is_unset(request.session_id):
67+
query['SessionId'] = request.session_id
68+
if not UtilClient.is_unset(request.utterance):
69+
query['Utterance'] = request.utterance
70+
if not UtilClient.is_unset(request.vendor_param):
71+
query['VendorParam'] = request.vendor_param
72+
if not UtilClient.is_unset(request.workspace_id):
73+
query['WorkspaceId'] = request.workspace_id
74+
req = open_api_models.OpenApiRequest(
75+
query=OpenApiUtilClient.query(query)
76+
)
77+
params = open_api_models.Params(
78+
action='SseChat',
79+
version='2024-11-05',
80+
protocol='HTTPS',
81+
pathname='/',
82+
method='POST',
83+
auth_type='AK',
84+
style='RPC',
85+
req_body_type='formData',
86+
body_type='json'
87+
)
88+
if UtilClient.is_unset(self._signature_version) or not UtilClient.equal_string(self._signature_version, 'v4'):
89+
return TeaCore.from_map(
90+
bailian_chat_bot_20241105_models.SseChatResponse(),
91+
self.call_api(params, req, runtime)
92+
)
93+
else:
94+
return TeaCore.from_map(
95+
bailian_chat_bot_20241105_models.SseChatResponse(),
96+
self.execute(params, req, runtime)
97+
)
98+
99+
async def sse_chat_with_options_async(
100+
self,
101+
request: bailian_chat_bot_20241105_models.SseChatRequest,
102+
runtime: util_models.RuntimeOptions,
103+
) -> bailian_chat_bot_20241105_models.SseChatResponse:
104+
"""
105+
@summary SSE问答接口
106+
107+
@param request: SseChatRequest
108+
@param runtime: runtime options for this request RuntimeOptions
109+
@return: SseChatResponse
110+
"""
111+
UtilClient.validate_model(request)
112+
query = {}
113+
if not UtilClient.is_unset(request.app_id):
114+
query['AppId'] = request.app_id
115+
if not UtilClient.is_unset(request.command):
116+
query['Command'] = request.command
117+
if not UtilClient.is_unset(request.sender_id):
118+
query['SenderId'] = request.sender_id
119+
if not UtilClient.is_unset(request.sender_nick):
120+
query['SenderNick'] = request.sender_nick
121+
if not UtilClient.is_unset(request.session_id):
122+
query['SessionId'] = request.session_id
123+
if not UtilClient.is_unset(request.utterance):
124+
query['Utterance'] = request.utterance
125+
if not UtilClient.is_unset(request.vendor_param):
126+
query['VendorParam'] = request.vendor_param
127+
if not UtilClient.is_unset(request.workspace_id):
128+
query['WorkspaceId'] = request.workspace_id
129+
req = open_api_models.OpenApiRequest(
130+
query=OpenApiUtilClient.query(query)
131+
)
132+
params = open_api_models.Params(
133+
action='SseChat',
134+
version='2024-11-05',
135+
protocol='HTTPS',
136+
pathname='/',
137+
method='POST',
138+
auth_type='AK',
139+
style='RPC',
140+
req_body_type='formData',
141+
body_type='json'
142+
)
143+
if UtilClient.is_unset(self._signature_version) or not UtilClient.equal_string(self._signature_version, 'v4'):
144+
return TeaCore.from_map(
145+
bailian_chat_bot_20241105_models.SseChatResponse(),
146+
await self.call_api_async(params, req, runtime)
147+
)
148+
else:
149+
return TeaCore.from_map(
150+
bailian_chat_bot_20241105_models.SseChatResponse(),
151+
await self.execute_async(params, req, runtime)
152+
)
153+
154+
def sse_chat(
155+
self,
156+
request: bailian_chat_bot_20241105_models.SseChatRequest,
157+
) -> bailian_chat_bot_20241105_models.SseChatResponse:
158+
"""
159+
@summary SSE问答接口
160+
161+
@param request: SseChatRequest
162+
@return: SseChatResponse
163+
"""
164+
runtime = util_models.RuntimeOptions()
165+
return self.sse_chat_with_options(request, runtime)
166+
167+
async def sse_chat_async(
168+
self,
169+
request: bailian_chat_bot_20241105_models.SseChatRequest,
170+
) -> bailian_chat_bot_20241105_models.SseChatResponse:
171+
"""
172+
@summary SSE问答接口
173+
174+
@param request: SseChatRequest
175+
@return: SseChatResponse
176+
"""
177+
runtime = util_models.RuntimeOptions()
178+
return await self.sse_chat_with_options_async(request, runtime)

0 commit comments

Comments
 (0)