webscout 1.1.7__tar.gz → 1.1.9__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 (27) hide show
  1. {webscout-1.1.7/webscout.egg-info → webscout-1.1.9}/PKG-INFO +3 -9
  2. {webscout-1.1.7 → webscout-1.1.9}/README.md +2 -8
  3. {webscout-1.1.7 → webscout-1.1.9}/setup.py +1 -1
  4. {webscout-1.1.7 → webscout-1.1.9}/webscout/AIbase.py +69 -69
  5. {webscout-1.1.7 → webscout-1.1.9}/webscout/AIutel.py +654 -654
  6. {webscout-1.1.7 → webscout-1.1.9}/webscout/__init__.py +0 -4
  7. {webscout-1.1.7 → webscout-1.1.9}/webscout/cli.py +9 -8
  8. webscout-1.1.9/webscout/exceptions.py +10 -0
  9. {webscout-1.1.7 → webscout-1.1.9}/webscout/utils.py +4 -18
  10. webscout-1.1.9/webscout/version.py +2 -0
  11. {webscout-1.1.7 → webscout-1.1.9}/webscout/webscout_search.py +17 -3
  12. {webscout-1.1.7 → webscout-1.1.9}/webscout/webscout_search_async.py +107 -55
  13. {webscout-1.1.7 → webscout-1.1.9/webscout.egg-info}/PKG-INFO +3 -9
  14. webscout-1.1.7/webscout/exceptions.py +0 -2
  15. webscout-1.1.7/webscout/version.py +0 -2
  16. {webscout-1.1.7 → webscout-1.1.9}/LICENSE.md +0 -0
  17. {webscout-1.1.7 → webscout-1.1.9}/setup.cfg +0 -0
  18. {webscout-1.1.7 → webscout-1.1.9}/webscout/AI.py +0 -0
  19. {webscout-1.1.7 → webscout-1.1.9}/webscout/HelpingAI.py +0 -0
  20. {webscout-1.1.7 → webscout-1.1.9}/webscout/LLM.py +0 -0
  21. {webscout-1.1.7 → webscout-1.1.9}/webscout/__main__.py +0 -0
  22. {webscout-1.1.7 → webscout-1.1.9}/webscout/models.py +0 -0
  23. {webscout-1.1.7 → webscout-1.1.9}/webscout.egg-info/SOURCES.txt +0 -0
  24. {webscout-1.1.7 → webscout-1.1.9}/webscout.egg-info/dependency_links.txt +0 -0
  25. {webscout-1.1.7 → webscout-1.1.9}/webscout.egg-info/entry_points.txt +0 -0
  26. {webscout-1.1.7 → webscout-1.1.9}/webscout.egg-info/requires.txt +0 -0
  27. {webscout-1.1.7 → webscout-1.1.9}/webscout.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webscout
3
- Version: 1.1.7
3
+ Version: 1.1.9
4
4
  Summary: Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models
5
5
  Author: OEvortex
6
6
  Author-email: helpingai5@gmail.com
@@ -376,14 +376,8 @@ Here is an example of initializing the WEBS class:
376
376
  ```python3
377
377
  from webscout import WEBS
378
378
 
379
- # Instantiating the WEBS class from webscout module
380
- WEBS_instance = WEBS()
381
-
382
- # Fetching text results for the query "python programming" with a maximum of 5 results
383
- results = [result for result in WEBS_instance.text("python programming", max_results=5)]
384
-
385
- # Displaying the obtained results
386
- print(results)
379
+ R = WEBS().text("python programming", max_results=5)
380
+ print(R)
387
381
  ```
388
382
  Here is an example of initializing the AsyncWEBS class:
389
383
  ```python3
@@ -333,14 +333,8 @@ Here is an example of initializing the WEBS class:
333
333
  ```python3
334
334
  from webscout import WEBS
335
335
 
336
- # Instantiating the WEBS class from webscout module
337
- WEBS_instance = WEBS()
338
-
339
- # Fetching text results for the query "python programming" with a maximum of 5 results
340
- results = [result for result in WEBS_instance.text("python programming", max_results=5)]
341
-
342
- # Displaying the obtained results
343
- print(results)
336
+ R = WEBS().text("python programming", max_results=5)
337
+ print(R)
344
338
  ```
345
339
  Here is an example of initializing the AsyncWEBS class:
346
340
  ```python3
@@ -9,7 +9,7 @@ with open("README.md", encoding="utf-8") as f:
9
9
 
