webscout 5.9__tar.gz → 6.1__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 (138) hide show
  1. {webscout-5.9/webscout.egg-info → webscout-6.1}/PKG-INFO +124 -149
  2. {webscout-5.9 → webscout-6.1}/README.md +115 -145
  3. {webscout-5.9 → webscout-6.1}/setup.py +8 -3
  4. {webscout-5.9 → webscout-6.1}/webscout/Agents/Onlinesearcher.py +22 -10
  5. {webscout-5.9 → webscout-6.1}/webscout/Agents/functioncall.py +2 -2
  6. {webscout-5.9 → webscout-6.1}/webscout/Bard.py +21 -21
  7. webscout-6.1/webscout/Local/__init__.py +10 -0
  8. webscout-6.1/webscout/Local/formats.py +745 -0
  9. webscout-6.1/webscout/Local/model.py +1368 -0
  10. webscout-6.1/webscout/Local/samplers.py +125 -0
  11. webscout-6.1/webscout/Local/thread.py +539 -0
  12. webscout-6.1/webscout/Local/ui.py +401 -0
  13. webscout-6.1/webscout/Local/utils.py +363 -0
  14. {webscout-5.9 → webscout-6.1}/webscout/Provider/Amigo.py +5 -3
  15. webscout-6.1/webscout/Provider/ChatHub.py +209 -0
  16. {webscout-5.9 → webscout-6.1}/webscout/Provider/Chatify.py +3 -3
  17. {webscout-5.9 → webscout-6.1}/webscout/Provider/Cloudflare.py +3 -3
  18. {webscout-5.9 → webscout-6.1}/webscout/Provider/DARKAI.py +1 -1
  19. webscout-6.1/webscout/Provider/Deepinfra.py +172 -0
  20. {webscout-5.9 → webscout-6.1}/webscout/Provider/Deepseek.py +4 -6
  21. {webscout-5.9 → webscout-6.1}/webscout/Provider/DiscordRocks.py +3 -3
  22. {webscout-5.9 → webscout-6.1}/webscout/Provider/Free2GPT.py +3 -3
  23. webscout-6.1/webscout/Provider/NinjaChat.py +200 -0
  24. {webscout-5.9 → webscout-6.1}/webscout/Provider/OLLAMA.py +4 -4
  25. {webscout-5.9 → webscout-6.1}/webscout/Provider/RUBIKSAI.py +3 -3
  26. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/Nexra.py +3 -3
  27. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/__init__.py +2 -1
  28. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/aiforce.py +2 -2
  29. webscout-6.1/webscout/Provider/TTI/imgninza.py +136 -0
  30. {webscout-5.9 → webscout-6.1}/webscout/Provider/Youchat.py +4 -5
  31. {webscout-5.9 → webscout-6.1}/webscout/Provider/__init__.py +13 -6
  32. {webscout-5.9 → webscout-6.1}/webscout/Provider/ai4chat.py +3 -2
  33. webscout-6.1/webscout/Provider/aimathgpt.py +193 -0
  34. webscout-6.1/webscout/Provider/bagoodex.py +145 -0
  35. {webscout-5.9 → webscout-6.1}/webscout/Provider/bixin.py +3 -3
  36. {webscout-5.9 → webscout-6.1}/webscout/Provider/cleeai.py +3 -3
  37. {webscout-5.9 → webscout-6.1}/webscout/Provider/elmo.py +2 -5
  38. {webscout-5.9 → webscout-6.1}/webscout/Provider/felo_search.py +1 -1
  39. webscout-6.1/webscout/Provider/gaurish.py +168 -0
  40. webscout-6.1/webscout/Provider/geminiprorealtime.py +160 -0
  41. {webscout-5.9 → webscout-6.1}/webscout/Provider/julius.py +10 -40
  42. {webscout-5.9 → webscout-6.1}/webscout/Provider/llamatutor.py +2 -2
  43. {webscout-5.9 → webscout-6.1}/webscout/Provider/prefind.py +3 -3
  44. {webscout-5.9 → webscout-6.1}/webscout/Provider/promptrefine.py +3 -3
  45. {webscout-5.9 → webscout-6.1}/webscout/Provider/turboseek.py +1 -1
  46. {webscout-5.9 → webscout-6.1}/webscout/Provider/twitterclone.py +25 -41
  47. {webscout-5.9 → webscout-6.1}/webscout/Provider/upstage.py +3 -3
  48. {webscout-5.9 → webscout-6.1}/webscout/Provider/x0gpt.py +6 -6
  49. {webscout-5.9 → webscout-6.1}/webscout/exceptions.py +5 -1
  50. {webscout-5.9 → webscout-6.1}/webscout/utils.py +3 -0
  51. {webscout-5.9 → webscout-6.1}/webscout/version.py +1 -1
  52. {webscout-5.9 → webscout-6.1}/webscout/webscout_search.py +154 -123
  53. {webscout-5.9 → webscout-6.1/webscout.egg-info}/PKG-INFO +124 -149
  54. {webscout-5.9 → webscout-6.1}/webscout.egg-info/SOURCES.txt +8 -2
  55. {webscout-5.9 → webscout-6.1}/webscout.egg-info/requires.txt +8 -3
  56. webscout-5.9/webscout/Local/__init__.py +0 -11
  57. webscout-5.9/webscout/Local/formats.py +0 -535
  58. webscout-5.9/webscout/Local/model.py +0 -771
  59. webscout-5.9/webscout/Local/rawdog.py +0 -946
  60. webscout-5.9/webscout/Local/samplers.py +0 -161
  61. webscout-5.9/webscout/Local/thread.py +0 -698
  62. webscout-5.9/webscout/Local/utils.py +0 -186
  63. webscout-5.9/webscout/Provider/Deepinfra.py +0 -466
  64. webscout-5.9/webscout/Provider/Poe.py +0 -208
  65. {webscout-5.9 → webscout-6.1}/LICENSE.md +0 -0
  66. {webscout-5.9 → webscout-6.1}/setup.cfg +0 -0
  67. {webscout-5.9 → webscout-6.1}/webscout/AIauto.py +0 -0
  68. {webscout-5.9 → webscout-6.1}/webscout/AIbase.py +0 -0
  69. {webscout-5.9 → webscout-6.1}/webscout/AIutel.py +0 -0
  70. {webscout-5.9 → webscout-6.1}/webscout/Agents/__init__.py +0 -0
  71. {webscout-5.9 → webscout-6.1}/webscout/Bing_search.py +0 -0
  72. {webscout-5.9 → webscout-6.1}/webscout/DWEBS.py +0 -0
  73. {webscout-5.9 → webscout-6.1}/webscout/Extra/__init__.py +0 -0
  74. {webscout-5.9 → webscout-6.1}/webscout/Extra/autollama.py +0 -0
  75. {webscout-5.9 → webscout-6.1}/webscout/Extra/gguf.py +0 -0
  76. {webscout-5.9 → webscout-6.1}/webscout/Extra/weather.py +0 -0
  77. {webscout-5.9 → webscout-6.1}/webscout/Extra/weather_ascii.py +0 -0
  78. {webscout-5.9 → webscout-6.1}/webscout/LLM.py +0 -0
  79. {webscout-5.9 → webscout-6.1}/webscout/Local/_version.py +0 -0
  80. {webscout-5.9 → webscout-6.1}/webscout/Provider/AI21.py +0 -0
  81. {webscout-5.9 → webscout-6.1}/webscout/Provider/Andi.py +0 -0
  82. {webscout-5.9 → webscout-6.1}/webscout/Provider/BasedGPT.py +0 -0
  83. {webscout-5.9 → webscout-6.1}/webscout/Provider/Bing.py +0 -0
  84. {webscout-5.9 → webscout-6.1}/webscout/Provider/Blackboxai.py +0 -0
  85. {webscout-5.9 → webscout-6.1}/webscout/Provider/ChatGPTES.py +0 -0
  86. {webscout-5.9 → webscout-6.1}/webscout/Provider/Cohere.py +0 -0
  87. {webscout-5.9 → webscout-6.1}/webscout/Provider/EDITEE.py +0 -0
  88. {webscout-5.9 → webscout-6.1}/webscout/Provider/Farfalle.py +0 -0
  89. {webscout-5.9 → webscout-6.1}/webscout/Provider/GPTWeb.py +0 -0
  90. {webscout-5.9 → webscout-6.1}/webscout/Provider/Gemini.py +0 -0
  91. {webscout-5.9 → webscout-6.1}/webscout/Provider/Groq.py +0 -0
  92. {webscout-5.9 → webscout-6.1}/webscout/Provider/Koboldai.py +0 -0
  93. {webscout-5.9 → webscout-6.1}/webscout/Provider/Llama.py +0 -0
  94. {webscout-5.9 → webscout-6.1}/webscout/Provider/Llama3.py +0 -0
  95. {webscout-5.9 → webscout-6.1}/webscout/Provider/Openai.py +0 -0
  96. {webscout-5.9 → webscout-6.1}/webscout/Provider/PI.py +0 -0
  97. {webscout-5.9 → webscout-6.1}/webscout/Provider/Perplexity.py +0 -0
  98. {webscout-5.9 → webscout-6.1}/webscout/Provider/Phind.py +0 -0
  99. {webscout-5.9 → webscout-6.1}/webscout/Provider/PizzaGPT.py +0 -0
  100. {webscout-5.9 → webscout-6.1}/webscout/Provider/Reka.py +0 -0
  101. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/PollinationsAI.py +0 -0
  102. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/WebSimAI.py +0 -0
  103. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/amigo.py +0 -0
  104. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/artbit.py +0 -0
  105. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/blackboximage.py +0 -0
  106. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/deepinfra.py +0 -0
  107. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTI/huggingface.py +0 -0
  108. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTS/__init__.py +0 -0
  109. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTS/parler.py +0 -0
  110. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTS/streamElements.py +0 -0
  111. {webscout-5.9 → webscout-6.1}/webscout/Provider/TTS/voicepod.py +0 -0
  112. {webscout-5.9 → webscout-6.1}/webscout/Provider/TeachAnything.py +0 -0
  113. {webscout-5.9 → webscout-6.1}/webscout/Provider/aigames.py +0 -0
  114. {webscout-5.9 → webscout-6.1}/webscout/Provider/cerebras.py +0 -0
  115. {webscout-5.9 → webscout-6.1}/webscout/Provider/geminiapi.py +0 -0
  116. {webscout-5.9 → webscout-6.1}/webscout/Provider/genspark.py +0 -0
  117. {webscout-5.9 → webscout-6.1}/webscout/Provider/koala.py +0 -0
  118. {webscout-5.9 → webscout-6.1}/webscout/Provider/learnfastai.py +0 -0
  119. {webscout-5.9 → webscout-6.1}/webscout/Provider/lepton.py +0 -0
  120. {webscout-5.9 → webscout-6.1}/webscout/Provider/meta.py +0 -0
  121. {webscout-5.9 → webscout-6.1}/webscout/Provider/tutorai.py +0 -0
  122. {webscout-5.9 → webscout-6.1}/webscout/Provider/xdash.py +0 -0
  123. {webscout-5.9 → webscout-6.1}/webscout/Provider/yep.py +0 -0
  124. {webscout-5.9 → webscout-6.1}/webscout/YTdownloader.py +0 -0
  125. {webscout-5.9 → webscout-6.1}/webscout/__init__.py +0 -0
  126. {webscout-5.9 → webscout-6.1}/webscout/__main__.py +0 -0
  127. {webscout-5.9 → webscout-6.1}/webscout/cli.py +0 -0
  128. {webscout-5.9 → webscout-6.1}/webscout/g4f.py +0 -0
  129. {webscout-5.9 → webscout-6.1}/webscout/models.py +0 -0
  130. {webscout-5.9 → webscout-6.1}/webscout/requestsHTMLfix.py +0 -0
  131. {webscout-5.9 → webscout-6.1}/webscout/tempid.py +0 -0
  132. {webscout-5.9 → webscout-6.1}/webscout/transcriber.py +0 -0
  133. {webscout-5.9 → webscout-6.1}/webscout/webai.py +0 -0
  134. {webscout-5.9 → webscout-6.1}/webscout/webscout_search_async.py +0 -0
  135. {webscout-5.9 → webscout-6.1}/webscout/websx_search.py +0 -0
  136. {webscout-5.9 → webscout-6.1}/webscout.egg-info/dependency_links.txt +0 -0
  137. {webscout-5.9 → webscout-6.1}/webscout.egg-info/entry_points.txt +0 -0
  138. {webscout-5.9 → webscout-6.1}/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.9
