Mintplex-Labs / anythingllm-docs

Documentation of AnythingLLM by Mintplex Labs Inc.
https://anythingllm-docs.vercel.app
MIT License
52 stars 15 forks source link

Agent is not returning Google Programmable Search Engine Results #31

Closed stewfarq closed 1 month ago

stewfarq commented 1 month ago

I have configured the Google Programmable Search Engine (https://programmablesearchengine.google.com/controlpanel) to obtain a new Search Engine ID. I have then scrolled down this page to the Programmatic access section and used the Get started button of the "Custom Search JSON API" to get the API key.

However, when following your web tutorial at https://www.youtube.com/watch?v=4UFrVvy7VlA (10:45) and using"@agent Can you scrape..." The agent is invoked and swaps over to chat, but then immediately the agent ends without scraping/returning its response as shown in this video.

Is there a log file to check what the error is? e.g. have I configured Google PSE correctly to initiate a web scrape request/response?

I have tried this with Anything 1.5.5 and with LM Studio 0.2.23 and Ollama 0.1.32 with llama3:8b-instruct-q8-0 model.

timothycarambat commented 1 month ago

Does the chat start and then just says agent session ended?

stewfarq commented 1 month ago

yes @timothycarambat

stewfarq commented 1 month ago

On page https://developers.google.com/custom-search/v1/introduction, this is where I Get a Key. It asks me to Create a New Project and then gives me the API key. Is this the correct process to get the correct Custom Search API key for AnythingLLM?

This API key invokes an HTTP Request with "GET https://customsearch.googleapis.com/customsearch/v1".

timothycarambat commented 1 month ago

@stewfarq Yes, I do not think your issue is an invalid GoogleSearch credential. You did not fill out the issue template using a preset so I have very little context on how you are using AnythingLLM (Docker, Local, Desktop) so I cannot provide much assistance until I know those details - that is why we have those templates!

stewfarq commented 1 month ago

@timothycarambat - apologies, I have not raised an issue before within github. I cannot see where the issue template is within github. Is there a URL? I installed and use AnythingLLM on a Windows11 Pro desktop installed as a desktop application. I installed Ollama and LM Studio also as local Windows applications (without Docker). I am a UK user and use and registered with Google as a googlemail.com user.

timothycarambat commented 1 month ago

@stewfarq I just realized this issue is on the wrong repo! It should be on https://github.com/Mintplex-Labs/anything-llm

In general, the reason that you agent may not call a function directly is due to just how agents work. Some LLMs that are less adept at tool calling can refuse to call a tool even when given instructions with explicit examples. This is why we recommend 8-bit quantized models when using OSS LLM, because they tend to be better at instruction-following.

That being said, Im going to close the issue on this repo, but we can continue the conversation in this thread. There is a way to run the application in debug mode on Windows - which will tell you what the error is most likely.

First, make sure you are on latest version (1.5.5) Next, you can open Powershell and run C:\Users\usr\AppData\Local\Programs\anythingllm-desktop\AnythingLLMDesktop.exe

This will start the app as normal, but that terminal window will start printing out logs. Try to invoke an @agent chat and an error log should print into the window.