Comments (11)
请问具体报错是怎么样的呢?
from qwen-agent.
File "/Users/weiguoliao/exgit/Qwen-Agent/qwen_server/app.py", line 334, in bot
for chunk in response:
File "/Users/weiguoliao/exgit/Qwen-Agent/qwen_agent/llm/base.py", line 80, in chat_dashscope_stream
for trunk in response:
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/dashscope/aigc/generation.py", line 113, in
return (GenerationResponse.from_api_response(rsp)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/dashscope/api_entities/http_request.py", line 77, in
return (item for item in response)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/dashscope/api_entities/http_request.py", line 225, in _handle_request
raise e
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/dashscope/api_entities/http_request.py", line 208, in _handle_request
response = session.post(url=self.url,
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/Users/weiguoliao/miniconda3/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/weiguoliao/miniconda3/lib/python3.10/http/client.py", line 1323, in _send_request
self.putheader(hdr, value)
File "/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/urllib3/connection.py", line 224, in putheader
_HTTPConnection.putheader(self, header, *values)
File "/Users/weiguoliao/miniconda3/lib/python3.10/http/client.py", line 1255, in putheader
values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u201c' in position 7: ordinal not in range(256)
/Users/weiguoliao/miniconda3/lib/python3.10/site-packages/gradio/helpers.py:818: UserWarning: Using the update method is deprecated. Simply return a new object instead, e.g. return gr.Textbox(...)
instead of return gr.update(...) warnings.warn( /Users/weiguoliao/miniconda3/lib/python3.10/site-packages/gradio/components/textbox.py:163: UserWarning: Using the update method is deprecated. Simply return a new object instead, e.g.
return gr.Textbox(...)instead of
return gr.Textbox.update(...)`.
warnings.warn(
from qwen-agent.
agent跑Mac上,跟平台应该没关系
from qwen-agent.
我曾经见过类似的报错( https://stackoverflow.com/a/76278687 ),当时的情况是用户配置API_KEY的时候误输入了中文的双引号导致的。请确保您指定DASHSCOPE_API_KEY没有输入中文字符(实际上,英文双引号可能也是不需要的)。
比如,请写成:
export DASHSCOPE_API_KEY=sk-this-is-a-fake-api-12345
不要写成(含中文的双引号):
export DASHSCOPE_API_KEY=“sk-this-is-a-fake-api-12345”
如果还不能解决,请尝试升级dashscope版本:
pip install "dashscope>=1.11.0"
from qwen-agent.
谢谢,APIKEY的问题解决了,但是,出现下面问题
Loading model from cache /var/folders/x0/pbvvtc5n4s1gq1jh0hfpz02h0000gn/T/jieba.cache
Loading model cost 0.312 seconds.
Prefix dict has been built successfully.
wordlist: ['你好']
wordlist: ['你好']
2
2
Now using dashscope api
Error code: DataInspectionFailed, error message: Input data may contain inappropriate content.
错误码: 数据检查失败,错误信息: 输入数据可能包含不适当的内容。
版本是最新的
pip list|grep dash
dashscope 1.11.0
from qwen-agent.
谢谢,APIKEY的问题解决了,但是,出现下面问题
Loading model from cache /var/folders/x0/pbvvtc5n4s1gq1jh0hfpz02h0000gn/T/jieba.cache Loading model cost 0.312 seconds. Prefix dict has been built successfully. wordlist: ['你好'] wordlist: ['你好'] 2 2 Now using dashscope api Error code: DataInspectionFailed, error message: Input data may contain inappropriate content. 错误码: 数据检查失败,错误信息: 输入数据可能包含不适当的内容。
版本是最新的
pip list|grep dash dashscope 1.11.0
这个应该是被平台的安全合规算法拦截了。产品初期比较谨慎,该算法可能较严,我正在反馈给相关同事。
from qwen-agent.
常见的被拦截的原因可能是因为网页、PDF的内容命中了一些特殊的关键词。我们还在看这部分体验怎么优化。
from qwen-agent.
可以了
from qwen-agent.
谢谢,APIKEY的问题解决了,但是,出现下面问题
Loading model from cache /var/folders/x0/pbvvtc5n4s1gq1jh0hfpz02h0000gn/T/jieba.cache Loading model cost 0.312 seconds. Prefix dict has been built successfully. wordlist: ['你好'] wordlist: ['你好'] 2 2 Now using dashscope api Error code: DataInspectionFailed, error message: Input data may contain inappropriate content. 错误码: 数据检查失败,错误信息: 输入数据可能包含不适当的内容。
版本是最新的
pip list|grep dash dashscope 1.11.0这个应该是被平台的安全合规算法拦截了。产品初期比较谨慎,该算法可能较严,我正在反馈给相关同事。
那请问被拦截了该怎么解决呢?
from qwen-agent.
可以了
你好请问你是怎么解决这个问题的呀?我的也一直敏感
from qwen-agent.
有什么避开敏感词的方法吗,或者敏感词不输出,但是程序不断开?
from qwen-agent.
Related Issues (20)
- llm的 function,支持 OpenAi 格式,具体是指什么? HOT 3
- 关于QWen模型是否支持一次性返回多个function_call的功能 HOT 4
- 天气预报助手这个案例中,如何配置对应的api key
- 想问下Assistant有没有方法直接返回工具结果,而不是将工具结果交由LLM,再由LLM生成最终结果? HOT 2
- 请教tools调用相关问题。
- 请问agent 能否支持类似langchain中显示intermediate step/scratchpad plan等功能?
- 私有云部署了chatglm3-6B模型,通过request.post(data)调用模型输出。这种调用方式如何适配到qwen-agent里? HOT 2
- 关于system_message和PROMPT_REACT的问题 HOT 1
- 提高Assistant知识检索速度的方法? HOT 1
- 您好,Mr,Ma。我想把代码转成非流式输出,模型输出了最终回复后报错,我看了下代码这里,拿到模型的output是如下形式,而代码里判断的却是是否是list形式。是不是对于非流式,对模型的输出还要做一定处理? HOT 5
- 您好,咨询一下,agent内部调用llm的_call_llm(...)是默认非流式调用,我要所有agent都换成非流式调用,有相关参考可以查看吗?需要修改Agent里的返回类型 HOT 1
- Move tools like `code_interpreter` in an optional package
- 确认一下function call微调所使用的chat_template
- 如何写prompt让ReActChat在调用code interpreter的时候,按照指定的步骤查询excel表格?
- 运行example报错 HOT 5
- 有什么措施可以使模型更稳定的调用插件 HOT 1
- [报错] 添加文件后,进行对话时报错 HOT 1
- 能支持langserve吗?
- 如何改写可以是的Agent可以非流式调用LLM,更改了后很多数据类型有错误。 HOT 1
- 关于sse返回结构, 这两种流式返回方式有区别吗? 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-agent.