3
+ Version: 6.1
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
@@ -33,7 +33,6 @@ Requires-Dist: g4f[webdriver]
33
33
  Requires-Dist: rich
34
34
  Requires-Dist: beautifulsoup4
35
35
  Requires-Dist: markdownify
36
- Requires-Dist: pydantic
37
36
  Requires-Dist: requests
38
37
  Requires-Dist: google-generativeai
39
38
  Requires-Dist: lxml>=5.2.2
@@ -44,8 +43,6 @@ Requires-Dist: appdirs
44
43
  Requires-Dist: tls_client
45
44
  Requires-Dist: clipman
46
45
  Requires-Dist: playsound
47
- Requires-Dist: poe_api_wrapper
48
- Requires-Dist: pyreqwest_impersonate
49
46
  Requires-Dist: ollama
50
47
  Requires-Dist: pyfiglet
51
48
  Requires-Dist: pillow
@@ -56,6 +53,13 @@ Requires-Dist: emoji
56
53
  Requires-Dist: openai
57
54
  Requires-Dist: prompt-toolkit
58
55
  Requires-Dist: fake_useragent
56
+ Requires-Dist: primp
57
+ Requires-Dist: pyreqwest_impersonate
58
+ Requires-Dist: lxml_html_clean
59
+ Requires-Dist: gradio_client
60
+ Requires-Dist: psutil
61
+ Requires-Dist: colorlog
62
+ Requires-Dist: yaspin
59
63
  Provides-Extra: dev
