webscout 7.8__py3-none-any.whl → 8.0__py3-none-any.whl
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.
- webscout/Bard.py +5 -25
- webscout/DWEBS.py +476 -476
- webscout/Extra/GitToolkit/__init__.py +10 -0
- webscout/Extra/GitToolkit/gitapi/__init__.py +12 -0
- webscout/Extra/GitToolkit/gitapi/repository.py +195 -0
- webscout/Extra/GitToolkit/gitapi/user.py +96 -0
- webscout/Extra/GitToolkit/gitapi/utils.py +62 -0
- webscout/Extra/YTToolkit/ytapi/video.py +232 -103
- webscout/Extra/__init__.py +2 -0
- webscout/Extra/autocoder/__init__.py +1 -1
- webscout/Extra/autocoder/{rawdog.py → autocoder.py} +849 -849
- webscout/Extra/tempmail/__init__.py +26 -0
- webscout/Extra/tempmail/async_utils.py +141 -0
- webscout/Extra/tempmail/base.py +156 -0
- webscout/Extra/tempmail/cli.py +187 -0
- webscout/Extra/tempmail/mail_tm.py +361 -0
- webscout/Extra/tempmail/temp_mail_io.py +292 -0
- webscout/Provider/AISEARCH/__init__.py +5 -1
- webscout/Provider/AISEARCH/hika_search.py +194 -0
- webscout/Provider/AISEARCH/monica_search.py +246 -0
- webscout/Provider/AISEARCH/scira_search.py +320 -0
- webscout/Provider/AISEARCH/webpilotai_search.py +281 -0
- webscout/Provider/AllenAI.py +255 -122
- webscout/Provider/DeepSeek.py +1 -2
- webscout/Provider/Deepinfra.py +296 -286
- webscout/Provider/ElectronHub.py +709 -716
- webscout/Provider/ExaAI.py +261 -0
- webscout/Provider/ExaChat.py +28 -6
- webscout/Provider/Gemini.py +167 -165
- webscout/Provider/GithubChat.py +2 -1
- webscout/Provider/Groq.py +38 -24
- webscout/Provider/LambdaChat.py +2 -1
- webscout/Provider/Netwrck.py +3 -2
- webscout/Provider/OpenGPT.py +199 -0
- webscout/Provider/PI.py +39 -24
- webscout/Provider/TextPollinationsAI.py +232 -230
- webscout/Provider/Youchat.py +326 -296
- webscout/Provider/__init__.py +10 -4
- webscout/Provider/ai4chat.py +58 -56
- webscout/Provider/akashgpt.py +34 -22
- webscout/Provider/copilot.py +427 -427
- webscout/Provider/freeaichat.py +9 -2
- webscout/Provider/labyrinth.py +121 -20
- webscout/Provider/llmchatco.py +306 -0
- webscout/Provider/scira_chat.py +271 -0
- webscout/Provider/typefully.py +280 -0
- webscout/Provider/uncovr.py +312 -299
- webscout/Provider/yep.py +64 -12
- webscout/__init__.py +38 -36
- webscout/cli.py +293 -293
- webscout/conversation.py +350 -17
- webscout/litprinter/__init__.py +59 -667
- webscout/optimizers.py +419 -419
- webscout/update_checker.py +14 -12
- webscout/version.py +1 -1
- webscout/webscout_search.py +1346 -1282
- webscout/webscout_search_async.py +877 -813
- {webscout-7.8.dist-info → webscout-8.0.dist-info}/METADATA +44 -39
- {webscout-7.8.dist-info → webscout-8.0.dist-info}/RECORD +63 -46
- webscout/Provider/DARKAI.py +0 -225
- webscout/Provider/EDITEE.py +0 -192
- webscout/litprinter/colors.py +0 -54
- {webscout-7.8.dist-info → webscout-8.0.dist-info}/LICENSE.md +0 -0
- {webscout-7.8.dist-info → webscout-8.0.dist-info}/WHEEL +0 -0
- {webscout-7.8.dist-info → webscout-8.0.dist-info}/entry_points.txt +0 -0
- {webscout-7.8.dist-info → webscout-8.0.dist-info}/top_level.txt +0 -0
webscout/Provider/yep.py
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import time
|
|
2
1
|
import uuid
|
|
3
2
|
import cloudscraper
|
|
4
3
|
import json
|
|
5
4
|
|
|
6
|
-
from typing import Any, Dict, Optional, Generator, Union
|
|
7
|
-
from dataclasses import dataclass, asdict
|
|
8
|
-
from datetime import date
|
|
5
|
+
from typing import Any, Dict, Optional, Generator, Union, List, TypeVar
|
|
9
6
|
|
|
10
7
|
from webscout.AIutel import Optimizers
|
|
11
|
-
from webscout.AIutel import Conversation
|
|
12
8
|
from webscout.AIutel import AwesomePrompts
|
|
13
9
|
from webscout.AIbase import Provider
|
|
14
|
-
from webscout import
|
|
10
|
+
from webscout import exceptions
|
|
15
11
|
from webscout.litagent import LitAgent
|
|
12
|
+
from webscout.conversation import Conversation, Fn
|
|
13
|
+
|
|
14
|
+
T = TypeVar('T')
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
class YEPCHAT(Provider):
|
|
@@ -39,7 +38,8 @@ class YEPCHAT(Provider):
|
|
|
39
38
|
model: str = "DeepSeek-R1-Distill-Qwen-32B",
|
|
40
39
|
temperature: float = 0.6,
|
|
41
40
|
top_p: float = 0.7,
|
|
42
|
-
browser: str = "chrome"
|
|
41
|
+
browser: str = "chrome",
|
|
42
|
+
tools: Optional[List[Fn]] = None
|
|
43
43
|
):
|
|
44
44
|
"""
|
|
45
45
|
Initializes the YEPCHAT provider with the specified parameters.
|
|
@@ -51,6 +51,11 @@ class YEPCHAT(Provider):
|
|
|
51
51
|
|
|
52
52
|
>>> ai.chat("Tell me a joke", stream=True)
|
|
53
53
|
Initiates a chat with the Yep API using the provided prompt.
|
|
54
|
+
|
|
55
|
+
>>> weather_tool = Fn(name="get_weather", description="Get the current weather", parameters={"location": "string"})
|
|
56
|
+
>>> ai = YEPCHAT(tools=[weather_tool])
|
|
57
|
+
>>> ai.chat("What's the weather in New York?")
|
|
58
|
+
Uses the weather tool to provide weather information.
|
|
54
59
|
"""
|
|
55
60
|
if model not in self.AVAILABLE_MODELS:
|
|
56
61
|
raise ValueError(
|
|
@@ -103,7 +108,7 @@ class YEPCHAT(Provider):
|
|
|
103
108
|
else intro or Conversation.intro
|
|
104
109
|
)
|
|
105
110
|
self.conversation = Conversation(
|
|
106
|
-
is_conversation, self.max_tokens_to_sample, filepath, update_file
|
|
111
|
+
is_conversation, self.max_tokens_to_sample, filepath, update_file, tools=tools
|
|
107
112
|
)
|
|
108
113
|
self.conversation.history_offset = history_offset
|
|
109
114
|
self.session.proxies = proxies
|
|
@@ -150,6 +155,7 @@ class YEPCHAT(Provider):
|
|
|
150
155
|
) -> Union[Dict[str, Any], Generator]:
|
|
151
156
|
"""
|
|
152
157
|
Sends a prompt to the Yep API and returns the response.
|
|
158
|
+
Now supports tool calling functionality.
|
|
153
159
|
|
|
154
160
|
Examples:
|
|
155
161
|
>>> ai = YEPCHAT()
|
|
@@ -158,6 +164,11 @@ class YEPCHAT(Provider):
|
|
|
158
164
|
|
|
159
165
|
>>> ai.ask("Tell me a joke", stream=True)
|
|
160
166
|
Streams the response from the Yep API.
|
|
167
|
+
|
|
168
|
+
>>> weather_tool = Fn(name="get_weather", description="Get the current weather", parameters={"location": "string"})
|
|
169
|
+
>>> ai = YEPCHAT(tools=[weather_tool])
|
|
170
|
+
>>> ai.ask("What's the weather in New York?")
|
|
171
|
+
Will use the weather tool to provide response.
|
|
161
172
|
"""
|
|
162
173
|
conversation_prompt = self.conversation.gen_complete_prompt(prompt)
|
|
163
174
|
if optimizer:
|
|
@@ -219,7 +230,25 @@ class YEPCHAT(Provider):
|
|
|
219
230
|
yield resp if raw else resp
|
|
220
231
|
except json.JSONDecodeError:
|
|
221
232
|
pass
|
|
222
|
-
|
|
233
|
+
|
|
234
|
+
# Check if the response contains a tool call
|
|
235
|
+
response_data = self.conversation.handle_tool_response(streaming_text)
|
|
236
|
+
|
|
237
|
+
if response_data["is_tool_call"]:
|
|
238
|
+
# Handle tool call results
|
|
239
|
+
if response_data["success"]:
|
|
240
|
+
for tool_call in response_data.get("tool_calls", []):
|
|
241
|
+
tool_name = tool_call.get("name", "unknown_tool")
|
|
242
|
+
result = response_data["result"]
|
|
243
|
+
self.conversation.update_chat_history_with_tool(prompt, tool_name, result)
|
|
244
|
+
else:
|
|
245
|
+
# If tool call failed, update history with error
|
|
246
|
+
self.conversation.update_chat_history(prompt,
|
|
247
|
+
f"Error executing tool call: {response_data['result']}")
|
|
248
|
+
else:
|
|
249
|
+
# Normal response handling
|
|
250
|
+
self.conversation.update_chat_history(prompt, streaming_text)
|
|
251
|
+
|
|
223
252
|
except Exception as e:
|
|
224
253
|
raise exceptions.FailedToGenerateResponseError(f"Request failed: {e}")
|
|
225
254
|
|
|
@@ -242,12 +271,35 @@ class YEPCHAT(Provider):
|
|
|
242
271
|
response_data = response.json()
|
|
243
272
|
if 'choices' in response_data and len(response_data['choices']) > 0:
|
|
244
273
|
content = response_data['choices'][0].get('message', {}).get('content', '')
|
|
245
|
-
|
|
246
|
-
|
|
274
|
+
|
|
275
|
+
# Check if the response contains a tool call
|
|
276
|
+
tool_response = self.conversation.handle_tool_response(content)
|
|
277
|
+
|
|
278
|
+
if tool_response["is_tool_call"]:
|
|
279
|
+
# Process tool call
|
|
280
|
+
if tool_response["success"]:
|
|
281
|
+
# Get the first tool call for simplicity
|
|
282
|
+
if "tool_calls" in tool_response and len(tool_response["tool_calls"]) > 0:
|
|
283
|
+
tool_call = tool_response["tool_calls"][0]
|
|
284
|
+
tool_name = tool_call.get("name", "unknown_tool")
|
|
285
|
+
tool_result = tool_response["result"]
|
|
286
|
+
|
|
287
|
+
# Update chat history with tool call
|
|
288
|
+
self.conversation.update_chat_history_with_tool(prompt, tool_name, tool_result)
|
|
289
|
+
|
|
290
|
+
# Return tool result
|
|
291
|
+
return {"text": tool_result, "is_tool_call": True, "tool_name": tool_name}
|
|
292
|
+
|
|
293
|
+
# If tool call processing failed
|
|
294
|
+
return {"text": tool_response["result"], "is_tool_call": True, "error": True}
|
|
295
|
+
else:
|
|
296
|
+
# Normal response handling
|
|
297
|
+
self.conversation.update_chat_history(prompt, content)
|
|
298
|
+
return {"text": content}
|
|
247
299
|
else:
|
|
248
300
|
raise exceptions.FailedToGenerateResponseError("No response content found")
|
|
249
301
|
except Exception as e:
|
|
250
|
-
raise exceptions.FailedToGenerateResponseError(f"Request failed:
|
|
302
|
+
raise exceptions.FailedToGenerateResponseError(f"Request failed: e")
|
|
251
303
|
|
|
252
304
|
return for_stream() if stream else for_non_stream()
|
|
253
305
|
|
webscout/__init__.py
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
# webscout/__init__.py
|
|
2
|
-
|
|
3
|
-
from .webscout_search import WEBS
|
|
4
|
-
from .webscout_search_async import AsyncWEBS
|
|
5
|
-
from .version import __version__
|
|
6
|
-
from .DWEBS import *
|
|
7
|
-
from .tempid import *
|
|
8
|
-
from .LLM import VLM, LLM
|
|
9
|
-
from .Provider import *
|
|
10
|
-
from .Provider.TTI import *
|
|
11
|
-
from .Provider.TTS import *
|
|
12
|
-
from .Provider.AISEARCH import *
|
|
13
|
-
from .Extra import *
|
|
14
|
-
from .Litlogger import *
|
|
15
|
-
from .optimizers import *
|
|
16
|
-
from .swiftcli import *
|
|
17
|
-
from .litagent import LitAgent
|
|
18
|
-
from .scout import *
|
|
19
|
-
from .zeroart import *
|
|
20
|
-
from .yep_search import *
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
# webscout/__init__.py
|
|
2
|
+
|
|
3
|
+
from .webscout_search import WEBS
|
|
4
|
+
from .webscout_search_async import AsyncWEBS
|
|
5
|
+
from .version import __version__
|
|
6
|
+
from .DWEBS import *
|
|
7
|
+
from .tempid import *
|
|
8
|
+
from .LLM import VLM, LLM
|
|
9
|
+
from .Provider import *
|
|
10
|
+
from .Provider.TTI import *
|
|
11
|
+
from .Provider.TTS import *
|
|
12
|
+
from .Provider.AISEARCH import *
|
|
13
|
+
from .Extra import *
|
|
14
|
+
from .Litlogger import *
|
|
15
|
+
from .optimizers import *
|
|
16
|
+
from .swiftcli import *
|
|
17
|
+
from .litagent import LitAgent
|
|
18
|
+
from .scout import *
|
|
19
|
+
from .zeroart import *
|
|
20
|
+
from .yep_search import *
|
|
21
|
+
# # Import litprinter components for direct access from webscout
|
|
22
|
+
# from .litprinter import lit, litprint, ic, install, uninstall
|
|
23
|
+
agent = LitAgent()
|
|
24
|
+
|
|
25
|
+
__repo__ = "https://github.com/OE-LUCIFER/Webscout"
|
|
26
|
+
|
|
27
|
+
# Add update checker
|
|
28
|
+
from .update_checker import check_for_updates
|
|
29
|
+
try:
|
|
30
|
+
check_for_updates()
|
|
31
|
+
except Exception:
|
|
32
|
+
pass # Silently handle any update check errors
|
|
33
|
+
|
|
34
|
+
import logging
|
|
35
|
+
logging.getLogger("webscout").addHandler(logging.NullHandler())
|
|
36
|
+
|
|
37
|
+
# Import models for easy access
|
|
38
|
+
from .models import model
|