webscout 5.3__tar.gz → 5.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of webscout might be problematic. Click here for more details.

Files changed (107) hide show
  1. {webscout-5.3/webscout.egg-info → webscout-5.4}/PKG-INFO +37 -63
  2. {webscout-5.3 → webscout-5.4}/README.md +36 -47
  3. {webscout-5.3 → webscout-5.4}/setup.py +2 -17
  4. {webscout-5.3 → webscout-5.4}/webscout/AIauto.py +8 -12
  5. {webscout-5.3 → webscout-5.4}/webscout/Agents/Onlinesearcher.py +5 -5
  6. webscout-5.4/webscout/Agents/functioncall.py +198 -0
  7. webscout-5.4/webscout/Local/_version.py +3 -0
  8. {webscout-5.3 → webscout-5.4}/webscout/Provider/Andi.py +1 -21
  9. {webscout-5.3 → webscout-5.4}/webscout/Provider/BasedGPT.py +1 -21
  10. {webscout-5.3 → webscout-5.4}/webscout/Provider/Blackboxai.py +1 -21
  11. {webscout-5.3 → webscout-5.4}/webscout/Provider/Chatify.py +3 -2
  12. {webscout-5.3 → webscout-5.4}/webscout/Provider/Cloudflare.py +1 -22
  13. {webscout-5.3 → webscout-5.4}/webscout/Provider/Cohere.py +2 -23
  14. {webscout-5.3 → webscout-5.4}/webscout/Provider/DARKAI.py +0 -1
  15. {webscout-5.3 → webscout-5.4}/webscout/Provider/Deepinfra.py +2 -16
  16. {webscout-5.3 → webscout-5.4}/webscout/Provider/EDITEE.py +3 -26
  17. {webscout-5.3 → webscout-5.4}/webscout/Provider/Gemini.py +1 -24
  18. {webscout-5.3 → webscout-5.4}/webscout/Provider/Groq.py +0 -2
  19. {webscout-5.3 → webscout-5.4}/webscout/Provider/Koboldai.py +0 -21
  20. {webscout-5.3 → webscout-5.4}/webscout/Provider/Llama.py +4 -21
  21. {webscout-5.3 → webscout-5.4}/webscout/Provider/OLLAMA.py +0 -17
  22. {webscout-5.3 → webscout-5.4}/webscout/Provider/Openai.py +2 -22
  23. {webscout-5.3 → webscout-5.4}/webscout/Provider/Perplexity.py +1 -2
  24. webscout-5.4/webscout/Provider/Phind.py +503 -0
  25. {webscout-5.3 → webscout-5.4}/webscout/Provider/Reka.py +4 -21
  26. {webscout-5.3 → webscout-5.4}/webscout/Provider/TTS/streamElements.py +0 -17
  27. {webscout-5.3 → webscout-5.4}/webscout/Provider/TTS/voicepod.py +0 -1
  28. {webscout-5.3 → webscout-5.4}/webscout/Provider/ThinkAnyAI.py +17 -78
  29. {webscout-5.3 → webscout-5.4}/webscout/Provider/Youchat.py +3 -20
  30. {webscout-5.3 → webscout-5.4}/webscout/Provider/__init__.py +12 -5
  31. webscout-5.4/webscout/Provider/cleeai.py +212 -0
  32. webscout-5.4/webscout/Provider/elmo.py +237 -0
  33. {webscout-5.3 → webscout-5.4}/webscout/Provider/felo_search.py +4 -22
  34. webscout-5.4/webscout/Provider/geminiapi.py +198 -0
  35. webscout-5.4/webscout/Provider/genspark.py +222 -0
  36. {webscout-5.3 → webscout-5.4}/webscout/Provider/julius.py +3 -20
  37. {webscout-5.3 → webscout-5.4}/webscout/Provider/koala.py +1 -1
  38. webscout-5.4/webscout/Provider/lepton.py +194 -0
  39. {webscout-5.3 → webscout-5.4}/webscout/Provider/turboseek.py +4 -21
  40. {webscout-5.3 → webscout-5.4}/webscout/Provider/x0gpt.py +3 -2
  41. {webscout-5.3 → webscout-5.4}/webscout/Provider/xdash.py +2 -22
  42. webscout-5.4/webscout/Provider/yep.py +500 -0
  43. {webscout-5.3 → webscout-5.4}/webscout/YTdownloader.py +2 -3
  44. {webscout-5.3 → webscout-5.4}/webscout/version.py +1 -1
  45. {webscout-5.3 → webscout-5.4/webscout.egg-info}/PKG-INFO +37 -63
  46. {webscout-5.3 → webscout-5.4}/webscout.egg-info/SOURCES.txt +5 -0
  47. {webscout-5.3 → webscout-5.4}/webscout.egg-info/requires.txt +0 -15
  48. webscout-5.3/webscout/Agents/functioncall.py +0 -172
  49. webscout-5.3/webscout/Local/_version.py +0 -3
  50. webscout-5.3/webscout/Provider/Phind.py +0 -1008
  51. webscout-5.3/webscout/Provider/yep.py +0 -258
  52. {webscout-5.3 → webscout-5.4}/LICENSE.md +0 -0
  53. {webscout-5.3 → webscout-5.4}/setup.cfg +0 -0
  54. {webscout-5.3 → webscout-5.4}/webscout/AIbase.py +0 -0
  55. {webscout-5.3 → webscout-5.4}/webscout/AIutel.py +0 -0
  56. {webscout-5.3 → webscout-5.4}/webscout/Agents/__init__.py +0 -0
  57. {webscout-5.3 → webscout-5.4}/webscout/Agents/ai.py +0 -0
  58. {webscout-5.3 → webscout-5.4}/webscout/Bard.py +0 -0
  59. {webscout-5.3 → webscout-5.4}/webscout/Bing_search.py +0 -0
  60. {webscout-5.3 → webscout-5.4}/webscout/DWEBS.py +0 -0
  61. {webscout-5.3 → webscout-5.4}/webscout/Extra/__init__.py +0 -0
  62. {webscout-5.3 → webscout-5.4}/webscout/Extra/autollama.py +0 -0
  63. {webscout-5.3 → webscout-5.4}/webscout/Extra/gguf.py +0 -0
  64. {webscout-5.3 → webscout-5.4}/webscout/Extra/weather.py +0 -0
  65. {webscout-5.3 → webscout-5.4}/webscout/Extra/weather_ascii.py +0 -0
  66. {webscout-5.3 → webscout-5.4}/webscout/LLM.py +0 -0
  67. {webscout-5.3 → webscout-5.4}/webscout/Local/__init__.py +0 -0
  68. {webscout-5.3 → webscout-5.4}/webscout/Local/formats.py +0 -0
  69. {webscout-5.3 → webscout-5.4}/webscout/Local/model.py +0 -0
  70. {webscout-5.3 → webscout-5.4}/webscout/Local/rawdog.py +0 -0
  71. {webscout-5.3 → webscout-5.4}/webscout/Local/samplers.py +0 -0
  72. {webscout-5.3 → webscout-5.4}/webscout/Local/thread.py +0 -0
  73. {webscout-5.3 → webscout-5.4}/webscout/Local/utils.py +0 -0
  74. {webscout-5.3 → webscout-5.4}/webscout/Provider/AI21.py +0 -0
  75. {webscout-5.3 → webscout-5.4}/webscout/Provider/Deepseek.py +0 -0
  76. {webscout-5.3 → webscout-5.4}/webscout/Provider/DiscordRocks.py +0 -0
  77. {webscout-5.3 → webscout-5.4}/webscout/Provider/Farfalle.py +0 -0
  78. {webscout-5.3 → webscout-5.4}/webscout/Provider/Llama3.py +0 -0
  79. {webscout-5.3 → webscout-5.4}/webscout/Provider/NetFly.py +0 -0
  80. {webscout-5.3 → webscout-5.4}/webscout/Provider/PI.py +0 -0
  81. {webscout-5.3 → webscout-5.4}/webscout/Provider/PizzaGPT.py +0 -0
  82. {webscout-5.3 → webscout-5.4}/webscout/Provider/Poe.py +0 -0
  83. {webscout-5.3 → webscout-5.4}/webscout/Provider/RUBIKSAI.py +0 -0
  84. {webscout-5.3 → webscout-5.4}/webscout/Provider/TTI/PollinationsAI.py +0 -0
  85. {webscout-5.3 → webscout-5.4}/webscout/Provider/TTI/__init__.py +0 -0
  86. {webscout-5.3 → webscout-5.4}/webscout/Provider/TTI/deepinfra.py +0 -0
  87. {webscout-5.3 → webscout-5.4}/webscout/Provider/TTS/__init__.py +0 -0
  88. {webscout-5.3 → webscout-5.4}/webscout/Provider/TeachAnything.py +0 -0
  89. {webscout-5.3 → webscout-5.4}/webscout/Provider/ai4chat.py +0 -0
  90. {webscout-5.3 → webscout-5.4}/webscout/Provider/cerebras.py +0 -0
  91. {webscout-5.3 → webscout-5.4}/webscout/Provider/meta.py +0 -0
  92. {webscout-5.3 → webscout-5.4}/webscout/__init__.py +0 -0
  93. {webscout-5.3 → webscout-5.4}/webscout/__main__.py +0 -0
  94. {webscout-5.3 → webscout-5.4}/webscout/cli.py +0 -0
  95. {webscout-5.3 → webscout-5.4}/webscout/exceptions.py +0 -0
  96. {webscout-5.3 → webscout-5.4}/webscout/g4f.py +0 -0
  97. {webscout-5.3 → webscout-5.4}/webscout/models.py +0 -0
  98. {webscout-5.3 → webscout-5.4}/webscout/tempid.py +0 -0
  99. {webscout-5.3 → webscout-5.4}/webscout/transcriber.py +0 -0
  100. {webscout-5.3 → webscout-5.4}/webscout/utils.py +0 -0
  101. {webscout-5.3 → webscout-5.4}/webscout/webai.py +0 -0
  102. {webscout-5.3 → webscout-5.4}/webscout/webscout_search.py +0 -0
  103. {webscout-5.3 → webscout-5.4}/webscout/webscout_search_async.py +0 -0
  104. {webscout-5.3 → webscout-5.4}/webscout/websx_search.py +0 -0
  105. {webscout-5.3 → webscout-5.4}/webscout.egg-info/dependency_links.txt +0 -0
  106. {webscout-5.3 → webscout-5.4}/webscout.egg-info/entry_points.txt +0 -0
  107. {webscout-5.3 → webscout-5.4}/webscout.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 5.3
