Open NicoleRR opened 4 months ago
I had the same problem. You are probably using AsyncHtml or another library that has html settings. I looked it up and maybe it's a request regarding the browser. In POST or GET requests, we have a header, and in this a user-agent with settings such as Chrome, Mozila and others. So I think this is a way to solve the problem, but I haven't solved it yet. if you are not using the asyncHtml library, just remove this import
i changed in langchain_community>utils>user_agent.py for workaround in if code block added else statement to get default value
我遇到了同样的问题,请问有解决办法吗?
import os os.environ['USER_AGENT'] = 'myagent'
导入操作系统 os.environ['USER_AGENT'] = 'myagent'
好的,非常感谢,这解决了我的问题
import os os.environ['USER_AGENT'] = 'myagent'
This solved my problem.
import os os.environ['USER_AGENT'] = 'myagent'
it is not working with me in streamlit
I don't know why, when i set USER_AGENT=MyCustomAgent/1.0 inside .env then not working but when I run export USER_AGENT="MyCustomAgent/1.0" on terminal it works
import os os.environ['USER_AGENT'] = 'myagent'
it is not working with me in streamlit
Having same issue as Mooo49 - would appreciate any help!
import os os.environ['USER_AGENT'] = 'myagent'
it is not working with me in streamlit
Having same issue as Mooo49 - would appreciate any help!
Try adding USER_AGENT=myagent
in .env
file. It worked for me.
I tried using the following code to set the environment variable:
import os
os.environ['USER_AGENT'] = 'myagent'
However, it didn’t work for me. When I added USER_AGENT="myagent"
to the .env file instead, it worked! Now, my code no longer throws the USER_AGENT
error, but it still isn’t producing any output. I'm running this in a Jupyter Notebook, and the code seems to be stuck, running indefinitely without stopping.
Hi @ronbruce. is your code using a local or remote agent? If you are sure the agent itself is working then it could be the jupyter notebook itself. I am using jupyter-notebook and encountered similar issues. Try shutting down all(or just the notebook in question) kernels from the left sidebar. I am using the os
module to set USER_AGENT and it did not work until I restarted the kernel.
I am using a local agent. It worked!! Thank you so much, @ferrinheight.
when I run first step, it says I don't set USER_AGENT.I don't konw how to set it ,just use langchain1.0 or other ways.