60
64
  Requires-Dist: ruff>=0.1.6; extra == "dev"
61
65
  Requires-Dist: pytest>=7.4.2; extra == "dev"
@@ -64,6 +68,7 @@ Requires-Dist: llama-cpp-python; extra == "local"
64
68
  Requires-Dist: colorama; extra == "local"
65
69
  Requires-Dist: numpy; extra == "local"
66
70
  Requires-Dist: huggingface_hub[cli]; extra == "local"
71
+ Requires-Dist: unicorn; extra == "local"
67
72
 
68
73
  <div align="center">
69
74
  <!-- Replace `#` with your actual links -->
@@ -108,7 +113,7 @@ Requires-Dist: huggingface_hub[cli]; extra == "local"
108
113
  * **Text-to-Speech (TTS):** Convert text into natural-sounding speech using various TTS providers.
109
114
  * **WebAI:** Experience the power of terminal-based GPT and an open interpreter for code execution and more.
110
115
  * **Offline LLMs:** Utilize powerful language models offline with GGUF support.
111
- * **Extensive Provider Ecosystem:** Explore a vast collection of providers, including Poe, BasedGPT, DeepSeek, and many others.
116
+ * **Extensive Provider Ecosystem:** Explore a vast collection of providers, including BasedGPT, DeepSeek, and many others.
112
117
  * **Local LLM Execution:** Run GGUF models locally with minimal configuration.