3
+ Version: 5.4
4
4
  Summary: Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs and more
5
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
@@ -29,44 +29,29 @@ Requires-Dist: click
29
29
  Requires-Dist: curl_cffi
30
30
  Requires-Dist: lxml
31
31
  Requires-Dist: nest-asyncio
32
- Requires-Dist: selenium
33
- Requires-Dist: tqdm
34
- Requires-Dist: webdriver-manager
35
- Requires-Dist: halo>=0.0.31
36
32
  Requires-Dist: g4f>=0.2.2.3
37
33
  Requires-Dist: g4f[webdriver]
38
34
  Requires-Dist: rich
39
- Requires-Dist: python-dotenv
40
35
  Requires-Dist: beautifulsoup4
41
36
  Requires-Dist: markdownify
42
37
  Requires-Dist: pydantic
43
38
  Requires-Dist: requests
44
- Requires-Dist: sse_starlette
45
39
  Requires-Dist: termcolor
46
- Requires-Dist: tiktoken
47
- Requires-Dist: tldextract
48
40
  Requires-Dist: orjson
49
41
  Requires-Dist: PyYAML
50
42
  Requires-Dist: appdirs
51
- Requires-Dist: GoogleBard1>=2.1.4
52
43
  Requires-Dist: tls_client
53
44
  Requires-Dist: clipman