10
10
  setup(
11
11
  name="webscout",
12
- version="1.1.7", # Use the version variable from the version.py file
12
+ version="1.1.9", # Use the version variable from the version.py file
13
13
  description="Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com, you.com, etc Also containes AI models",
14
14
  long_description=README,
15
15
  long_description_content_type="text/markdown",
@@ -1,70 +1,70 @@
1
- from abc import ABC
2
- from abc import abstractmethod
3
-
4
-
5
- class Provider(ABC):
6
- """Base class for models class"""
7
-
8
- @abstractmethod
9
- def ask(
10
- self,
11
- prompt: str,
12
- stream: bool = False,
13
- raw: bool = False,
14
- optimizer: str = None,
15
- conversationally: bool = False,
16
- ) -> dict:
17
- """Chat with AI
18
-
19
- Args:
20
- prompt (str): Prompt to be sent
21
- stream (bool, optional): Flag for streaming response. Defaults to False.
22
- raw (bool, optional): Stream back raw response as received
23
- optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`
24
- conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
25
- Returns:
26
- dict : {}
27
- ```json
28
- {
29
- "completion": "\nNext: domestic cat breeds with short hair >>",
30
- "stop_reason": null,
31
- "truncated": false,
32
- "stop": null,
33
- "model": "llama-2-13b-chat",
34
- "log_id": "cmpl-3kYiYxSNDvgMShSzFooz6t",
35
- "exception": null
36
- }
37
- ```
38
- """
39
- raise NotImplementedError("Method needs to be implemented in subclass")
40
-
41
- @abstractmethod
42
- def chat(
43
- self,
44
- prompt: str,
45
- stream: bool = False,
46
- optimizer: str = None,
47
- conversationally: bool = False,
48
- ) -> str:
49
- """Generate response `str`
50
- Args:
51
- prompt (str): Prompt to be sent
52
- stream (bool, optional): Flag for streaming response. Defaults to False.
53
- optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`
54
- conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
55
- Returns:
56
- str: Response generated
57
- """
58
- raise NotImplementedError("Method needs to be implemented in subclass")
59
-
60
- @abstractmethod
61
- def get_message(self, response: dict) -> str:
62
- """Retrieves message only from response
63
-
64
- Args:
65
- response (dict): Response generated by `self.ask`
66
-
67
- Returns:
68
- str: Message extracted
69
- """
1
+ from abc import ABC
2
+ from abc import abstractmethod
3
+
4
+
5
+ class Provider(ABC):
6
+ """Base class for models class"""
7
+
8
+ @abstractmethod
9
+ def ask(
10
+ self,
11
+ prompt: str,
12
+ stream: bool = False,
13
+ raw: bool = False,
14
+ optimizer: str = None,
15
+ conversationally: bool = False,
16
+ ) -> dict:
17
+ """Chat with AI
18
+
19
+ Args:
20
+ prompt (str): Prompt to be sent
21
+ stream (bool, optional): Flag for streaming response. Defaults to False.
22
+ raw (bool, optional): Stream back raw response as received
23
+ optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`
24
+ conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
25
+ Returns:
26
+ dict : {}
27
+ ```json
28
+ {
29
+ "completion": "\nNext: domestic cat breeds with short hair >>",
30
+ "stop_reason": null,
31
+ "truncated": false,
32
+ "stop": null,
33
+ "model": "llama-2-13b-chat",
34
+ "log_id": "cmpl-3kYiYxSNDvgMShSzFooz6t",
35
+ "exception": null
36
+ }
37
+ ```
38
+ """
39
+ raise NotImplementedError("Method needs to be implemented in subclass")
40
+
41
+ @abstractmethod
42
+ def chat(
43
+ self,
44
+ prompt: str,
45
+ stream: bool = False,
46
+ optimizer: str = None,
47
+ conversationally: bool = False,
48
+ ) -> str:
49
+ """Generate response `str`
50
+ Args:
51
+ prompt (str): Prompt to be sent
52
+ stream (bool, optional): Flag for streaming response. Defaults to False.
53
+ optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`
54
+ conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
55
+ Returns:
56
+ str: Response generated
57
+ """
58
+ raise NotImplementedError("Method needs to be implemented in subclass")
59
+
60
+ @abstractmethod
61
+ def get_message(self, response: dict) -> str:
62
+ """Retrieves message only from response
63
+
64
+ Args:
65
+ response (dict): Response generated by `self.ask`
66
+
67
+ Returns:
68
+ str: Message extracted
69
+ """
70
70
  raise NotImplementedError("Method needs to be implemented in subclass")