113
118
  * **Rawdog Scripting:** Execute Python scripts directly within your terminal using the `rawdog` feature.
114
119
  * **GGUF Conversion & Quantization:** Convert and quantize Hugging Face models to GGUF format.
@@ -871,7 +876,7 @@ print(result)
871
876
  ___
872
877
  </details>
873
878
 
874
- ### 🖼️ Text to Images - DeepInfraImager, PollinationsAI, BlackboxAIImager, AiForceimagger, NexraImager, HFimager, ArtbitImager
879
+ ### 🖼️ Text to Images - DeepInfraImager, PollinationsAI, BlackboxAIImager, AiForceimager, NexraImager, HFimager, ArtbitImager, NinjaImager, WebSimAI, AmigoImager
875
880
 
876
881
  **Every TTI provider has the same usage code, you just need to change the import.**
877
882
 
@@ -900,7 +905,7 @@ voicepods.play_audio(audio_file)
900
905
 
901
906
  ```python
902
907
  from webscout import WEBS as w
903
- 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
908
+ R = w().chat("Who are you", model='gpt-4o-mini') # mixtral-8x7b, llama-3.1-70b, claude-3-haiku, gpt-4o-mini
904
909
  print(R)
905
910
  ```
906
911
 
@@ -1128,10 +1133,6 @@ response_str = a.chat(prompt)
1128
1133
  print(response_str)