54
- Requires-Dist: Helpingai-T2
55
45
  Requires-Dist: playsound
56
46
  Requires-Dist: poe_api_wrapper
57
47
  Requires-Dist: pyreqwest_impersonate
58
- Requires-Dist: ballyregan
59
- Requires-Dist: nodriver
60
- Requires-Dist: PyExecJS
61
48
  Requires-Dist: ollama
62
49
  Requires-Dist: pyfiglet
63
- Requires-Dist: yaspin
64
50
  Requires-Dist: pillow
65
51
  Requires-Dist: requests_html
66
52
  Requires-Dist: bson
67
53
  Requires-Dist: cloudscraper
68
54
  Requires-Dist: emoji
69
- Requires-Dist: colorlog
70
55
  Requires-Dist: openai
71
56
  Provides-Extra: dev
72
57
  Requires-Dist: ruff>=0.1.6; extra == "dev"
@@ -871,7 +856,7 @@ from webscout import WEBS as w
871
856
  R = w().chat("Who are you", model='gpt-4o-mini') # GPT-3.5 Turbo, mixtral-8x7b, llama-3-70b, claude-3-haiku, gpt-4o-mini
872
857
  print(R)
873
858
  ```
874
- ### `PhindSearch` - Search using Phind.com
859
+ ### `PhindSearch` - Search using Phind.com
875
860
 
876
861
  ```python
877
862
  from webscout import PhindSearch
@@ -907,34 +892,6 @@ message = ph.get_message(response)
907
892
  print(message)
908
893
  ```
909
894
 
910
-
911
- ### `You.com` - search/chat with you.com - Not working
912
- ```python
913
-
914
- from webscout import YouChat
915
- from rich import print
916
-
917
- ai = YouChat(
918
- is_conversation=True,
919
- max_tokens=800,
920
- timeout=30,
921
- intro=None,
922
- filepath=None,
923
- update_file=True,
924
- proxies={},
925
- history_offset=10250,
926
- act=None,
927
- )
928
-
929
- prompt = "what is meaning of life"
930
-
931
- response = ai.ask(prompt)
932
-
933
- # Extract and print the message from the response
934
- message = ai.get_message(response)
935
- print(message)
936
- ```
937
-
938
895
  ### `Gemini` - search with google gemini
939
896
 
940
897
  ```python
