devika icon indicating copy to clipboard operation
devika copied to clipboard

added web interface, gemini 1.0, 1.5, duckduckgo, google search api, bun install in setup.sh

Open nalaso opened this issue 10 months ago • 10 comments

This pull request makes the following changes.

  • Added gemini 1.0, 1.5 support
  • Added duckduckgo web search support
  • changed npm install to bun install in setup.sh

Solved the following issue #97 #65 #71 #35 #6

second commit

  • Added support for google search api
  • Corrected set_gemini_api_key

Solved the following issue #90 #38

Edit new

Also made the following changes.

  • Added support for web_search interface
  1. to change web_search value using config file change WEB_SEARCH in config.toml accepted values - google|bing|ddgs

  2. to change web_search value using cmd python devika.py --websearch <type> replace with google|bing|ddgs

python devika.py uses ddgs as default

  1. to change web_search value using api request in /api/execute-agent pass web_search along with other data
  • Also corrected the error caused while using ollama local models

changed "ollama" to "client" in inference function

nalaso avatar Mar 24 '24 04:03 nalaso

Gemini Working 👍

sumit171204 avatar Mar 24 '24 10:03 sumit171204

Does system check presence of at least one api-key for DuckDuckGO \ Bing \ Google? would be good to have some system message in console " api key for X found, search via X will be used"

MaksymSofer avatar Mar 24 '24 12:03 MaksymSofer

System does not check for any one api, you have to select the model , it will be good to have a console message so we can check if the api keys are working properly or not.

On Sun, 24 Mar 2024 at 17:43, MaksymSofer @.***> wrote:

Does system check presence of at least one api-key for DuckDuckGO \ Bing
Google? would be good to have some system message in console " api key for X found, search via X will be used"

— Reply to this email directly, view it on GitHub https://github.com/stitionai/devika/pull/99#issuecomment-2016789574, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARC6PYEPEXG4LHHVPQPSCJ3YZ2YPJAVCNFSM6AAAAABFFI5B66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWG44DSNJXGQ . You are receiving this because you commented.Message ID: @.***>

sumit171204 avatar Mar 24 '24 12:03 sumit171204

thanks u, it is working

Ahmet0691 avatar Mar 26 '24 12:03 Ahmet0691

Devika won't start - what could be the problem?

24.03.28 20:13:01: root: INFO : /api/token-usage GET 24.03.28 20:13:01: root: DEBUG : /api/token-usage GET - Response: { "token_usage": 0 }

24.03.28 20:13:01: root: INFO : /api/project-list GET 24.03.28 20:13:01: root: DEBUG : /api/project-list GET - Response: { "projects": [ "Test01", "Test02" ] }

24.03.28 20:13:01: root: INFO : /api/model-list GET 24.03.28 20:13:01: root: DEBUG : /api/model-list GET - Response: { "models": [ [ "Claude 3 Opus", "claude-3-opus-20240229" ], [ "Claude 3 Sonnet", "claude-3-sonnet-20240229" ], [ "Claude 3 Haiku", "claude-3-haiku-20240307" ], [ "GPT-4 Turbo", "gpt-4-0125-preview" ], [ "GPT-3.5", "gpt-3.5-turbo-0125" ], [ "Gemini 1.0 Pro", "gemini-1.0-pro" ], [ "Gemini 1.5 Pro", "gemini-1.5-pro" ] ] }

24.03.28 20:13:01: root: INFO : /api/get-agent-state POST 24.03.28 20:13:01: root: DEBUG : /api/get-agent-state POST - Response: { "state": null }

24.03.28 20:13:01: root: INFO : /api/get-messages POST 24.03.28 20:13:01: root: DEBUG : /api/get-messages POST - Response: { "messages": [ { "from_devika": false, "message": "\u0447\u0435\u043c \u043c\u043e\u0436\u0435\u0448\u044c \u043f\u043e\u043c\u043e\u0447\u044c ", "timestamp": "2024-03-28 20:04:37" }, { "from_devika": false, "message": "\u0447\u0435\u043c \u043c\u043e\u0436\u0435\u0448\u044c \u043f\u043e\u043c\u043e\u0447\u044c", "timestamp": "2024-03-28 20:11:47" } ] }

AlTarV avatar Mar 28 '24 17:03 AlTarV

I'm new to Github - if I asked the wrong question - I apologize in advance.

AlTarV avatar Mar 28 '24 17:03 AlTarV

can u come to discord channel of devika

Ahmet0691 avatar Mar 28 '24 18:03 Ahmet0691

Would love to see duckduckgo working as well! Looking forward to when this is verified and merged in 🙏

TaylorBechard avatar Mar 28 '24 20:03 TaylorBechard

Solved conflict here so closing #246

nalaso avatar Mar 29 '24 12:03 nalaso

Also made the following changes.

  • Added support for web_search interface
  1. to change web_search value using config file change WEB_SEARCH in config.toml accepted values - google|bing|ddgs

  2. to change web_search value using cmd python devika.py --websearch <type> replace with google|bing|ddgs

python devika.py uses ddgs as default

  1. to change web_search value using api request in /api/execute-agent pass web_search along with other data
  • Also corrected the error caused while using ollama local models

changed "ollama" to "client" in inference function

nalaso avatar Mar 29 '24 13:03 nalaso

Thank you so much, I am merging this now! 🙌 ❤️

mufeedvh avatar Mar 30 '24 06:03 mufeedvh

Hi, Why is there no Gemini 1.5 pro available, only 1.0 ? image

Also, having this issue with gemini (the requests are all simple research)

Exception in thread Thread-3 (<lambda>):
Traceback (most recent call last):
  File "/home/nulled/miniconda3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/nulled/miniconda3/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/home/nulled/Downloads/LLM_Applications/devika/devika.py", line 96, in <lambda>
    thread = Thread(target=lambda: agent.execute(message, project_name))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nulled/Downloads/LLM_Applications/devika/src/agents/agent.py", line 347, in execute
    search_results = self.search_queries(queries, project_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nulled/Downloads/LLM_Applications/devika/src/agents/agent.py", line 113, in search_queries
    results[query] = self.formatter.execute(data, project_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nulled/Downloads/LLM_Applications/devika/src/agents/formatter/formatter.py", line 21, in execute
    response = self.llm.inference(raw_text, project_name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nulled/Downloads/LLM_Applications/devika/src/llm/llm.py", line 96, in inference
    response = model.inference(self.model_id, prompt).strip()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nulled/Downloads/LLM_Applications/devika/src/llm/gemini_client.py", line 14, in inference
    return response.text
           ^^^^^^^^^^^^^
  File "/home/nulled/Downloads/LLM_Applications/devika/.venv/lib/python3.11/site-packages/google/generativeai/types/generation_types.py", line 347, in text
    raise ValueError(
ValueError: The `response.text` quick accessor only works when the response contains a valid `Part`, but none was returned. Check the `candidate.safety_ratings` to see if the response was blocked.

nullnuller avatar Apr 15 '24 07:04 nullnuller