volcengine / volcengine-python-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
如果可以有案例吗?
Macos操作系统安装sdk报错
Collecting volcengine-python-sdk
Downloading volcengine-python-sdk-1.0.38.tar.gz (932 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 932.1/932.1 kB 759.5 kB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
/usr/local/Cellar/[email protected]/3.8.13_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
/usr/local/Cellar/[email protected]/3.8.13_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'egg_info'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
你好,请问模型 API 仅对企业开发吗?
API 文档:https://www.volcengine.com/docs/82379/1263279
注意
- API key 具有使用时限,过期后请重新获取;
- 需要先获取推理接入点(Endpoint)的读权限才能使用您的AK SK 换取API key。
控制台限制了仅企业认证可访问:https://console.volcengine.com/ark
conda新建环境pip install 'volcengine-python-sdk[ark]'
安装对应包时出现下列报错:
py -> build\bdist.win-amd64\wheel.\volcenginesdkprivatelink\models
copying build\lib\volcenginesdkprivatelink\models\private_dns_name_configuration_for_describe_vpc_endpoint_services_by_end_user_output.py -> build\bdist.win-amd64\wheel.\volcenginesdkprivatelink\models
error: could not create 'build\bdist.win-amd64\wheel.\volcenginesdkprivatelink\models\private_dns_name_configuration_for_describe_vpc_endpoint_services_by_end_user_output.py': No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for volcengine-python-sdk
Running setup.py clean for volcengine-python-sdk
Failed to build volcengine-python-sdk
ERROR: Could not build wheels for volcengine-python-sdk, which is required to install pyproject.toml-based projects
包里的文件名太长,在win11下pip 安装失败,报错如下。
手动修改了注册表下边这个键之后,安装成成功了。
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem路径下的变量 LongPathsEnabled, 将其置为 1即可.
我的系统是:
版本 Windows 11 家庭版
版本号 23H2
安装日期 2023/2/1
操作系统版本 22631.3672
体验 Windows Feature Experience Pack 1000.22700.1009.0
```
报错如下:
```
telink\models
copying build\lib\volcenginesdkprivatelink\models\modify_vpc_gateway_endpoint_attributes_request.py -> build\bdist.win-amd64\wheel\.\volcenginesdkprivatelink\models
copying build\lib\volcenginesdkprivatelink\models\modify_vpc_gateway_endpoint_attributes_response.py -> build\bdist.win-amd64\wheel\.\volcenginesdkprivatelink\models
copying build\lib\volcenginesdkprivatelink\models\permission_for_describe_vpc_endpoint_service_permissions_output.py -> build\bdist.win-amd64\wheel\.\volcenginesdkprivatelink\models
copying build\lib\volcenginesdkprivatelink\models\private_dns_name_configuration_for_describe_vpc_endpoint_services_by_end_user_output.py -> build\bdist.win-amd64\wheel\.\volcenginesdkprivatelink\models
error: could not create 'build\bdist.win-amd64\wheel\.\volcenginesdkprivatelink\models\private_dns_name_configuration_for_describe_vpc_endpoint_services_by_end_user_output.py': No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for volcengine-python-sdk
Running setup.py clean for volcengine-python-sdk
Failed to build volcengine-python-sdk
ERROR: Could not build wheels for volcengine-python-sdk, which is required to install pyproject.toml-based projects
```
无法彻底关掉 log 的显示,导致 sdk 和 app 的 log 混杂在一起
能够关闭 log 显示。
Doubao PRO - 32
def read(image_path):
client = Ark(api_key=DOUBAO_API_KEY)
print("----- standard request -----")
base64_image = encode_image(image_path)
completion = client.chat.completions.create(
model="ep-20240618134341-vkc7n",
user="user",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "What’s in this image?"
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}"
}
}
]
}
]
)
print(completion.choices[0].message.content)
Traceback (most recent call last):
File "/Users/nick/Develop/aigc/NickBooking/main.py", line 25, in <module>
read_doubao()
File "/Users/nick/Develop/aigc/NickBooking/main.py", line 18, in read_doubao
doubao_client.read(IMAGE_PATH)
File "/Users/nick/Develop/aigc/NickBooking/doubao/doubao_client.py", line 18, in read
completion = client.chat.completions.create(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_utils/_utils.py", line 64, in wrapper
return func(*args, **kwargs)
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/resources/chat/completions.py", line 68, in create
return self._post(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 555, in post
ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 567, in request
return self._request(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 453, in _request
return self._retry_request(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 502, in _retry_request
return self._request(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 453, in _request
return self._retry_request(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 502, in _retry_request
return self._request(
File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 468, in _request
raise self._make_status_error_from_response(
volcenginesdkarkruntime._exceptions.ArkInternalServerError: Error code: 500 - {'error': {'code': 'InternalServiceError', 'message': 'The service encountered an unexpected internal error.', 'param': '', 'type': 'InternalServiceError'}}, request_id: 202406182215334Ynl34GqiFBsXauqeWur
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.