@@ -953,26 +910,43 @@ gemini = GEMINI(cookie_file=COOKIE_FILE, proxy=PROXIES)
953
910
  response = gemini.chat("websearch about HelpingAI and who is its developer")
954
911
  print(response)
955
912
  ```
956
- ### `Berlin4h` - chat with Berlin4h
913
+ ### `YEPCHAT`
957
914
  ```python
958
- from webscout import Berlin4h
915
+ from webscout import YEPCHAT
916
+ ai = YEPCHAT(Tools=False)
917
+ response = ai.chat(input(">>> "))
918
+ for chunk in response:
919
+ print(chunk, end="", flush=True)
920
+ #---------------Tool Call-------------
959
921
 
960
- ai = Berlin4h(
961
- is_conversation=True,
962
- max_tokens=800,
963
- timeout=30,
964
- intro=None,
965
- filepath=None,
966
- update_file=True,
967
- proxies={},
968
- history_offset=10250,
969
- act=None,
922
+ from rich import print
923
+ from webscout import YEPCHAT
924
+ def get_current_time():
925
+ import datetime
926
+ return f"The current time is {datetime.datetime.now().strftime('%H:%M:%S')}"
927
+ def get_weather(location: str) -> str:
928
+ return f"The weather in {location} is sunny."
929
+
930
+
931
+ ai = YEPCHAT(Tools=True) # Set Tools=True to use tools in the chat.
932
+
933
+ ai.tool_registry.register_tool("get_current_time", get_current_time, "Gets the current time.")
934
+ ai.tool_registry.register_tool(
935
+ "get_weather",
936
+ get_weather,
937
+ "Gets the weather for a given location.",
938
+ parameters={
939
+ "type": "object",
940
+ "properties": {
941
+ "location": {"type": "string", "description": "The city and state, or zip code"}
942
+ },
943
+ "required": ["location"],
944
+ },
970
945
  )
971
946
 
972
- # Example usage:
973
- prompt = "Explain the concept of recursion in simple terms."
974
- response = ai.chat(prompt)
975
- print(response)
947
+ response = ai.chat(input(">>> "))
948
+ for chunk in response:
949
+ print(chunk, end="", flush=True)
976
950
  ```
977
951
  ### `BlackBox` - Search/chat With BlackBox
978
952
  ```python
@@ -1122,7 +1096,7 @@ print(message)
1122
1096
  Usage code similar to other proviers
1123
1097
 
1124
1098
  ### `BasedGPT` - chat with GPT
1125
- ```
1099
+ ```py
1126
1100
  from webscout import BasedGPT
1127
1101
 
1128
1102
  # Initialize the BasedGPT provider
@@ -1431,7 +1405,7 @@ if "error" not in function_call_data:
1431
1405
  else:
1432
1406
  print(f"Error: {function_call_data['error']}")
1433
1407
  ```
1434
- ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, NetFly, Editee, AI21, Chatify, Cerebras, X0GPT
1408
+ ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, NetFly, Editee, AI21, Chatify, Cerebras, X0GPT, Lepton, GEMINIAPI, Cleeai, Elmo, Genspark
1435
1409
  code similar to other provider
1436
1410
  ### `LLM`
1437
1411
  ```python
@@ -792,7 +792,7 @@ from webscout import WEBS as w
792
792
  R = w().chat("Who are you", model='gpt-4o-mini') # GPT-3.5 Turbo, mixtral-8x7b, llama-3-70b, claude-3-haiku, gpt-4o-mini
793
793
  print(R)
794
794
  ```
795
- ### `PhindSearch` - Search using Phind.com
795
+ ### `PhindSearch` - Search using Phind.com
796
796
 
797
797
  ```python
798
798
  from webscout import PhindSearch
@@ -828,34 +828,6 @@ message = ph.get_message(response)
828
828
  print(message)
829
829
  ```
830
830
 
831
-
832
- ### `You.com` - search/chat with you.com - Not working
833
- ```python
834
-
835
- from webscout import YouChat
836
- from rich import print
837
-
838
- ai = YouChat(
839
- is_conversation=True,
840
- max_tokens=800,
841
- timeout=30,
842
- intro=None,
843
- filepath=None,
844
- update_file=True,
845
- proxies={},
846
- history_offset=10250,
847
- act=None,
848
- )
849
-
850
- prompt = "what is meaning of life"
851
-
852
- response = ai.ask(prompt)
853
-
854
- # Extract and print the message from the response
855
- message = ai.get_message(response)
856
- print(message)
857
- ```
858
-
859
831
  ### `Gemini` - search with google gemini
860
832
 
861
833
  ```python
@@ -874,26 +846,43 @@ gemini = GEMINI(cookie_file=COOKIE_FILE, proxy=PROXIES)
874
846
  response = gemini.chat("websearch about HelpingAI and who is its developer")
875
847
  print(response)
876
848
  ```
877
- ### `Berlin4h` - chat with Berlin4h
849
+ ### `YEPCHAT`
878
850
  ```python
879
- from webscout import Berlin4h
851
+ from webscout import YEPCHAT
852
+ ai = YEPCHAT(Tools=False)
853
+ response = ai.chat(input(">>> "))
854
+ for chunk in response:
855
+ print(chunk, end="", flush=True)
856
+ #---------------Tool Call-------------
880
857
 
881
- ai = Berlin4h(
882
- is_conversation=True,
883
- max_tokens=800,
884
- timeout=30,
885
- intro=None,
886
- filepath=None,
887
- update_file=True,
888
- proxies={},
889
- history_offset=10250,
890
- act=None,
858
+ from rich import print
859
+ from webscout import YEPCHAT
860
+ def get_current_time():
861
+ import datetime
862
+ return f"The current time is {datetime.datetime.now().strftime('%H:%M:%S')}"
863
+ def get_weather(location: str) -> str:
864
+ return f"The weather in {location} is sunny."
865
+
866
+
867
+ ai = YEPCHAT(Tools=True) # Set Tools=True to use tools in the chat.
868
+
869
+ ai.tool_registry.register_tool("get_current_time", get_current_time, "Gets the current time.")
870
+ ai.tool_registry.register_tool(
871
+ "get_weather",
872
+ get_weather,
873
+ "Gets the weather for a given location.",
874
+ parameters={
875
+ "type": "object",
876
+ "properties": {
877
+ "location": {"type": "string", "description": "The city and state, or zip code"}
878
+ },
879
+ "required": ["location"],
880
+ },
891
881
  )
892
882
 
893
- # Example usage:
894
- prompt = "Explain the concept of recursion in simple terms."
895
- response = ai.chat(prompt)
896
- print(response)
883
+ response = ai.chat(input(">>> "))
884
+ for chunk in response:
885
+ print(chunk, end="", flush=True)
897
886
  ```
898
887
  ### `BlackBox` - Search/chat With BlackBox
899
888
  ```python
@@ -1043,7 +1032,7 @@ print(message)
1043
1032
  Usage code similar to other proviers
1044
1033
 
1045
1034
  ### `BasedGPT` - chat with GPT
1046
- ```
1035
+ ```py
1047
1036
  from webscout import BasedGPT
1048
1037
 
1049
1038
  # Initialize the BasedGPT provider
@@ -1352,7 +1341,7 @@ if "error" not in function_call_data:
1352
1341
  else:
1353
1342
  print(f"Error: {function_call_data['error']}")
1354
1343
  ```
1355
- ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, NetFly, Editee, AI21, Chatify, Cerebras, X0GPT
1344
+ ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, NetFly, Editee, AI21, Chatify, Cerebras, X0GPT, Lepton, GEMINIAPI, Cleeai, Elmo, Genspark
1356
1345
  code similar to other provider
1357
1346
  ### `LLM`
1358
1347
  ```python
@@ -1,11 +1,11 @@
1
1
  from setuptools import setup, find_packages
2
-
2
+ from webscout.version import __prog__, __version__
3
3
  with open("README.md", encoding="utf-8") as f:
4
4
  README = f.read()
5
5
 
6
6
  setup(
7
7
  name="webscout",
8
- version="5.3",
8
+ version=__version__,
9
9
  description="Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs and more",
10
10
  long_description=README,
11
11
  long_description_content_type="text/markdown",
@@ -33,44 +33,29 @@ setup(
33
33
  "curl_cffi",
34
34
  "lxml",
35
35
  "nest-asyncio",
36
- "selenium",
37
- "tqdm",
38
- "webdriver-manager",
39
- "halo>=0.0.31",
40
36
  "g4f>=0.2.2.3",
41
37
  "g4f[webdriver]",
42
38
  "rich",
43
- "python-dotenv",
44
39
  "beautifulsoup4",
45
40
  "markdownify",
46
41
  "pydantic",
47
42
  "requests",
48
- "sse_starlette",
49
43
  "termcolor",
50
- "tiktoken",
51
- "tldextract",
52
44
  "orjson",
53
45
  "PyYAML",
54
46
  "appdirs",
55
- "GoogleBard1>=2.1.4",
56
47
  "tls_client",
57
48
  "clipman",
58
- "Helpingai-T2",
59
49
  "playsound",
60
50
  "poe_api_wrapper",
61
51
  "pyreqwest_impersonate",
62
- "ballyregan",
63
- "nodriver",
64
- "PyExecJS",
65
52
  "ollama",
66
53
  "pyfiglet",
67
- "yaspin",
68
54
  "pillow",
69
55
  "requests_html",
70
56
  "bson",
71
57
  "cloudscraper",
72
58
  "emoji",
73
- "colorlog",
74
59
  "openai",
75
60
  ],
76
61
  entry_points={
@@ -9,11 +9,8 @@ from webscout.Provider.Perplexity import Perplexity
9
9
  from webscout.Provider.Blackboxai import BLACKBOXAI
10
10
  from webscout.Provider.Blackboxai import AsyncBLACKBOXAI
11
11
  from webscout.Provider.Phind import PhindSearch
12
- from webscout.Provider.Phind import AsyncPhindSearch
13
12
  from webscout.Provider.Phind import Phindv2
14
- from webscout.Provider.Phind import AsyncPhindv2
15
13
  from webscout.Provider.yep import YEPCHAT
16
- from webscout.Provider.Berlin4h import Berlin4h
17
14
  from webscout.Provider.Poe import POE
18
15
  from webscout.Provider.BasedGPT import BasedGPT
19
16
  from webscout.Provider.Deepseek import DeepSeek
@@ -25,7 +22,7 @@ from webscout.Provider.DARKAI import DARKAI
25
22
  from webscout.Provider.koala import KOALA
26
23
  from webscout.Provider.RUBIKSAI import RUBIKSAI
27
24
  from webscout.Provider.meta import Meta
28
- from webscout.Provider.liaobots import LiaoBots
25
+
29
26
  from webscout.Provider.DiscordRocks import DiscordRocks
30
27
  from webscout.Provider.felo_search import Felo
31
28
  from webscout.Provider.xdash import XDASH
@@ -35,7 +32,7 @@ from webscout.Provider.Cloudflare import Cloudflare
35
32
  from webscout.Provider.turboseek import TurboSeek
36
33
  from webscout.Provider.NetFly import NetFly
37
34
  from webscout.Provider.EDITEE import Editee
38
- # from webscout.Provider.Chatify import Chatify # TODO: UNFINISHED
35
+ from webscout.Provider.Chatify import Chatify
39
36
  from webscout.Provider.PI import PiAI
40
37
  from webscout.g4f import GPT4FREE, AsyncGPT4FREE
41
38
  from webscout.g4f import TestProviders
@@ -58,7 +55,6 @@ provider_map: dict[
58
55
  PhindSearch,
59
56
  Phindv2,
60
57
  YEPCHAT,
61
- Berlin4h,
62
58
  POE,
63
59
  BasedGPT,
64
60
  DeepSeek,
@@ -72,7 +68,7 @@ provider_map: dict[
72
68
  KOALA,
73
69
  RUBIKSAI,
74
70
  Meta,
75
- LiaoBots,
71
+
76
72
  DiscordRocks,
77
73
  Felo,
78
74
  XDASH,
@@ -82,7 +78,7 @@ provider_map: dict[
82
78
  TurboSeek,
83
79
  NetFly,
84
80
  Editee,
85
- # Chatify,
81
+ Chatify,
86
82
  PiAI,
87
83
  ],
88
84
  ] = {
@@ -94,7 +90,7 @@ provider_map: dict[
94
90
  "PhindSearch": PhindSearch,
95
91
  "Phindv2": Phindv2,
96
92
  "YEPCHAT": YEPCHAT,
97
- "Berlin4h": Berlin4h,
93
+
98
94
  "POE": POE,
99
95
  "BasedGPT": BasedGPT,
100
96
  "DeepSeek": DeepSeek,
@@ -108,7 +104,7 @@ provider_map: dict[
108
104
  "koala": KOALA,
109
105
  "rubiksai": RUBIKSAI,
110
106
  "meta": Meta,
111
- "liaobots": LiaoBots,
107
+
112
108
  "discordrocks": DiscordRocks,
113
109
  "felo": Felo,
114
110
  "xdash": XDASH,
@@ -160,7 +156,7 @@ class AUTO(Provider):
160
156
  PhindSearch,
161
157
  Phindv2,
162
158
  YEPCHAT,
163
- Berlin4h,
159
+
164
160
  POE,
165
161
  BasedGPT,
166
162
  DeepSeek,
@@ -174,7 +170,7 @@ class AUTO(Provider):
174
170
  KOALA,
175
171
  RUBIKSAI,
176
172
  Meta,
177
- LiaoBots,
173
+
178
174
  DiscordRocks,
179
175
  Felo,
180
176
  XDASH,
@@ -10,7 +10,7 @@ import logging
10
10
  class WebSearchAgent:
11
11
  def __init__(self):
12
12
  self.webs = WEBS()
13
- self.ai = LLAMA3(system="You are an advanced AI assistant specialized in generating optimal search queries and providing comprehensive answers based on web search results.")
13
+ self.ai = LLAMA3(system="You are an advanced AI assistant specialized in generating optimal search queries and providing comprehensive answers based on web search results.", is_conversation=False)
14
14
 
15
15
  def generate_search_queries(self, information, num_queries=3):
16
16
  prompt = f"""
@@ -94,8 +94,8 @@ class WebSearchAgent:
94
94
  paragraphs = soup.find_all('p')
95
95
  text = ' '.join([p.get_text() for p in paragraphs])
96
96
  words = text.split()
97
- if len(words) > 150:
98
- text = ' '.join(words[:150]) + '...'
97
+ if len(words) > 600:
98
+ text = ' '.join(words[:600]) + '...'
99
99
  return text
100
100
  else:
101
101
  return f"Failed to fetch {url}: HTTP {response.status}"
@@ -112,7 +112,7 @@ class WebSearchAgent:
112
112
  class OnlineSearcher:
113
113
  def __init__(self):
114
114
  self.agent = WebSearchAgent()
115
- self.ai = LLAMA3(system="You are an advanced AI assistant specialized in providing comprehensive and accurate answers based on web search results and your general knowledge.")
115
+ self.ai = LLAMA3(system="You are an advanced AI assistant specialized in providing comprehensive and accurate answers based on web search results and your general knowledge.", is_conversation=False)
116
116
 
117
117
  def answer_question(self, question: str):
118
118
  search_results = self.agent.search(question)
@@ -125,7 +125,7 @@ class OnlineSearcher:
125
125
 
126
126
  context += "Extracted webpage contents:\n"
127
127
  for i, webpage in enumerate(webpage_contents):
128
- context += f"{i}. URL: {webpage['url']}\n Content: {webpage['content'][:150]}...\n\n"
128
+ context += f"{i}. URL: {webpage['url']}\n Content: {webpage['content'][:600]}...\n\n"
129
129
 
130
130
  prompt = f"""
131
131
  Task: Provide a comprehensive and accurate answer to the given question based on the provided web search results and your general knowledge.
@@ -0,0 +1,198 @@
1
+ from datetime import date
2
+ import json
3
+ # import logging
4
+ import time
5
+ from typing import Any, Dict, Optional
6
+ import requests
7
+ from webscout import WEBS, Julius
8
+
9
+ class FunctionCallingAgent:
10
+ def __init__(self, model: str = "GPT-4o",
11
+ tools: list = None):
12
+ self.ai = Julius(model=model, timeout=300, intro=None)
13
+ self.tools = tools if tools is not None else []
14
+ self.knowledge_cutoff = "September 2022"
15
+
16
+ def function_call_handler(self, message_text: str) -> dict:
17
+ system_message = self._generate_system_message(message_text)
18
+ response = self.ai.chat(system_message)
19
+ # logging.info(f"Raw response: {response}")
20
+ return self._parse_function_call(response)
21
+
22
+ def _generate_system_message(self, user_message: str) -> str:
23
+ tools_description = ""
24
+ for tool in self.tools:
25
+ tools_description += f"- {tool['function']['name']}: {tool['function'].get('description', '')}\n"
26
+ tools_description += " Parameters:\n"
27
+ for key, value in tool['function']['parameters']['properties'].items():
28
+ tools_description += f" - {key}: {value.get('description', '')} ({value.get('type')})\n"
29
+
30
+ current_date = date.today().strftime("%B %d, %Y")
31
+ return f"""Today is {current_date}. Your knowledge is current up to {self.knowledge_cutoff}.
32
+
33
+ You are an advanced AI assistant tasked with analyzing user requests and determining the most appropriate action. You have access to the following tools:
34
+
35
+ {tools_description}
36
+
37
+ Instructions:
38
+ 1. Carefully analyze the user's request.
39
+ 2. If the user request is about controlling the web browser (opening websites, searching, playing videos, etc.), ALWAYS use the 'browser_control' tool.
40
+ 3. If the user request is something else, determine if any of the other provided tools are necessary to fulfill the request.
41
+ 4. If a tool is needed, select the MOST APPROPRIATE one. Do not use a tool if it's not directly relevant to the user's request.
42
+ 5. If you decide to use a tool, respond ONLY with a JSON object in this format:
43
+ {{
44
+ "tool_name": "name_of_the_tool",
45
+ "tool_input": {{
46
+ "param1": "value1",
47
+ "param2": "value2"
48
+ }}
49
+ }}
50
+
51
+ - Use the exact tool name as listed above.
52
+ - Include only the necessary parameters for the chosen tool.
53
+ - Do not include any explanations or additional text outside the JSON object.
54
+
55
+ 6. If no tool is needed and you can answer directly, respond with:
56
+ {{
57
+ "tool_name": "general_ai",
58
+ "tool_input": {{
59
+ "question": "user's original question"
60
+ }}
61
+ }}
62
+
63
+ User Request: {user_message}
64
+
65
+ Your Response (JSON only):"""
66
+
67
+ def _parse_function_call(self, response: str) -> dict:
68
+ try:
69
+ # Ensure to locate the start and end of the JSON structure
70
+ start_idx = response.find("{")
71
+ end_idx = response.rfind("}") + 1
72
+
73
+ if start_idx == -1 or end_idx == -1:
74
+ raise ValueError("No valid JSON structure found in the response.")
75
+
76
+ # Extract the JSON string
77
+ response_json_str = response[start_idx:end_idx]
78
+
79
+ # Load the JSON string
80
+ parsed_response = json.loads(response_json_str)
81
+
82
+ # Check for the expected format
83
+ if "tool_name" in parsed_response and "tool_input" in parsed_response:
84
+ return parsed_response
85
+
86
+ # If not in the expected format, try to convert
87
+ for key, value in parsed_response.items():
88
+ if isinstance(value, dict):
89
+ return {
90
+ "tool_name": key,
91
+ "tool_input": value
92
+ }
93
+
94
+ # If the response structure is still incorrect
95
+ raise ValueError("Invalid response structure: missing required fields.")
96
+
97
+ except (ValueError, json.JSONDecodeError) as e:
98
+ # logging.error(f"Error parsing function call: {e}")
99
+ return {"error": str(e)}
100
+
101
+
102
+ def execute_function(self, function_call_data: dict) -> str:
103
+ function_name = function_call_data.get("tool_name")
104
+ arguments = function_call_data.get("tool_input", {})
105
+
106
+ if not isinstance(arguments, dict):
107
+ # logging.error("Invalid arguments format.")
108
+ return "Invalid arguments format."
109
+
110
+ # logging.info(f"Executing function: {function_name} with arguments: {arguments}")
111
+
112
+
113
+ # Example usage
114
+ if __name__ == "__main__":
115
+ # Configure logging
116
+ # logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
117
+
118
+ tools = [
119
+ {
120
+ "type": "function",
121
+ "function": {
122
+ "name": "web_search",
123
+ "description": "Search the web for current information on a given query",
124
+ "parameters": {
125
+ "type": "object",
126
+ "properties": {
127
+ "query": {
128
+ "type": "string",
129
+ "description": "The search query to be executed"
130
+ }
131
+ },
132
+ "required": ["query"]
133
+ }
134
+ }
135
+ },
136
+ {
137
+ "type": "function",
138
+ "function": {
139
+ "name": "get_user_detail",
140
+ "description": "Get the user's name and age.",
141
+ "parameters": {
142
+ "type": "object",
143
+ "properties": {
144
+ "name": {
145
+ "type": "string",
146
+ "description": "The user's name."
147
+ },
148
+ "age": {
149
+ "type": "integer",
150
+ "description": "The user's age."
151
+ }
152
+ },
153
+ "required": ["name", "age"]
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "type": "function",
159
+ "function": {
160
+ "name": "general_ai",
161
+ "description": "Use AI to answer general questions or perform tasks not requiring external tools",
162
+ "parameters": {
163
+ "type": "object",
164
+ "properties": {
165
+ "question": {
166
+ "type": "string",
167
+ "description": "The question or task for the AI to process"
168
+ }
169
+ },
170
+ "required": ["question"]
171
+ }
172
+ }
173
+ }
174
+ ]
175
+
176
+ agent = FunctionCallingAgent(tools=tools)
177
+
178
+ # Test cases
179
+ test_messages = [
180
+ "What's the weather like in New York today?",
181
+ "Who won the last FIFA World Cup?",
182
+ "Can you explain quantum computing?",
183
+ "What are the latest developments in AI?",
184
+ "Tell me a joke about programming.",
185
+ "What's the meaning of life?",
186
+ "Get user details name as John and age as 30"
187
+ ]
188
+
189
+ for message in test_messages:
190
+ print(f"\nProcessing: {message}")
191
+ function_call_data = agent.function_call_handler(message)
192
+ print(f"Function Call Data: {function_call_data}")
193
+
194
+ if "error" not in function_call_data:
195
+ result = agent.execute_function(function_call_data)
196
+ print(f"Function Execution Result: {result}")
197
+ else:
198
+ print(f"Error: {function_call_data['error']}")
@@ -0,0 +1,3 @@
1
+ from llama_cpp import __version__ as __llama_cpp_version__
2
+ from webscout.version import __prog__, __version__
3
+ __version__ = __version__