webscout 5.4__py3-none-any.whl → 5.6__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.
- webscout/Agents/Onlinesearcher.py +3 -3
- webscout/Agents/__init__.py +0 -1
- webscout/Agents/functioncall.py +3 -3
- webscout/Provider/Bing.py +243 -0
- webscout/Provider/Chatify.py +1 -1
- webscout/Provider/Cloudflare.py +1 -1
- webscout/Provider/DARKAI.py +1 -1
- webscout/Provider/DiscordRocks.py +109 -246
- webscout/Provider/Farfalle.py +1 -1
- webscout/Provider/Free2GPT.py +234 -0
- webscout/{Agents/ai.py → Provider/GPTWeb.py} +40 -33
- webscout/Provider/Llama3.py +65 -62
- webscout/Provider/OLLAMA.py +1 -1
- webscout/Provider/PizzaGPT.py +1 -1
- webscout/Provider/RUBIKSAI.py +13 -3
- webscout/Provider/Reka.py +0 -1
- webscout/Provider/TTI/Nexra.py +120 -0
- webscout/Provider/TTI/__init__.py +4 -1
- webscout/Provider/TTI/aiforce.py +137 -0
- webscout/Provider/TTI/blackboximage.py +153 -0
- webscout/Provider/TTI/deepinfra.py +2 -2
- webscout/Provider/TeachAnything.py +1 -1
- webscout/Provider/Youchat.py +1 -1
- webscout/Provider/__init__.py +11 -6
- webscout/Provider/{NetFly.py → aigames.py} +76 -79
- webscout/Provider/cleeai.py +1 -1
- webscout/Provider/elmo.py +1 -1
- webscout/Provider/felo_search.py +1 -1
- webscout/Provider/genspark.py +1 -1
- webscout/Provider/julius.py +7 -1
- webscout/Provider/lepton.py +1 -1
- webscout/Provider/meta.py +1 -1
- webscout/Provider/turboseek.py +1 -1
- webscout/Provider/upstage.py +230 -0
- webscout/Provider/x0gpt.py +1 -1
- webscout/Provider/xdash.py +1 -1
- webscout/Provider/yep.py +2 -2
- webscout/tempid.py +46 -2
- webscout/version.py +1 -1
- webscout/webai.py +1 -1
- webscout/webscout_search_async.py +9 -9
- {webscout-5.4.dist-info → webscout-5.6.dist-info}/METADATA +7 -30
- {webscout-5.4.dist-info → webscout-5.6.dist-info}/RECORD +47 -42
- webscout/Provider/ThinkAnyAI.py +0 -219
- {webscout-5.4.dist-info → webscout-5.6.dist-info}/LICENSE.md +0 -0
- {webscout-5.4.dist-info → webscout-5.6.dist-info}/WHEEL +0 -0
- {webscout-5.4.dist-info → webscout-5.6.dist-info}/entry_points.txt +0 -0
- {webscout-5.4.dist-info → webscout-5.6.dist-info}/top_level.txt +0 -0
|
@@ -37,7 +37,7 @@ class AsyncWEBS(WEBS):
|
|
|
37
37
|
pass
|
|
38
38
|
|
|
39
39
|
async def achat(self, keywords: str, model: str = "gpt-3.5") -> str:
|
|
40
|
-
"""Initiates async chat session with
|
|
40
|
+
"""Initiates async chat session with webscout AI.
|
|
41
41
|
|
|
42
42
|
Args:
|
|
43
43
|
keywords (str): The initial message or question to send to the AI.
|
|
@@ -59,7 +59,7 @@ class AsyncWEBS(WEBS):
|
|
|
59
59
|
backend: str = "api",
|
|
60
60
|
max_results: Optional[int] = None,
|
|
61
61
|
) -> List[Dict[str, str]]:
|
|
62
|
-
"""
|
|
62
|
+
"""webscout async text search. Query params: https://duckduckgo.com/params.
|
|
63
63
|
|
|
64
64
|
Args:
|
|
65
65
|
keywords: keywords for query.
|
|
@@ -98,7 +98,7 @@ class AsyncWEBS(WEBS):
|
|
|
98
98
|
license_image: Optional[str] = None,
|
|
99
99
|
max_results: Optional[int] = None,
|
|
100
100
|
) -> List[Dict[str, str]]:
|
|
101
|
-
"""
|
|
101
|
+
"""webscout async images search. Query params: https://duckduckgo.com/params.
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
104
|
keywords: keywords for query.
|
|
@@ -152,7 +152,7 @@ class AsyncWEBS(WEBS):
|
|
|
152
152
|
license_videos: Optional[str] = None,
|
|
153
153
|
max_results: Optional[int] = None,
|
|
154
154
|
) -> List[Dict[str, str]]:
|
|
155
|
-
"""
|
|
155
|
+
"""webscout async videos search. Query params: https://duckduckgo.com/params.
|
|
156
156
|
|
|
157
157
|
Args:
|
|
158
158
|
keywords: keywords for query.
|
|
@@ -194,7 +194,7 @@ class AsyncWEBS(WEBS):
|
|
|
194
194
|
timelimit: Optional[str] = None,
|
|
195
195
|
max_results: Optional[int] = None,
|
|
196
196
|
) -> List[Dict[str, str]]:
|
|
197
|
-
"""
|
|
197
|
+
"""webscout async news search. Query params: https://duckduckgo.com/params.
|
|
198
198
|
|
|
199
199
|
Args:
|
|
200
200
|
keywords: keywords for query.
|
|
@@ -226,7 +226,7 @@ class AsyncWEBS(WEBS):
|
|
|
226
226
|
self,
|
|
227
227
|
keywords: str,
|
|
228
228
|
) -> List[Dict[str, str]]:
|
|
229
|
-
"""
|
|
229
|
+
"""webscout async instant answers. Query params: https://duckduckgo.com/params.
|
|
230
230
|
|
|
231
231
|
Args:
|
|
232
232
|
keywords: keywords for query,
|
|
@@ -251,7 +251,7 @@ class AsyncWEBS(WEBS):
|
|
|
251
251
|
keywords: str,
|
|
252
252
|
region: str = "wt-wt",
|
|
253
253
|
) -> List[Dict[str, str]]:
|
|
254
|
-
"""
|
|
254
|
+
"""webscout async suggestions. Query params: https://duckduckgo.com/params.
|
|
255
255
|
|
|
256
256
|
Args:
|
|
257
257
|
keywords: keywords for query.
|
|
@@ -288,7 +288,7 @@ class AsyncWEBS(WEBS):
|
|
|
288
288
|
radius: int = 0,
|
|
289
289
|
max_results: Optional[int] = None,
|
|
290
290
|
) -> List[Dict[str, str]]:
|
|
291
|
-
"""
|
|
291
|
+
"""webscout async maps search. Query params: https://duckduckgo.com/params.
|
|
292
292
|
|
|
293
293
|
Args:
|
|
294
294
|
keywords: keywords for query
|
|
@@ -337,7 +337,7 @@ class AsyncWEBS(WEBS):
|
|
|
337
337
|
from_: Optional[str] = None,
|
|
338
338
|
to: str = "en",
|
|
339
339
|
) -> List[Dict[str, str]]:
|
|
340
|
-
"""
|
|
340
|
+
"""webscout async translate.
|
|
341
341
|
|
|
342
342
|
Args:
|
|
343
343
|
keywords: string or list of strings to translate.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.6
|
|
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
|
|
@@ -27,7 +27,6 @@ License-File: LICENSE.md
|
|
|
27
27
|
Requires-Dist: docstring-inheritance
|
|
28
28
|
Requires-Dist: click
|
|
29
29
|
Requires-Dist: curl-cffi
|
|
30
|
-
Requires-Dist: lxml
|
|
31
30
|
Requires-Dist: nest-asyncio
|
|
32
31
|
Requires-Dist: g4f >=0.2.2.3
|
|
33
32
|
Requires-Dist: g4f[webdriver]
|
|
@@ -36,6 +35,8 @@ Requires-Dist: beautifulsoup4
|
|
|
36
35
|
Requires-Dist: markdownify
|
|
37
36
|
Requires-Dist: pydantic
|
|
38
37
|
Requires-Dist: requests
|
|
38
|
+
Requires-Dist: google-generativeai
|
|
39
|
+
Requires-Dist: lxml >=5.2.2
|
|
39
40
|
Requires-Dist: termcolor
|
|
40
41
|
Requires-Dist: orjson
|
|
41
42
|
Requires-Dist: PyYAML
|
|
@@ -53,6 +54,7 @@ Requires-Dist: bson
|
|
|
53
54
|
Requires-Dist: cloudscraper
|
|
54
55
|
Requires-Dist: emoji
|
|
55
56
|
Requires-Dist: openai
|
|
57
|
+
Requires-Dist: prompt-toolkit
|
|
56
58
|
Provides-Extra: dev
|
|
57
59
|
Requires-Dist: ruff >=0.1.6 ; extra == 'dev'
|
|
58
60
|
Requires-Dist: pytest >=7.4.2 ; extra == 'dev'
|
|
@@ -829,7 +831,8 @@ print(result)
|
|
|
829
831
|
___
|
|
830
832
|
</details>
|
|
831
833
|
|
|
832
|
-
### Text to images - DeepInfraImager, PollinationsAI
|
|
834
|
+
### Text to images - DeepInfraImager, PollinationsAI, BlackboxAIImager, AiForceimagger, NexraImager
|
|
835
|
+
**Every TTI provider have same usage code just u need to change import **
|
|
833
836
|
```python
|
|
834
837
|
from webscout import DeepInfraImager
|
|
835
838
|
bot = DeepInfraImager()
|
|
@@ -1066,32 +1069,6 @@ print(response_str)
|
|
|
1066
1069
|
```
|
|
1067
1070
|
|
|
1068
1071
|
|
|
1069
|
-
### `ThinkAny` - AI search engine
|
|
1070
|
-
```python
|
|
1071
|
-
from webscout import ThinkAnyAI
|
|
1072
|
-
|
|
1073
|
-
ai = ThinkAnyAI(
|
|
1074
|
-
is_conversation=True,
|
|
1075
|
-
max_tokens=800,
|
|
1076
|
-
timeout=30,
|
|
1077
|
-
intro=None,
|
|
1078
|
-
filepath=None,
|
|
1079
|
-
update_file=True,
|
|
1080
|
-
proxies={},
|
|
1081
|
-
history_offset=10250,
|
|
1082
|
-
act=None,
|
|
1083
|
-
web_search=False,
|
|
1084
|
-
)
|
|
1085
|
-
|
|
1086
|
-
prompt = "what is meaning of life"
|
|
1087
|
-
|
|
1088
|
-
response = ai.ask(prompt)
|
|
1089
|
-
|
|
1090
|
-
# Extract and print the message from the response
|
|
1091
|
-
message = ai.get_message(response)
|
|
1092
|
-
print(message)
|
|
1093
|
-
```
|
|
1094
|
-
|
|
1095
1072
|
### `poe`- chat with poe
|
|
1096
1073
|
Usage code similar to other proviers
|
|
1097
1074
|
|
|
@@ -1405,7 +1382,7 @@ if "error" not in function_call_data:
|
|
|
1405
1382
|
else:
|
|
1406
1383
|
print(f"Error: {function_call_data['error']}")
|
|
1407
1384
|
```
|
|
1408
|
-
### LLAMA3, pizzagpt, RUBIKSAI, Koala, Darkai, AI4Chat, Farfalle, PIAI, Felo, XDASH, Julius, YouChat, YEPCHAT, Cloudflare, TurboSeek,
|
|
1385
|
+
### 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
|
|
1409
1386
|
code similar to other provider
|
|
1410
1387
|
### `LLM`
|
|
1411
1388
|
```python
|
|
@@ -12,18 +12,17 @@ webscout/cli.py,sha256=RlBKeS9CSIsiBMqlzxevWtKjbY9htkZvA7J0bM_hHE8,14999
|
|
|
12
12
|
webscout/exceptions.py,sha256=jqrZvxV2JnZFqvmCsKG1lQRd6fYQh7qk3ceA7m7-k9k,611
|
|
13
13
|
webscout/g4f.py,sha256=NNcnlOtIWV9R93UsBN4jBGBEJ9sJ-Np1WbgjkGVDcYc,24487
|
|
14
14
|
webscout/models.py,sha256=5iQIdtedT18YuTZ3npoG7kLMwcrKwhQ7928dl_7qZW0,692
|
|
15
|
-
webscout/tempid.py,sha256=
|
|
15
|
+
webscout/tempid.py,sha256=2a_YDFUCZy3TJVfqEPSLyMvHBjDk9gp5FiFCvJwsOaw,7984
|
|
16
16
|
webscout/transcriber.py,sha256=kRymTd69zCjXdduCf7Gabt93Kz1l5ubsCwfwqs-pHl8,22334
|
|
17
17
|
webscout/utils.py,sha256=2O8_lftBKsv5OEvVaXCN-h0sipup0m3jxzhFdWQrdY8,2873
|
|
18
|
-
webscout/version.py,sha256=
|
|
19
|
-
webscout/webai.py,sha256=
|
|
18
|
+
webscout/version.py,sha256=KI08BdmiHfkATxodx2s7Sg3CRosdzWRVqGfRbT9rh7c,44
|
|
19
|
+
webscout/webai.py,sha256=MzDWMFv8oI3wmeL3SwvxUrZdBRyh9MMn97kNTvgL5T4,87744
|
|
20
20
|
webscout/webscout_search.py,sha256=AOHkaMLmFvM1mS--wVyLiPrDAb5BPLaURBHjleWOi4w,43743
|
|
21
|
-
webscout/webscout_search_async.py,sha256=
|
|
21
|
+
webscout/webscout_search_async.py,sha256=2-RCa9Deahhw3Bti78kXfVaX8y3Aygy4L7HeCaITk9M,14519
|
|
22
22
|
webscout/websx_search.py,sha256=5hfkkmGFhyQzojUpvMzIOJ3DBZIBNS90UReaacsfu6s,521
|
|
23
|
-
webscout/Agents/Onlinesearcher.py,sha256=
|
|
24
|
-
webscout/Agents/__init__.py,sha256=
|
|
25
|
-
webscout/Agents/
|
|
26
|
-
webscout/Agents/functioncall.py,sha256=zMGF1H9fGz05lcJryqST0qkh44kTgbESUZaIfZkO1J0,7645
|
|
23
|
+
webscout/Agents/Onlinesearcher.py,sha256=Ra0LlPRPTcAt4Ahej4ao-EekvD77V_7LKv5GQcPMGyw,6556
|
|
24
|
+
webscout/Agents/__init__.py,sha256=qJXx2Q1yAupE0FJabXvs49Nxwm3IsREyuMWp8Q1VYiE,60
|
|
25
|
+
webscout/Agents/functioncall.py,sha256=aOyYu_CdZlZEC1XYI73aSCdJoj1IR--o_Do9NNzfO8g,7615
|
|
27
26
|
webscout/Extra/__init__.py,sha256=GG1qUwS-HspT4TeeAIT4qFpM8PaO1ZdQhpelctaM7Rs,99
|
|
28
27
|
webscout/Extra/autollama.py,sha256=qM8alxlWzg10BGIYKZBUtIEAXrkvEOWBwSxdPp3zq9I,6226
|
|
29
28
|
webscout/Extra/gguf.py,sha256=RvSp7xuaD6epAA9iAzthUnAQ3HA5N-svMyKUadAVnw8,7009
|
|
@@ -40,59 +39,65 @@ webscout/Local/utils.py,sha256=CSt9IqHhVGk_nJEnKvSFbLhC5nNf01e0MtwpgMmF9pA,6197
|
|
|
40
39
|
webscout/Provider/AI21.py,sha256=JBh-xnspxTZNMcl-Gd0Cgseqht9gTM64TUv9I4Imc9k,6218
|
|
41
40
|
webscout/Provider/Andi.py,sha256=mKhrnN_TR3rVEBy-oZosEcujF83hISiFeBVM1mHYz2k,10107
|
|
42
41
|
webscout/Provider/BasedGPT.py,sha256=u1s72bQ33iuBqf5u7SWdez8_Eu7MTCM_iZoEW91t9CI,8309
|
|
42
|
+
webscout/Provider/Bing.py,sha256=zxIzq7dlqaLskx9LsYppbMJuwfGtYid3Uh0gIhZ0hps,9001
|
|
43
43
|
webscout/Provider/Blackboxai.py,sha256=ioEhw03eiM65tPvgyZKOCGFzqOT8la59W7HydNGILIw,16815
|
|
44
|
-
webscout/Provider/Chatify.py,sha256=
|
|
45
|
-
webscout/Provider/Cloudflare.py,sha256=
|
|
44
|
+
webscout/Provider/Chatify.py,sha256=CL3fJuCOHkS9fEDcKaEKaiNkuHpRJsS3ioJvGL3sBw0,6333
|
|
45
|
+
webscout/Provider/Cloudflare.py,sha256=018DBwjEpMYp7UeMF1A0Ec7a329GWis-bqicTG3gPbk,10768
|
|
46
46
|
webscout/Provider/Cohere.py,sha256=oL9kAv--RSkEQxwkPTq1Wi57Wkgg0WNvL82CpTj22YY,8264
|
|
47
|
-
webscout/Provider/DARKAI.py,sha256=
|
|
47
|
+
webscout/Provider/DARKAI.py,sha256=Iv2ulI1voGfmsHzoS1PmzBupruKUNbCn6gtrYRlzPp8,9072
|
|
48
48
|
webscout/Provider/Deepinfra.py,sha256=9ABd5jmcMOydqrs0wtXMmkQF6I2up8AE2SHXy2LSIuU,18418
|
|
49
49
|
webscout/Provider/Deepseek.py,sha256=jp8cZhbmscDjlXLCGI8MhDGORkbbxyeUlCqu5Z5GGSI,9210
|
|
50
|
-
webscout/Provider/DiscordRocks.py,sha256=
|
|
50
|
+
webscout/Provider/DiscordRocks.py,sha256=SF--1fCfVKKUgIcrKUNpParNyqvTysQIcK9BKZv-Acg,11342
|
|
51
51
|
webscout/Provider/EDITEE.py,sha256=cGMTQiMROo7ohSBTOzs2vZneUs1Usjh_7ZFQ61JtD-k,7734
|
|
52
|
-
webscout/Provider/Farfalle.py,sha256=
|
|
52
|
+
webscout/Provider/Farfalle.py,sha256=eVmSB4Dq6P2epo8dd6CyCtyxvOMFwvk6f0Ikb9nZ2d0,9017
|
|
53
|
+
webscout/Provider/Free2GPT.py,sha256=qj21ViMIz06kw1A91scGtohPjQVgF_kb5xj37uv9Sho,8985
|
|
54
|
+
webscout/Provider/GPTWeb.py,sha256=egVGQ8cptr4wlCfrCNA2DM0oXYqhRcje9zxYK5txb2s,7429
|
|
53
55
|
webscout/Provider/Gemini.py,sha256=Vg2MLqQ_qxHkcN7Zikife1dyVK-y94ik8y6MAu-VzUI,7801
|
|
54
56
|
webscout/Provider/Groq.py,sha256=iqyewnxWwN7fMG-dqAR_SyUqImfyZS880lO5iaXso9c,28636
|
|
55
57
|
webscout/Provider/Koboldai.py,sha256=gpRgyDe4OQWwNqT7MWnNrJx4dnFmCW23KUx0Ezjgchk,15185
|
|
56
58
|
webscout/Provider/Llama.py,sha256=N01p3ZVD1HgRnNNxhjRhBVD4m_qiextdyF1KDfJlqbE,7703
|
|
57
|
-
webscout/Provider/Llama3.py,sha256=
|
|
58
|
-
webscout/Provider/
|
|
59
|
-
webscout/Provider/OLLAMA.py,sha256=VhvFJ3rHr1Wpgfv_-L70JlkL6x71z2lya9uLv1_kaUo,7015
|
|
59
|
+
webscout/Provider/Llama3.py,sha256=9jXo8k4ReFGkF01InzaBgUCKUJ0O5Zix3A0pHWRGtJU,7617
|
|
60
|
+
webscout/Provider/OLLAMA.py,sha256=mFkwjnKNS1AL6Qhgq_JuUInTRzF8IFPPHNwoBpynEkc,7016
|
|
60
61
|
webscout/Provider/Openai.py,sha256=32uxZmZOovzshMQmqDcJ39If7N_UW4B3EeYmaxP_GwE,19983
|
|
61
62
|
webscout/Provider/PI.py,sha256=IodVvGR_RIZpGJ0ypFF4U6NBMZAZ5O1BlRFMelot8so,8364
|
|
62
63
|
webscout/Provider/Perplexity.py,sha256=vcTjwFPi2WC-ck91V3QE_EtmCwFcWaQHku4aAzMoPPM,21461
|
|
63
64
|
webscout/Provider/Phind.py,sha256=NA_b3B4h-kutX6wdoEg4THPfZggl2UeXPbramzZ6oiU,19297
|
|
64
|
-
webscout/Provider/PizzaGPT.py,sha256=
|
|
65
|
+
webscout/Provider/PizzaGPT.py,sha256=tEuEJAGbv-mTd479i3EgaqHd4NwgkrmMW0fpSsGm_N0,7207
|
|
65
66
|
webscout/Provider/Poe.py,sha256=ObUxa-Fa2Dq7sJcV0hc65m09StS9uWsB2-bR2rSjXDY,7510
|
|
66
|
-
webscout/Provider/RUBIKSAI.py,sha256=
|
|
67
|
-
webscout/Provider/Reka.py,sha256=
|
|
68
|
-
webscout/Provider/TeachAnything.py,sha256
|
|
69
|
-
webscout/Provider/
|
|
70
|
-
webscout/Provider/
|
|
71
|
-
webscout/Provider/__init__.py,sha256=PzH_i_NIesvGNVw_CpEJmOuz_H5K2O9KDSOL0BkT7D0,2308
|
|
67
|
+
webscout/Provider/RUBIKSAI.py,sha256=uJlJfnX6kDU2mXhmmRZIn3U_y_bSntwmPuXmXH66W_8,8484
|
|
68
|
+
webscout/Provider/Reka.py,sha256=RZG1YZ5rd7WWmOTGoM_2IpEAKn1MzemHWYad4US4Q8s,8258
|
|
69
|
+
webscout/Provider/TeachAnything.py,sha256=0pQfktjnzM_7UElYVxWTIiHU2WvgNs57CxEuu89F5aw,6776
|
|
70
|
+
webscout/Provider/Youchat.py,sha256=WQz19_CBkL4eh-S6qO5Vq8torp607LFf2mMuTrtespA,9012
|
|
71
|
+
webscout/Provider/__init__.py,sha256=BBvEaCO-crW8zC60b4DtOYzDW05-Odyh6sYTaRX_GqA,2409
|
|
72
72
|
webscout/Provider/ai4chat.py,sha256=ewUcqjr3hrd27fgcvj6ijvoWVnSjdoA1iK0c8dn2VJo,8067
|
|
73
|
+
webscout/Provider/aigames.py,sha256=vGiGYNLvVBfwwsBSWwDKZbvJsFy8SYsFWRKqx7U7ALY,8083
|
|
73
74
|
webscout/Provider/cerebras.py,sha256=N9Z7wY9pQRhh7chMSDirgHd1GV8Jwjeb3RmYB1pcww4,7302
|
|
74
|
-
webscout/Provider/cleeai.py,sha256=
|
|
75
|
-
webscout/Provider/elmo.py,sha256=
|
|
76
|
-
webscout/Provider/felo_search.py,sha256
|
|
75
|
+
webscout/Provider/cleeai.py,sha256=9XRS48ZnBYCttiiTOSxk7tZIuQucELtas7dw3L2QRPg,7998
|
|
76
|
+
webscout/Provider/elmo.py,sha256=jLpIT7w1t8zFthSyvbHXMKsrKgTuOAJ91dg7zkeSjmY,9384
|
|
77
|
+
webscout/Provider/felo_search.py,sha256=7yQ4YpjCrlzdb4IENrVATiWoJqYTxR7QduUZK_klDWY,6842
|
|
77
78
|
webscout/Provider/geminiapi.py,sha256=sGg7AncRShMacLTBwn39CzG4zsRz9JSBwVO4LlUdt6g,7869
|
|
78
|
-
webscout/Provider/genspark.py,sha256=
|
|
79
|
-
webscout/Provider/julius.py,sha256=
|
|
79
|
+
webscout/Provider/genspark.py,sha256=X3l0Kuh1fwn7XHFDzKlV4kqc35iRouUC54UOi0snNjk,8551
|
|
80
|
+
webscout/Provider/julius.py,sha256=DS2jsEz_McEb_Ma57ji6w9hRMoYycOGxfjFkh9ZUXLw,9883
|
|
80
81
|
webscout/Provider/koala.py,sha256=qBtqjTvhoMQdDE8qUH0XuNa_x2bic77d7CUjIVboask,10106
|
|
81
|
-
webscout/Provider/lepton.py,sha256=
|
|
82
|
-
webscout/Provider/meta.py,sha256=
|
|
83
|
-
webscout/Provider/turboseek.py,sha256=
|
|
84
|
-
webscout/Provider/
|
|
85
|
-
webscout/Provider/
|
|
86
|
-
webscout/Provider/
|
|
82
|
+
webscout/Provider/lepton.py,sha256=4RiQ4YNJljX558yhSUqws6pf1Yhf7pWIesa4SRQCry8,7590
|
|
83
|
+
webscout/Provider/meta.py,sha256=PbqijyaLC7BFyI-T6gYgOpue_nMASgAUwM21SLHVkQs,30706
|
|
84
|
+
webscout/Provider/turboseek.py,sha256=msIDtdi7-7UbjdTyzXFZgpOt0_MAWRpEac8O7N0SsB8,8539
|
|
85
|
+
webscout/Provider/upstage.py,sha256=D2QSj7LcBsKyjp230LYdGwY6eO2j__wtK9d-8swjSW0,9204
|
|
86
|
+
webscout/Provider/x0gpt.py,sha256=jxQWGE0E1KjJCZas2BkRmNRWrijXbFAsE2amkPExcVw,6504
|
|
87
|
+
webscout/Provider/xdash.py,sha256=wyn1tBLwe4lo8LBqEFrr0hFDPj84z2p8PONdyzsj5f4,7369
|
|
88
|
+
webscout/Provider/yep.py,sha256=ge7a3cK02G6tbT0_q9glH7ujCx3QlgrqwBuHasQVYfQ,20581
|
|
89
|
+
webscout/Provider/TTI/Nexra.py,sha256=0zyf0nKJEPjOQd4z_2eNur14hfO9Z2JwHILLj9urdJI,4589
|
|
87
90
|
webscout/Provider/TTI/PollinationsAI.py,sha256=ELMc92hYXzS1uFZtRB-tbFb39C3YqpxnfM8dVcucPE0,5485
|
|
88
|
-
webscout/Provider/TTI/__init__.py,sha256=
|
|
89
|
-
webscout/Provider/TTI/
|
|
91
|
+
webscout/Provider/TTI/__init__.py,sha256=LBJjx-3nci9CqHUDx63zECido7VLqLZoSfDUI0qRD1I,131
|
|
92
|
+
webscout/Provider/TTI/aiforce.py,sha256=WRLQubp2NSel6Vmj77KTDv9f2eKmC8MzZRU7_c5IPWQ,5327
|
|
93
|
+
webscout/Provider/TTI/blackboximage.py,sha256=P3P8lg4-CCcDB1sPhVaP5oB9hqEhiErOTs2IX_Pv4ro,5848
|
|
94
|
+
webscout/Provider/TTI/deepinfra.py,sha256=4x3knEeQnjhan5Y6uogK3dXFVa3r8UjN51n91Wm7Qfg,5975
|
|
90
95
|
webscout/Provider/TTS/__init__.py,sha256=g19AOO1X9Qb-MNFpwhx5lODDWQiG7HxZCO9TmOYOHGc,54
|
|
91
96
|
webscout/Provider/TTS/streamElements.py,sha256=aaE55W_bAzvL3-pl7tHs_xU7dSZB5_V7ix-usoe-4aM,7398
|
|
92
97
|
webscout/Provider/TTS/voicepod.py,sha256=wAAnpcpDyej72UjIRhEnEmcoJnUqp1lPCLiiwJMYJic,4343
|
|
93
|
-
webscout-5.
|
|
94
|
-
webscout-5.
|
|
95
|
-
webscout-5.
|
|
96
|
-
webscout-5.
|
|
97
|
-
webscout-5.
|
|
98
|
-
webscout-5.
|
|
98
|
+
webscout-5.6.dist-info/LICENSE.md,sha256=9P0imsudI7MEvZe2pOcg8rKBn6E5FGHQ-riYozZI-Bk,2942
|
|
99
|
+
webscout-5.6.dist-info/METADATA,sha256=f9-yjy9WcVYYnrr8L-zve1dbnXH1eVnW5DKfDP0BszQ,48118
|
|
100
|
+
webscout-5.6.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
101
|
+
webscout-5.6.dist-info/entry_points.txt,sha256=Hh4YIIjvkqB9SVxZ2ri4DZUkgEu_WF_5_r_nZDIvfG8,73
|
|
102
|
+
webscout-5.6.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
|
|
103
|
+
webscout-5.6.dist-info/RECORD,,
|
webscout/Provider/ThinkAnyAI.py
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import requests
|
|
3
|
-
|
|
4
|
-
from webscout.AIutel import Optimizers
|
|
5
|
-
from webscout.AIutel import Conversation
|
|
6
|
-
from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
7
|
-
from webscout.AIbase import Provider, AsyncProvider
|
|
8
|
-
from webscout import exceptions
|
|
9
|
-
from typing import Any, AsyncGenerator, Dict
|
|
10
|
-
|
|
11
|
-
#------------------------------------ThinkAnyAI------------
|
|
12
|
-
class ThinkAnyAI(Provider):
|
|
13
|
-
def __init__(
|
|
14
|
-
self,
|
|
15
|
-
model: str = "claude-3-haiku",
|
|
16
|
-
locale: str = "en",
|
|
17
|
-
web_search: bool = True,
|
|
18
|
-
chunk_size: int = 64,
|
|
19
|
-
streaming: bool = True,
|
|
20
|
-
is_conversation: bool = True,
|
|
21
|
-
max_tokens: int = 600,
|
|
22
|
-
timeout: int = 30,
|
|
23
|
-
intro: str = None,
|
|
24
|
-
filepath: str = None,
|
|
25
|
-
update_file: bool = True,
|
|
26
|
-
proxies: dict = {},
|
|
27
|
-
history_offset: int = 10250,
|
|
28
|
-
act: str = None,
|
|
29
|
-
):
|
|
30
|
-
"""Initializes ThinkAnyAI
|
|
31
|
-
|
|
32
|
-
Args:
|
|
33
|
-
model (str): The AI model to be used for generating responses. Defaults to "claude-3-haiku".
|
|
34
|
-
locale (str): The language locale. Defaults to "en" (English).
|
|
35
|
-
web_search (bool): Whether to include web search results in the response. Defaults to False.
|
|
36
|
-
chunk_size (int): The size of data chunks when streaming responses. Defaults to 1.
|
|
37
|
-
streaming (bool): Whether to stream response data. Defaults to True.
|
|
38
|
-
is_conversation (bool, optional): Flag for chatting conversationally. Defaults to True.
|
|
39
|
-
max_tokens (int, optional): Maximum number of tokens to be generated upon completion. Defaults to 600.
|
|
40
|
-
timeout (int, optional): Http request timeout. Defaults to 30.
|
|
41
|
-
intro (str, optional): Conversation introductory prompt. Defaults to None.
|
|
42
|
-
filepath (str, optional): Path to file containing conversation history. Defaults to None.
|
|
43
|
-
update_file (bool, optional): Add new prompts and responses to the file. Defaults to True.
|
|
44
|
-
proxies (dict, optional): Http request proxies. Defaults to {}.
|
|
45
|
-
history_offset (int, optional): Limit conversation history to this number of last texts. Defaults to 10250.
|
|
46
|
-
act (str|int, optional): Awesome prompt key or index. (Used as intro). Defaults to None.
|
|
47
|
-
"""
|
|
48
|
-
self.base_url = "https://thinkany.ai/api"
|
|
49
|
-
self.model = model
|
|
50
|
-
self.locale = locale
|
|
51
|
-
self.web_search = web_search
|
|
52
|
-
self.chunk_size = chunk_size
|
|
53
|
-
self.streaming = streaming
|
|
54
|
-
self.last_response = {}
|
|
55
|
-
self.session = requests.Session()
|
|
56
|
-
self.session.proxies = proxies
|
|
57
|
-
|
|
58
|
-
self.__available_optimizers = (
|
|
59
|
-
method
|
|
60
|
-
for method in dir(Optimizers)
|
|
61
|
-
if callable(getattr(Optimizers, method)) and not method.startswith("__")
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
Conversation.intro = (
|
|
65
|
-
AwesomePrompts().get_act(
|
|
66
|
-
act, raise_not_found=True, default=None, case_insensitive=True
|
|
67
|
-
)
|
|
68
|
-
if act
|
|
69
|
-
else intro or Conversation.intro
|
|
70
|
-
)
|
|
71
|
-
self.conversation = Conversation(
|
|
72
|
-
is_conversation, max_tokens, filepath, update_file
|
|
73
|
-
)
|
|
74
|
-
self.conversation.history_offset = history_offset
|
|
75
|
-
|
|
76
|
-
def ask(
|
|
77
|
-
self,
|
|
78
|
-
prompt: str,
|
|
79
|
-
stream: bool = False,
|
|
80
|
-
raw: bool = False,
|
|
81
|
-
optimizer: str = None,
|
|
82
|
-
conversationally: bool = False,
|
|
83
|
-
) -> dict | AsyncGenerator:
|
|
84
|
-
|
|
85
|
-
conversation_prompt = self.conversation.gen_complete_prompt(prompt)
|
|
86
|
-
if optimizer:
|
|
87
|
-
if optimizer in self.__available_optimizers:
|
|
88
|
-
conversation_prompt = getattr(Optimizers, optimizer)(
|
|
89
|
-
conversation_prompt if conversationally else prompt
|
|
90
|
-
)
|
|
91
|
-
else:
|
|
92
|
-
raise Exception(
|
|
93
|
-
f"Optimizer is not one of {self.__available_optimizers}"
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
def initiate_conversation(query: str) -> str:
|
|
97
|
-
"""
|
|
98
|
-
Initiates a new conversation with the ThinkAny AI API.
|
|
99
|
-
|
|
100
|
-
Args:
|
|
101
|
-
query (str): The initial query to start the conversation.
|
|
102
|
-
|
|
103
|
-
Returns:
|
|
104
|
-
str: The UUID (Unique Identifier) of the conversation.
|
|
105
|
-
"""
|
|
106
|
-
url = f"{self.base_url}/new-conversation"
|
|
107
|
-
payload = {
|
|
108
|
-
"content": query,
|
|
109
|
-
"locale": self.locale,
|
|
110
|
-
"mode": "search" if self.web_search else "chat",
|
|
111
|
-
"model": self.model,
|
|
112
|
-
"source": "all",
|
|
113
|
-
}
|
|
114
|
-
response = self.session.post(url, json=payload)
|
|
115
|
-
return response.json().get("data", {}).get("uuid", "DevsDoCode")
|
|
116
|
-
|
|
117
|
-
def RAG_search(uuid: str) -> tuple[bool, list]:
|
|
118
|
-
"""
|
|
119
|
-
Performs a web search using the Retrieve And Generate (RAG) model.
|
|
120
|
-
|
|
121
|
-
Args:
|
|
122
|
-
uuid (str): The UUID of the conversation.
|
|
123
|
-
|
|
124
|
-
Returns:
|
|
125
|
-
tuple: A tuple containing a boolean indicating the success of the search
|
|
126
|
-
and a list of search result links.
|
|
127
|
-
"""
|
|
128
|
-
if not self.web_search:
|
|
129
|
-
return True, []
|
|
130
|
-
url = f"{self.base_url}/rag-search"
|
|
131
|
-
payload = {"conv_uuid": uuid}
|
|
132
|
-
response = self.session.post(url, json=payload)
|
|
133
|
-
links = [source["link"] for source in response.json().get("data", [])]
|
|
134
|
-
return response.json().get("message", "").strip(), links
|
|
135
|
-
|
|
136
|
-
def for_stream():
|
|
137
|
-
conversation_uuid = initiate_conversation(conversation_prompt)
|
|
138
|
-
web_search_result, links = RAG_search(conversation_uuid)
|
|
139
|
-
if not web_search_result:
|
|
140
|
-
print("Failed to generate WEB response. Making normal Querywebscout..")
|
|
141
|
-
|
|
142
|
-
url = f"{self.base_url}/chat"
|
|
143
|
-
payload = {
|
|
144
|
-
"role": "user",
|
|
145
|
-
"content": prompt,
|
|
146
|
-
"conv_uuid": conversation_uuid,
|
|
147
|
-
"model": self.model,
|
|
148
|
-
}
|
|
149
|
-
response = self.session.post(url, json=payload, stream=True)
|
|
150
|
-
complete_content = ""
|
|
151
|
-
for content in response.iter_content(
|
|
152
|
-
decode_unicode=True, chunk_size=self.chunk_size
|
|
153
|
-
):
|
|
154
|
-
complete_content += content
|
|
155
|
-
yield content if raw else dict(text=complete_content)
|
|
156
|
-
self.last_response.update(dict(text=complete_content, links=links))
|
|
157
|
-
self.conversation.update_chat_history(
|
|
158
|
-
prompt, self.get_message(self.last_response)
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
def for_non_stream():
|
|
162
|
-
for _ in for_stream():
|
|
163
|
-
pass
|
|
164
|
-
return self.last_response
|
|
165
|
-
|
|
166
|
-
return for_stream() if stream else for_non_stream()
|
|
167
|
-
|
|
168
|
-
def chat(
|
|
169
|
-
self,
|
|
170
|
-
prompt: str,
|
|
171
|
-
stream: bool = False,
|
|
172
|
-
optimizer: str = None,
|
|
173
|
-
conversationally: bool = False,
|
|
174
|
-
) -> str:
|
|
175
|
-
"""Generate response `str`
|
|
176
|
-
Args:
|
|
177
|
-
prompt (str): Prompt to be send.
|
|
178
|
-
stream (bool, optional): Flag for streaming response. Defaults to False.
|
|
179
|
-
optimizer (str, optional): Prompt optimizer name - `[code, shell_command]`. Defaults to None.
|
|
180
|
-
conversationally (bool, optional): Chat conversationally when using optimizer. Defaults to False.
|
|
181
|
-
Returns:
|
|
182
|
-
str: Response generated
|
|
183
|
-
"""
|
|
184
|
-
|
|
185
|
-
def for_stream():
|
|
186
|
-
for response in self.ask(
|
|
187
|
-
prompt, True, optimizer=optimizer, conversationally=conversationally
|
|
188
|
-
):
|
|
189
|
-
yield self.get_message(response)
|
|
190
|
-
|
|
191
|
-
def for_non_stream():
|
|
192
|
-
return self.get_message(
|
|
193
|
-
self.ask(
|
|
194
|
-
prompt,
|
|
195
|
-
False,
|
|
196
|
-
optimizer=optimizer,
|
|
197
|
-
conversationally=conversationally,
|
|
198
|
-
)
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
return for_stream() if stream else for_non_stream()
|
|
202
|
-
|
|
203
|
-
def get_message(self, response: Dict[str, Any]) -> str:
|
|
204
|
-
"""Retrieves message only from response
|
|
205
|
-
|
|
206
|
-
Args:
|
|
207
|
-
response (dict): Response generated by `self.ask`
|
|
208
|
-
|
|
209
|
-
Returns:
|
|
210
|
-
str: Message extracted
|
|
211
|
-
"""
|
|
212
|
-
assert isinstance(response, dict), "Response should be of dict data-type only"
|
|
213
|
-
return response["text"]
|
|
214
|
-
if __name__ == "__main__":
|
|
215
|
-
from rich import print
|
|
216
|
-
ai = ThinkAnyAI()
|
|
217
|
-
response = ai.chat(input(">>> "))
|
|
218
|
-
for chunk in response:
|
|
219
|
-
print(chunk, end="", flush=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|