webscout 7.6__py3-none-any.whl → 7.7__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.

Files changed (36) hide show
  1. webscout/Extra/autocoder/__init__.py +9 -9
  2. webscout/Extra/autocoder/autocoder_utiles.py +193 -195
  3. webscout/Extra/autocoder/rawdog.py +789 -649
  4. webscout/Extra/gguf.py +54 -24
  5. webscout/Provider/AISEARCH/ISou.py +0 -21
  6. webscout/Provider/AllenAI.py +4 -21
  7. webscout/Provider/ChatGPTClone.py +226 -0
  8. webscout/Provider/Glider.py +8 -4
  9. webscout/Provider/Hunyuan.py +272 -0
  10. webscout/Provider/LambdaChat.py +391 -0
  11. webscout/Provider/OLLAMA.py +256 -32
  12. webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +18 -45
  13. webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +34 -46
  14. webscout/Provider/TTI/artbit/async_artbit.py +3 -32
  15. webscout/Provider/TTI/artbit/sync_artbit.py +3 -31
  16. webscout/Provider/TTI/fastflux/async_fastflux.py +6 -2
  17. webscout/Provider/TTI/fastflux/sync_fastflux.py +7 -2
  18. webscout/Provider/TTI/piclumen/__init__.py +22 -22
  19. webscout/Provider/TTI/piclumen/sync_piclumen.py +232 -232
  20. webscout/Provider/WebSim.py +227 -0
  21. webscout/Provider/__init__.py +12 -1
  22. webscout/Provider/flowith.py +13 -2
  23. webscout/Provider/labyrinth.py +239 -0
  24. webscout/Provider/learnfastai.py +28 -15
  25. webscout/Provider/sonus.py +208 -0
  26. webscout/Provider/typegpt.py +1 -1
  27. webscout/Provider/uncovr.py +297 -0
  28. webscout/cli.py +49 -0
  29. webscout/litagent/agent.py +14 -9
  30. webscout/version.py +1 -1
  31. {webscout-7.6.dist-info → webscout-7.7.dist-info}/METADATA +33 -22
  32. {webscout-7.6.dist-info → webscout-7.7.dist-info}/RECORD +36 -29
  33. {webscout-7.6.dist-info → webscout-7.7.dist-info}/LICENSE.md +0 -0
  34. {webscout-7.6.dist-info → webscout-7.7.dist-info}/WHEEL +0 -0
  35. {webscout-7.6.dist-info → webscout-7.7.dist-info}/entry_points.txt +0 -0
  36. {webscout-7.6.dist-info → webscout-7.7.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
- """
2
- AutoCoder Module - Part of Webscout
3
- Provides automated code generation and manipulation capabilities.
4
- """
5
-
6
- from .rawdog import *
7
- from .autocoder_utiles import *
8
-
9
- # __all__ = [] # Add your public module names here
1
+ """
2
+ AutoCoder Module - Part of Webscout
3
+ Provides automated code generation and manipulation capabilities.
4
+ """
5
+
6
+ from .rawdog import *
7
+ from .autocoder_utiles import *
8
+
9
+ # __all__ = [] # Add your public module names here
@@ -1,196 +1,194 @@
1
- """AutoCoder utilities module."""
2
-
3
- import os
4
- import platform
5
- import datetime
6
- import sys
7
- import os
8
- import platform
9
- import subprocess
10
-
11
- def get_current_app() -> str:
12
- """
13
- Get the current active application or window title in a cross-platform manner.
14
-
15
- On Windows, uses the win32gui module from pywin32.
16
- On macOS, uses AppKit to access the active application info.
17
- On Linux, uses xprop to get the active window details.
18
-
19
- Returns:
20
- A string containing the title of the active application/window, or "Unknown" if it cannot be determined.
21
- """
22
- system_name = platform.system()
23
-
24
- if system_name == "Windows":
25
- try:
26
- import win32gui # pywin32 must be installed
27
- window_handle = win32gui.GetForegroundWindow()
28
- title = win32gui.GetWindowText(window_handle)
29
- return title if title else "Unknown"
30
- except Exception:
31
- return "Unknown"
32
-
33
- elif system_name == "Darwin": # macOS
34
- try:
35
- from AppKit import NSWorkspace # type: ignore
36
- active_app = NSWorkspace.sharedWorkspace().activeApplication()
37
- title = active_app.get('NSApplicationName')
38
- return title if title else "Unknown"
39
- except Exception:
40
- return "Unknown"
41
-
42
- elif system_name == "Linux":
43
- try:
44
- # Get the active window id using xprop
45
- result = subprocess.run(
46
- ["xprop", "-root", "_NET_ACTIVE_WINDOW"],
47
- stdout=subprocess.PIPE,
48
- stderr=subprocess.PIPE,
49
- text=True
50
- )
51
- if result.returncode == 0 and result.stdout:
52
- # Expected format: _NET_ACTIVE_WINDOW(WINDOW): window id # 0x1400007
53
- parts = result.stdout.strip().split()
54
- window_id = parts[-1]
55
- if window_id != "0x0":
56
- title_result = subprocess.run(
57
- ["xprop", "-id", window_id, "WM_NAME"],
58
- stdout=subprocess.PIPE,
59
- stderr=subprocess.PIPE,
60
- text=True
61
- )
62
- if title_result.returncode == 0 and title_result.stdout:
63
- # Expected format: WM_NAME(STRING) = "Terminal"
64
- title_parts = title_result.stdout.split(" = ", 1)
65
- if len(title_parts) == 2:
66
- title = title_parts[1].strip().strip('"')
67
- return title if title else "Unknown"
68
- except Exception:
69
- pass
70
- return "Unknown"
71
- else:
72
- return "Unknown"
73
-
74
-
75
- def get_intro_prompt(name: str = "Vortex") -> str:
76
- """Get the introduction prompt for the AutoCoder."""
77
- current_app: str = get_current_app()
78
- python_version: str = sys.version.split()[0]
79
-
80
- return f"""
81
- <system_context>
82
- <purpose>
83
- You are a command-line coding assistant named Rawdog, designed to generate and auto-execute Python scripts for {name}.
84
- Your core function is to understand natural language requests, transform them into executable Python code,
85
- and return results to the user via console output. You must adhere to all instructions.
86
- </purpose>
87
-
88
- <process_description>
89
- A typical interaction unfolds as follows:
90
- 1. The user provides a natural language PROMPT.
91
- 2. You:
92
- i. Analyze the PROMPT to determine required actions.
93
- ii. Craft a short Python SCRIPT to execute those actions.
94
- iii. Provide clear and concise feedback to the user by printing to the console within your SCRIPT.
95
- 3. The compiler will then:
96
- i. Extract and execute the SCRIPT using exec().
97
- ii. Handle any exceptions that arise during script execution. Exceptions are returned to you starting with "PREVIOUS SCRIPT EXCEPTION:".
98
- 4. In cases of exceptions, ensure that you regenerate the script and return one that has no errors.
99
-
100
- <continue_process>
101
- If you need to review script outputs before task completion, include the word "CONTINUE" at the end of your SCRIPT.
102
- This allows multi-step reasoning for tasks like summarizing documents, reviewing instructions, or performing other multi-part operations.
103
- A typical 'CONTINUE' interaction looks like this:
104
- 1. The user gives you a natural language PROMPT.
105
- 2. You:
106
- i. Determine what needs to be done.
107
- ii. Determine that you need to see the output of some subprocess call to complete the task
108
- iii. Write a short Python SCRIPT to print that and then print the word "CONTINUE"
109
- 3. The compiler will:
110
- i. Check and run your SCRIPT.
111
- ii. Capture the output and append it to the conversation as "LAST SCRIPT OUTPUT:".
112
- iii. Find the word "CONTINUE" and return control back to you.
113
- 4. You will then:
114
- i. Review the original PROMPT + the "LAST SCRIPT OUTPUT:" to determine what to do
115
- ii. Write a short Python SCRIPT to complete the task.
116
- iii. Communicate back to the user by printing to the console in that SCRIPT.
117
- 5. The compiler repeats the above process...
118
- </continue_process>
119
-
120
- </process_description>
121
-
122
- <conventions>
123
- - Decline any tasks that seem dangerous, irreversible, or that you don't understand.
124
- - Always review the full conversation prior to answering and maintain continuity.
125
- - If asked for information, just print the information clearly and concisely.
126
- - If asked to do something, print a concise summary of what you've done as confirmation.
127
- - If asked a question, respond in a friendly, conversational way. Use programmatically-generated and natural language responses as appropriate.
128
- - If you need clarification, return a SCRIPT that prints your question. In the next interaction, continue based on the user's response.
129
- - Assume the user would like something concise. For example rather than printing a massive table, filter or summarize it to what's likely of interest.
130
- - Actively clean up any temporary processes or files you use.
131
- - When looking through files, use git as available to skip files, and skip hidden files (.env, .git, etc) by default.
132
- - You can plot anything with matplotlib.
133
- - **IMPORTANT**: ALWAYS Return your SCRIPT inside of a single pair of \`\`\` delimiters. Only the console output of the first such SCRIPT is visible to the user, so make sure that it's complete and don't bother returning anything else.
134
- </conventions>
135
-
136
- <environment_info>
137
- - System: {platform.system()}
138
- - Python: {python_version}
139
- - Directory: {os.getcwd()}
140
- - Datetime: {datetime.datetime.now()}
141
- - Active App: {current_app}
142
- </environment_info>
143
- </system_context>
144
- """
145
-
146
- EXAMPLES: str = """
147
- <examples>
148
- <example>
149
- <user_request>Kill the process running on port 3000</user_request>
150
- <rawdog_response>
151
- ```python
152
- import os
153
- os.system("kill $(lsof -t -i:3000)")
154
- print("Process killed")
155
- ```
156
- </rawdog_response>
157
- </example>
158
- <example>
159
- <user_request>Summarize my essay</user_request>
160
- <rawdog_response>
161
- ```python
162
- import glob
163
- files = glob.glob("*essay*.*")
164
- with open(files[0], "r") as f:
165
- print(f.read())
166
- ```
167
- CONTINUE
168
- </rawdog_response>
169
- <user_response>
170
- LAST SCRIPT OUTPUT:
171
- John Smith
172
- Essay 2021-09-01
173
- ...
174
- </user_response>
175
- <rawdog_response>
176
- ```python
177
- print("The essay is about...")
178
- ```
179
- </rawdog_response>
180
- </example>
181
- <example>
182
- <user_request>Weather in qazigund</user_request>
183
- <rawdog_response>
184
- ```python
185
- from webscout import weather as w
186
- weather = w.get("Qazigund")
187
- w.print_weather(weather)
188
- ```
189
- </rawdog_response>
190
- </example>
191
- </examples>
192
- """
193
-
194
- if __name__ == "__main__":
195
- # Simple test harness to print the current active window title.
1
+ """AutoCoder utilities module."""
2
+
3
+ import os
4
+ import platform
5
+ import datetime
6
+ import sys
7
+ import os
8
+ import platform
9
+ import subprocess
10
+
11
+ def get_current_app() -> str:
12
+ """
13
+ Get the current active application or window title in a cross-platform manner.
14
+
15
+ On Windows, uses the win32gui module from pywin32.
16
+ On macOS, uses AppKit to access the active application info.
17
+ On Linux, uses xprop to get the active window details.
18
+
19
+ Returns:
20
+ A string containing the title of the active application/window, or "Unknown" if it cannot be determined.
21
+ """
22
+ system_name = platform.system()
23
+
24
+ if system_name == "Windows":
25
+ try:
26
+ import win32gui # pywin32 must be installed
27
+ window_handle = win32gui.GetForegroundWindow()
28
+ title = win32gui.GetWindowText(window_handle)
29
+ return title if title else "Unknown"
30
+ except Exception:
31
+ return "Unknown"
32
+
33
+ elif system_name == "Darwin": # macOS
34
+ try:
35
+ from AppKit import NSWorkspace # type: ignore
36
+ active_app = NSWorkspace.sharedWorkspace().activeApplication()
37
+ title = active_app.get('NSApplicationName')
38
+ return title if title else "Unknown"
39
+ except Exception:
40
+ return "Unknown"
41
+
42
+ elif system_name == "Linux":
43
+ try:
44
+ # Get the active window id using xprop
45
+ result = subprocess.run(
46
+ ["xprop", "-root", "_NET_ACTIVE_WINDOW"],
47
+ stdout=subprocess.PIPE,
48
+ stderr=subprocess.PIPE,
49
+ text=True
50
+ )
51
+ if result.returncode == 0 and result.stdout:
52
+ # Expected format: _NET_ACTIVE_WINDOW(WINDOW): window id # 0x1400007
53
+ parts = result.stdout.strip().split()
54
+ window_id = parts[-1]
55
+ if window_id != "0x0":
56
+ title_result = subprocess.run(
57
+ ["xprop", "-id", window_id, "WM_NAME"],
58
+ stdout=subprocess.PIPE,
59
+ stderr=subprocess.PIPE,
60
+ text=True
61
+ )
62
+ if title_result.returncode == 0 and title_result.stdout:
63
+ # Expected format: WM_NAME(STRING) = "Terminal"
64
+ title_parts = title_result.stdout.split(" = ", 1)
65
+ if len(title_parts) == 2:
66
+ title = title_parts[1].strip().strip('"')
67
+ return title if title else "Unknown"
68
+ except Exception:
69
+ pass
70
+ return "Unknown"
71
+ else:
72
+ return "Unknown"
73
+
74
+
75
+ def get_intro_prompt(name: str = "Vortex") -> str:
76
+ """Get the introduction prompt for the AutoCoder."""
77
+ current_app: str = get_current_app()
78
+ python_version: str = sys.version.split()[0]
79
+
80
+ return f"""
81
+ <system_context>
82
+ <purpose>
83
+ You are a command-line coding assistant named Rawdog, designed to generate and auto-execute Python scripts for {name}.
84
+ Your core function is to understand natural language requests, transform them into executable Python code,
85
+ and return results to the user via console output. You must adhere to all instructions.
86
+ </purpose>
87
+
88
+ <process_description>
89
+ A typical interaction unfolds as follows:
90
+ 1. The user provides a natural language PROMPT.
91
+ 2. You:
92
+ i. Analyze the PROMPT to determine required actions.
93
+ ii. Craft a short Python SCRIPT to execute those actions.
94
+ iii. Provide clear and concise feedback to the user by printing to the console within your SCRIPT.
95
+ 3. The compiler will then:
96
+ i. Extract and execute the SCRIPT using exec().
97
+ ii. Handle any exceptions that arise during script execution. Exceptions are returned to you starting with "PREVIOUS SCRIPT EXCEPTION:".
98
+ 4. In cases of exceptions, ensure that you regenerate the script and return one that has no errors.
99
+
100
+ <continue_process>
101
+ If you need to review script outputs before task completion, include the word "CONTINUE" at the end of your SCRIPT.
102
+ This allows multi-step reasoning for tasks like summarizing documents, reviewing instructions, or performing other multi-part operations.
103
+ A typical 'CONTINUE' interaction looks like this:
104
+ 1. The user gives you a natural language PROMPT.
105
+ 2. You:
106
+ i. Determine what needs to be done.
107
+ ii. Determine that you need to see the output of some subprocess call to complete the task
108
+ iii. Write a short Python SCRIPT to print that and then print the word "CONTINUE"
109
+ 3. The compiler will:
110
+ i. Check and run your SCRIPT.
111
+ ii. Capture the output and append it to the conversation as "LAST SCRIPT OUTPUT:".
112
+ iii. Find the word "CONTINUE" and return control back to you.
113
+ 4. You will then:
114
+ i. Review the original PROMPT + the "LAST SCRIPT OUTPUT:" to determine what to do
115
+ ii. Write a short Python SCRIPT to complete the task.
116
+ iii. Communicate back to the user by printing to the console in that SCRIPT.
117
+ 5. The compiler repeats the above process...
118
+ </continue_process>
119
+
120
+ </process_description>
121
+
122
+ <conventions>
123
+ - Decline any tasks that seem dangerous, irreversible, or that you don't understand.
124
+ - Always review the full conversation prior to answering and maintain continuity.
125
+ - If asked for information, just print the information clearly and concisely.
126
+ - If asked to do something, print a concise summary of what you've done as confirmation.
127
+ - If asked a question, respond in a friendly, conversational way. Use programmatically-generated and natural language responses as appropriate.
128
+ - If you need clarification, return a SCRIPT that prints your question. In the next interaction, continue based on the user's response.
129
+ - Assume the user would like something concise. For example rather than printing a massive table, filter or summarize it to what's likely of interest.
130
+ - Actively clean up any temporary processes or files you use.
131
+ - When looking through files, use git as available to skip files, and skip hidden files (.env, .git, etc) by default.
132
+ - You can plot anything with matplotlib.
133
+ - **IMPORTANT**: ALWAYS Return your SCRIPT inside of a single pair of \`\`\` delimiters. Only the console output of the first such SCRIPT is visible to the user, so make sure that it's complete and don't bother returning anything else.
134
+ </conventions>
135
+
136
+ <examples>
137
+ <example>
138
+ <user_request>Kill the process running on port 3000</user_request>
139
+ <rawdog_response>
140
+ ```python
141
+ import os
142
+ os.system("kill $(lsof -t -i:3000)")
143
+ print("Process killed")
144
+ ```
145
+ </rawdog_response>
146
+ </example>
147
+ <example>
148
+ <user_request>Summarize my essay</user_request>
149
+ <rawdog_response>
150
+ ```python
151
+ import glob
152
+ files = glob.glob("*essay*.*")
153
+ with open(files[0], "r") as f:
154
+ print(f.read())
155
+ ```
156
+ CONTINUE
157
+ </rawdog_response>
158
+ <user_response>
159
+ LAST SCRIPT OUTPUT:
160
+ John Smith
161
+ Essay 2021-09-01
162
+ ...
163
+ </user_response>
164
+ <rawdog_response>
165
+ ```python
166
+ print("The essay is about...")
167
+ ```
168
+ </rawdog_response>
169
+ </example>
170
+ <example>
171
+ <user_request>Weather in qazigund</user_request>
172
+ <rawdog_response>
173
+ ```python
174
+ from webscout import weather as w
175
+ weather = w.get("Qazigund")
176
+ w.print_weather(weather)
177
+ ```
178
+ </rawdog_response>
179
+ </example>
180
+ </examples>
181
+
182
+ <environment_info>
183
+ - System: {platform.system()}
184
+ - Python: {python_version}
185
+ - Directory: {os.getcwd()}
186
+ - Datetime: {datetime.datetime.now()}
187
+ - Active App: {current_app}
188
+ </environment_info>
189
+ </system_context>
190
+ """
191
+
192
+ if __name__ == "__main__":
193
+ # Simple test harness to print the current active window title.
196
194
  print("Current Active Window/Application: ", get_current_app())