1129
1134
  ```
1130
1135
 
1131
- ### `Poe` - Chat with Poe
1132
-
1133
- Usage code is similar to other providers.
1134
-
1135
1136
  ### `BasedGPT` - Chat with GPT
1136
1137
 
1137
1138
  ```python
@@ -1210,27 +1211,6 @@ message = ai.get_message(response)
1210
1211
  print(message)
1211
1212
  ```
1212
1213
 
1213
- ### `Deepinfra` - VLM
1214
-
1215
- ```python
1216
- from webscout.Provider import VLM
1217
-
1218
- # Load your image
1219
- image_path = r"C:\Users\koula\OneDrive\Desktop\Webscout\photo_2024-03-25_19-23-40.jpg"
1220
-
1221
- vlm_instance = VLM(model="llava-hf/llava-1.5-7b-hf", is_conversation=True, max_tokens=600, timeout=30, system_prompt="You are a Helpful AI.")
1222
- image_base64 = vlm_instance.encode_image_to_base64(image_path)
1223
-
1224
- prompt = {
1225
- "content": "What is in this image?",
1226
- "image": image_base64
1227
- }
1228
-
1229
- # Generate a response
1230
- response = vlm_instance.chat(prompt)
1231
- print(response)
1232
-
1233
- ```
1234
1214
 
1235
1215
  ### `GROQ`
1236
1216
 
@@ -1344,117 +1324,120 @@ print(a.chat("HelpingAI-9B"))
1344
1324
  ```python
1345
1325
  import json
1346
1326
  import logging
1347
- from webscout import LLAMA3, WEBS
1327
+ from webscout import Julius, WEBS
1348
1328
  from webscout.Agents.functioncall import FunctionCallingAgent
1329
+ from rich import print
1349
1330
 
