langchain-ai / streamlit-agent

Reference implementations of several LangChain agents as Streamlit apps
Apache License 2.0
1.15k stars 581 forks source link

mrkl and search-and-chat examples not working #52

Open TastyMojito opened 3 months ago

TastyMojito commented 3 months ago

just tried the above mentioned two examples with my own freshly created openai api key and got error messages. one was:

duckduckgo_search.exceptions.DuckDuckGoSearchException: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app). [...]

TastyMojito commented 3 months ago

some further remarks: i refered to the example implementation given in the readme file. search-and-chat is working flawlessly on my machine.

kovla commented 2 months ago

Search-and-chat does not work for me as well. It is for a different reason, but it might under this issue still. There error is this, and may be related to recent updates to Langchain, perhaps?

AssertionError: The input to RunnablePassthrough.assign() must be a dict.
Traceback:
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
    exec(code, module.__dict__)
File "/home/user/streamlit/lc1/app.py", line 98, in <module>
    response = agent_with_chat_history.invoke(prompt,
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 4525, in invoke
    return self.bound.invoke(
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 4525, in invoke
    return self.bound.invoke(
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 2499, in invoke
    input = step.invoke(
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 4525, in invoke
    return self.bound.invoke(
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/passthrough.py", line 469, in invoke
    return self._call_with_config(self._invoke, input, config, **kwargs)
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 1626, in _call_with_config
    context.run(
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/config.py", line 347, in call_func_with_variable_args
    return func(input, **kwargs)  # type: ignore[call-arg]
File "/home/user/miniconda3/envs/shiny_py/lib/python3.10/site-packages/langchain_core/runnables/passthrough.py", line 450, in _invoke
    assert isinstance(