feat: add web search block functionality and integrate with existing plugins
- Introduced a new web search block plugin to handle web search queries and results. - Updated copilot, doc block, and pro block plugins to include web search context in AI completions. - Implemented utility functions for parsing and building web search markdown. - Enhanced API to support web search requests and responses. - Added configuration for web search URL and timeout settings. - Updated size limit checks to account for web search content.
This commit is contained in:
@@ -178,7 +178,10 @@ class RedisRiskBackend(BaseRiskBackend):
|
||||
value = await self.redis.get(key)
|
||||
if value is None:
|
||||
return 0
|
||||
return int(value)
|
||||
try:
|
||||
return int(value)
|
||||
except (TypeError, ValueError):
|
||||
return int(float(value))
|
||||
|
||||
async def set_int(self, key: str, value: int, ttl_seconds: int) -> None:
|
||||
await self.redis.set(key, value, ex=ttl_seconds)
|
||||
|
||||
Reference in New Issue
Block a user