1350
- # Define tools that the agent can use
1351
- tools = [
1352
- {
1353
- "type": "function",
1354
- "function": {
1355
- "name": "UserDetail",
1356
- "parameters": {
1357
- "type": "object",
1358
- "title": "UserDetail",
1359
- "properties": {
1360
- "name": {
1361
- "title": "Name",
1362
- "type": "string"
1331
+ class FunctionExecutor:
1332
+ def __init__(self, llama):
1333
+ self.llama = llama
1334
+
1335
+ def execute_web_search(self, arguments):
1336
+ query = arguments.get("query")
1337
+ if not query:
1338
+ return "Please provide a search query."
1339
+ with WEBS() as webs:
1340
+ search_results = webs.text(query, max_results=5)
1341
+ prompt = (
1342
+ f"Based on the following search results:\n\n{search_results}\n\n"
1343
+ f"Question: {query}\n\n"
1344
+ "Please provide a comprehensive answer to the question based on the search results above. "
1345
+ "Include relevant webpage URLs in your answer when appropriate. "
1346
+ "If the search results don't contain relevant information, please state that and provide the best answer you can based on your general knowledge."
1347
+ )
1348
+ return self.llama.chat(prompt)
1349
+
1350
+ def execute_general_ai(self, arguments):
1351
+ question = arguments.get("question")
1352
+ if not question:
1353
+ return "Please provide a question."
1354
+ return self.llama.chat(question)
1355
+
1356
+ def execute_UserDetail(self, arguments):
1357
+ name = arguments.get("name")
1358
+ age = arguments.get("age")
1359
+ return f"User details - Name: {name}, Age: {age}"
1360
+
1361
+ def main():
1362
+ tools = [
1363
+ {
1364
+ "type": "function",
1365
+ "function": {
1366
+ "name": "UserDetail",
1367
+ "parameters": {
1368
+ "type": "object",
1369
+ "properties": {
1370
+ "name": {"title": "Name", "type": "string"},
1371
+ "age": {"title": "Age", "type": "integer"}
1363
1372
  },
1364
- "age": {
1365
- "title": "Age",
1366
- "type": "integer"
1367
- }
1368
- },
1369
- "required": ["name", "age"]
1373
+ "required": ["name", "age"]
1374
+ }
1370
1375
  }
1371
- }
1372
- },
1373
- {
1374
- "type": "function",
1375
- "function": {
1376
- "name": "web_search",
1377
- "description": "Search query on google",
1378
- "parameters": {
1379
- "type": "object",
1380
- "properties": {
1381
- "query": {
1382
- "type": "string",
1383
- "description": "web search query"
1384
- }
1385
- },
1386
- "required": ["query"]
1376
+ },
1377
+ {
1378
+ "type": "function",
1379
+ "function": {
1380
+ "name": "web_search",
1381
+ "description": "Search the web for information using Google Search.",
1382
+ "parameters": {
1383
+ "type": "object",
1384
+ "properties": {
1385
+ "query": {
1386
+ "type": "string",
1387
+ "description": "The search query to be executed."
1388
+ }
1389
+ },
1390
+ "required": ["query"]
1391
+ }
1387
1392
  }
1388
- }
1389
- },
1390
- { # New general AI tool
1391
- "type": "function",
1392
- "function": {
1393
- "name": "general_ai",
1394
- "description": "Use general AI knowledge to answer the question",
1395
- "parameters": {
1396
- "type": "object",
1397
- "properties": {
1398
- "question": {
1399
- "type": "string",
1400
- "description": "The question to answer"
1401
- }
1402
- },
1403
- "required": ["question"]
1393
+ },
1394
+ {
1395
+ "type": "function",
1396
+ "function": {
1397
+ "name": "general_ai",
1398
+ "description": "Use general AI knowledge to answer the question",
1399
+ "parameters": {
1400
+ "type": "object",
1401
+ "properties": {
1402
+ "question": {"type": "string", "description": "The question to answer"}
1403
+ },
1404
+ "required": ["question"]
1405
+ }
1404
1406
  }
1405
1407
  }
1406
- }
1407
- ]
1408
+ ]
1408
1409
 
1409
- # Initialize the FunctionCallingAgent with the specified tools
1410
- agent = FunctionCallingAgent(tools=tools)
1411
- llama = LLAMA3()
1412
- from rich import print
1413
- # Input message from the user
1414
- user = input(">>> ")
1415
- message = user
1416
- function_call_data = agent.function_call_handler(message)
1417
- print(f"Function Call Data: {function_call_data}")
1418
-
1419
- # Check for errors in the function call data
1420
- if "error" not in function_call_data:
1421
- function_name = function_call_data.get("tool_name") # Use 'tool_name' instead of 'name'
1422
- if function_name == "web_search":
1423
- arguments = function_call_data.get("tool_input", {}) # Get tool input arguments
1424
- query = arguments.get("query")
1425
- if query:
1426
- with WEBS() as webs:
1427
- search_results = webs.text(query, max_results=5)
1428
- prompt = (
1429
- f"Based on the following search results:\n\n{search_results}\n\n"
1430
- f"Question: {user}\n\n"
1431
- "Please provide a comprehensive answer to the question based on the search results above. "
1432
- "Include relevant webpage URLs in your answer when appropriate. "
1433
- "If the search results don't contain relevant information, please state that and provide the best answer you can based on your general knowledge."
1434
- )
1435
- response = llama.chat(prompt)
1436
- for c in response:
1437
- print(c, end="", flush=True)
1410
+ agent = FunctionCallingAgent(tools=tools)
1411
+ llama = Julius()
1412
+ function_executor = FunctionExecutor(llama)
1438
1413
 
1414
+ user_input = input(">>> ")
1415
+ function_call_data = agent.function_call_handler(user_input)
1416
+ print(f"Function Call Data: {function_call_data}")
1417
+
1418
+ try:
1419
+ if "error" not in function_call_data:
1420
+ function_name = function_call_data.get("tool_name")
1421
+ arguments = function_call_data.get("tool_input", {})
1422
+
1423
+ execute_function = getattr(function_executor, f"execute_{function_name}", None)
1424
+ if execute_function:
1425
+ result = execute_function(arguments)
1426
+ print("Function Execution Result:")
1427
+ for c in result:
1428
+ print(c, end="", flush=True)
1429
+ else:
1430
+ print(f"Unknown function: {function_name}")
1439
1431
  else:
1440
- print("Please provide a search query.")
1441
- elif function_name == "general_ai": # Handle general AI tool
1442
- arguments = function_call_data.get("tool_input", {})
1443
- question = arguments.get("question")
1444
- if question:
1445
- response = llama.chat(question) # Use LLM directly
1446
- for c in response:
1447
- print(c, end="", flush=True)
1448
- else:
1449
- print("Please provide a question.")
1450
- else:
1451
- result = agent.execute_function(function_call_data)
1452
- print(f"Function Execution Result: {result}")
1453
- else:
1454
- print(f"Error: {function_call_data['error']}")
1432
+ print(f"Error: {function_call_data['error']}")
1433
+ except Exception as e:
1434
+ print(f"An error occurred: {str(e)}")
1435
+
1436
+ if __name__ == "__main__":
1437
+ main()
1455
1438
  ```
1456
1439
 
1457
- ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, Editee, AI21, Chatify, Cerebras, X0GPT, Lepton, GEMINIAPI, Cleeai, Elmo, Genspark, Upstage, Free2GPT, Bing, DiscordRocks, GPTWeb, AIGameIO, LlamaTutor, PromptRefine, AIUncensored, TutorAI, Bixin, ChatGPTES
1440
+ ### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek, Editee, AI21, Chatify, Cerebras, X0GPT, Lepton, GEMINIAPI, Cleeai, Elmo, Genspark, Upstage, Free2GPT, Bing, DiscordRocks, GPTWeb, AIGameIO, LlamaTutor, PromptRefine, AIUncensored, TutorAI, Bixin, ChatGPTES, Bagoodex, ChatHub, AmigoChat, AIMathGPT, GaurishCerebras, NinjaChat, GeminiPro
1458
1441
 
1459
1442
  Code is similar to other providers.
1460
1443
 
@@ -1493,24 +1476,16 @@ Webscout can now run GGUF models locally. You can download and run your favorite
1493
1476
  **Example:**
1494
1477
 
1495
1478
  ```python
1496
- from webscout.Local.utils import download_model
1497
- from webscout.Local.model import Model
1498
- from webscout.Local.thread import Thread
1499
- from webscout.Local import formats
1500
-
1501
- # 1. Download the model
1502
- repo_id = "microsoft/Phi-3-mini-4k-instruct-gguf" # Replace with the desired Hugging Face repo
1503
- filename = "Phi-3-mini-4k-instruct-q4.gguf" # Replace with the correct filename
1504
- model_path = download_model(repo_id, filename, token="")
1505
-
1506
- # 2. Load the model
1507
- model = Model(model_path, n_gpu_layers=4)
1508
-
1509
- # 3. Create a Thread for conversation
1510
- thread = Thread(model, formats.phi3)
1511
-
1512
- # 4. Start interacting with the model
1513
- thread.interact()
1479
+ from webscout.Local import *
1480
+ model_path = download_model("Qwen/Qwen2.5-0.5B-Instruct-GGUF", "qwen2.5-0.5b-instruct-q2_k.gguf", token=None)
1481
+ model = Model(model_path, n_gpu_layers=0, context_length=2048)
1482
+ thread = Thread(model, format=chatml)
1483
+ # print(thread.send("hi")) #send a single msg to ai
1484
+
1485
+ # thread.interact() # interact with the model in terminal
1486
+ # start webui
1487
+ # webui = WebUI(thread)
1488
+ # webui.start(host="0.0.0.0", port=8080, ssl=True) #Use ssl=True and make cert and key for https
1514
1489
  ```
1515
1490
 
1516
1491
  ## 🐶 Local-rawdog