diff --git a/README.md b/README.md index 4c975c3..f9faead 100644 --- a/README.md +++ b/README.md @@ -159,9 +159,9 @@ Set the desired provider in the `config.ini`. See below for a list of API provid ```sh [MAIN] is_local = False -provider_name = openai -provider_model = gpt-4o -provider_server_address = 127.0.0.1:5000 +provider_name = google +provider_model = gemini-2.0-flash +provider_server_address = 127.0.0.1:5000 # doesn't matter ``` Warning: Make sure there is not trailing space in the config. @@ -179,6 +179,8 @@ Example: export `TOGETHER_API_KEY="xxxxx"` | togetherAI | No | Use together AI API (non-private) | | google | No | Use google gemini API (non-private) | +*We advice against using gpt-4o or other closedAI models*, performance are poor for web browsing and task planning. + Next step: [Start services and run AgenticSeek](#Start-services-and-Run) *See the **Known issues** section if you are having issues* diff --git a/sources/agents/planner_agent.py b/sources/agents/planner_agent.py index afb91d2..2b6a34c 100644 --- a/sources/agents/planner_agent.py +++ b/sources/agents/planner_agent.py @@ -151,7 +151,7 @@ class PlannerAgent(Agent): return [] agents_tasks = self.parse_agent_tasks(answer) if agents_tasks == []: - prompt = f"Failed to parse the tasks. Please make a plan within ```json. Do not ask for clarification.\n" + prompt = f"Failed to parse the tasks. Please write down your task followed by a json plan within ```json. Do not ask for clarification.\n" pretty_print("Failed to make plan. Retrying...", color="warning") continue self.show_plan(agents_tasks, answer) diff --git a/sources/llm_provider.py b/sources/llm_provider.py index 4b55bcb..32b8279 100644 --- a/sources/llm_provider.py +++ b/sources/llm_provider.py @@ -72,6 +72,8 @@ class Provider: except ModuleNotFoundError as e: raise ModuleNotFoundError(f"{str(e)}\nA import related to provider {self.provider_name} was not found. Is it installed ?") except Exception as e: + if "try again later" in str(e).lower(): + return f"{self.provider_name} server is overloaded. Please try again later." if "refused" in str(e): return f"Server {self.server_ip} seem offline. Unable to answer." raise Exception(f"Provider {self.provider_name} failed: {str(e)}") from e @@ -214,7 +216,7 @@ class Provider: """ base_url = self.server_ip if self.is_local: - raise Exception("Google Gemini is not available for local use.") + raise Exception("Google Gemini is not available for local use. Change config.ini") client = OpenAI(api_key=self.api_key, base_url="https://generativelanguage.googleapis.com/v1beta/openai/") try: @@ -237,6 +239,8 @@ class Provider: """ from together import Together client = Together(api_key=self.api_key) + if self.is_local: + raise Exception("Together AI is not available for local use. Change config.ini") try: response = client.chat.completions.create( @@ -257,6 +261,8 @@ class Provider: Use deepseek api to generate text. """ client = OpenAI(api_key=self.api_key, base_url="https://api.deepseek.com") + if self.is_local: + raise Exception("Deepseek (API) is not available for local use. Change config.ini") try: response = client.chat.completions.create( model="deepseek-chat", diff --git a/sources/tools/tools.py b/sources/tools/tools.py index 3b71a5f..e3b5b86 100644 --- a/sources/tools/tools.py +++ b/sources/tools/tools.py @@ -14,7 +14,7 @@ For example: print("Hello world") ``` This is then executed by the tool with its own class implementation of execute(). -A tool is not just for code tool but also API, internet, etc.. +A tool is not just for code tool but also API, internet search, MCP, etc.. """ import sys diff --git a/tests/test_browser_agent_parsing.py b/tests/test_browser_agent_parsing.py index e8c5b9f..aac95bc 100644 --- a/tests/test_browser_agent_parsing.py +++ b/tests/test_browser_agent_parsing.py @@ -17,13 +17,13 @@ class TestBrowserAgentParsing(unittest.TestCase): # Test various link formats test_text = """ Check this out: https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of, and www.google.com! - Also try https://test.org/about?page=1, hey this one as well bro https://weatherstack.com/documentation. + Also try https://test.org/about?page=1, hey this one as well bro https://weatherstack.com/documentation/. """ expected = [ "https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of", "www.google.com", "https://test.org/about?page=1", - "https://weatherstack.com/documentation" + "https://weatherstack.com/documentation", ] result = self.agent.extract_links(test_text) self.assertEqual(result, expected)