Comments (5)
请将文件编码为base64提供在url位置,base64前面还需要提供数据头,比如上传jpg文件需要这样提供:
"url": "data:image/jpeg;base64,/9j/4AAQSkZJRgA..."
@332123342
from qwen-free-api.
目前的想到的办法是把本地文件先上传到github上,再去到url。。。
from qwen-free-api.
请将文件编码为base64提供在url位置,base64前面还需要提供数据头,比如上传jpg文件需要这样提供: "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgA..." @332123342
文件大小有几兆,这样有问题吗?
from qwen-free-api.
@332123342 没问题的,十几M的也传过
from qwen-free-api.
response = client.chat.completions.create(
model="qwen",
messages = [
{
"role": "user",
"content": [
{
"type": "file",
"file_url": {
"url": "data:text/plain;base64,aSBhbSBhIGdvb2QgYm95"
}
},
{
"type": "text",
"text": "上传的文档说了什么"
}
]
}
],
)
这样可以了,感谢🙏
update:
用base64上传的文档长度太长还是会报错。。。
from qwen-free-api.
Related Issues (20)
- qwen和kimi分开端口部署能同时使用吗? HOT 2
- vercel部署后出错 HOT 6
- 这是piao的通义哪个模型?qwen-max-longcontext可以用吗 HOT 1
- 使用账号的login_tongyi_ticket,这能避免通义的审查吗? HOT 1
- [请求qwen失败]: STRING_IS_BLANK-sessionId不能为空 HOT 2
- 小白没用过Docker部署,大佬们能给个详细教程吗? HOT 1
- login_tongyi_ticket 在那个文件里面设置的找了一圈没找到设置的地方 HOT 1
- 是不是方案失效了? HOT 1
- 没有找到login_tongyi_ticket HOT 1
- Stream response error: getaddrinfo EAI_AGAIN qianwen.biz.aliyun.com 怎么解决? HOT 2
- 接入应用异常 HOT 1
- 支持通义千问2.5版本的模型吗 HOT 2
- 卡在了vercel部署服务器。
- 项目是不是坏了?我已经部署到了vercel里,然后不管怎么样就是提示服务器超时(挂不上) HOT 1
- 暂时不用看了,项目挂了 HOT 1
- Not Work HOT 1
- 搭建完成,正常使用第二天之后被封号了 HOT 2
- AI绘图返回“内容由于合规问题已被阻止生成” HOT 1
- 看介绍说可以用dify HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qwen-free-api.