Refactor and remove obsolete providers; update TypliAI and TurboSeek …#107
Refactor and remove obsolete providers; update TypliAI and TurboSeek …#107
Conversation
…implementations - Deleted PerplexityLabs and TeachAnything providers due to redundancy or deprecation. - Updated TypliAI to support new model identifiers and improved user agent handling. - Enhanced TurboSeek to convert HTML responses to Markdown and improved error handling. - Adjusted streaming and non-streaming response handling in TurboSeek for better consistency. - Cleaned up imports and removed unused code across affected files. Signed-off-by: OEvortex <[email protected]>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
There was a problem hiding this comment.
Pull request overview
This pull request refactors provider implementations by removing two obsolete providers (PerplexityLabs and TeachAnything), updating TypliAI with new model support and dual implementation formats, and enhancing TurboSeek's HTML response handling with Markdown conversion.
- Removes PerplexityLabs and TeachAnything providers that are redundant or deprecated
- Adds OpenAI-compatible TypliAI implementation alongside the existing standard implementation
- Updates TurboSeek to convert HTML responses to Markdown format
- Updates model identifiers and API payload structures for TypliAI
- Adjusts provider documentation and statistics to reflect the changes
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| webscout/Provider/turboseek.py | Enhanced with HTML-to-Markdown conversion method and updated streaming/non-streaming response handling |
| webscout/Provider/TypliAI.py | Updated with new model identifiers, revised headers, and modified payload structure for API compatibility |
| webscout/Provider/OPENAI/typliai.py | New OpenAI-compatible implementation with streaming and non-streaming support |
| webscout/Provider/TeachAnything.py | Deleted - provider removed as obsolete |
| webscout/Provider/Perplexitylabs.py | Deleted - provider removed as deprecated |
| webscout/Provider/init.py | Removed imports for deleted providers |
| webscout/Provider/OPENAI/init.py | Added import for new TypliAI OpenAI-compatible provider |
| Provider.md | Updated provider counts and statistics (33 dual, 21 normal-only, 60 total) |
| changelog.md | Added changelog entry for version 2025.12.18 |
| docs/gguf.md | Added auto-generated developer documentation summary |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| text = re.sub(r'<(strong|b)[^>]*>(.*?)</\1>', r'**\2**', text) | ||
| text = re.sub(r'<(em|i)[^>]*>(.*?)</\1>', r'*\2*', text) |
There was a problem hiding this comment.
The regex pattern uses \1 as a backreference, but \1 refers to the first captured group (strong|b). Since these are alternatives (strong OR b), the backreference may not match the closing tag correctly in all cases. For example, if the opening tag is <strong>, the pattern expects </strong>, but with this regex structure it should work. However, this pattern assumes well-formed HTML. Consider using separate patterns for each tag type or adding a comment explaining this assumes well-formed HTML.
| to_json=True, | ||
| intro_value=None, | ||
| to_json=False, | ||
| strip_chars='', # Disable default lstrip to preserve spacing |
There was a problem hiding this comment.
The parameter strip_chars='' disables the default lstrip behavior. This could preserve unwanted whitespace at the beginning of chunks, which may lead to formatting issues. Ensure this is the intended behavior, or document why this is necessary.
| self.headers = { | ||
| 'accept': '*/*', # Changed from '/' in example, but '*' is safer | ||
| 'accept-language': 'en-US,en;q=0.9', | ||
| 'accept': '/', |
There was a problem hiding this comment.
The 'accept' header value is changed from '/' to '/' which is not a valid HTTP accept header value. The correct wildcard value should be '/'. This typo could cause the API to reject requests or behave unexpectedly.
| 'accept': '/', | |
| 'accept': '*/*', |
| # Iterate over the stream in raw mode to get full HTML | ||
| # We use ask(..., raw=True) internally or just the local for_stream | ||
| # Actually, let's just make a sub-call | ||
| response = self.session.post( | ||
| self.chat_endpoint, | ||
| json=payload, | ||
| timeout=self.timeout, | ||
| impersonate="chrome120" | ||
| ) |
There was a problem hiding this comment.
The non-streaming mode makes a second HTTP request (lines 221-226) instead of reusing the streaming response. This duplicates the network call and could lead to inconsistent responses between streaming and non-streaming modes. Consider aggregating the streaming response instead of making a separate request.
| @property | ||
| def models(self): | ||
| class _ModelList: | ||
| def list(inner_self): |
There was a problem hiding this comment.
Normal methods should have 'self', rather than 'inner_self', as their first parameter.
| def list(inner_self): | |
| def list(self): |
| TypliAI OpenAI-compatible provider. | ||
| """ | ||
|
|
||
| import json |
There was a problem hiding this comment.
Import of 'json' is not used.
| import json |
| self.completions = Completions(client) | ||
|
|
||
|
|
||
| class TypliAI(OpenAICompatibleProvider): |
There was a problem hiding this comment.
This class does not call OpenAICompatibleProvider.init during initialization. (TypliAI.init may be missing a call to a base class init)
User description
…implementations
This pull request introduces a new OpenAI-compatible TypliAI provider, removes the PerplexityLabs and TeachAnything providers, updates provider documentation and statistics, and improves the TurboSeek provider's response handling. Additionally, it adds an auto-generated developer documentation summary for
webscout/Extra/gguf.py.Provider changes:
Documentation and statistics updates:
Provider.mdto reflect the addition and removal of providers, adjusting provider counts and statistics accordingly. [1] [2] [3]webscout/Extra/gguf.pyindocs/gguf.md.Bug fixes and improvements:
CodeAnt-AI Description
Add OpenAI-compatible TypliAI provider; remove PerplexityLabs and TeachAnything; convert TurboSeek HTML streams to Markdown
What Changed
Impact
✅ New OpenAI-compatible TypliAI for GPT-4/5/Gemini/Claude/Grok✅ Fewer deprecated providers listed✅ TurboSeek delivers readable Markdown for full responses💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.