XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix screenshot URL in BraveSearch provider and update screenshot capture logic in API

334a0e9b
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

3 个文件 +3 -3
Modified g4f/Provider/BraveSearch.py +1 -1
@@ -64,7 +64,7 @@ class BraveSearch(AsyncGeneratorProvider, ProviderModelMixin):
64 64
65 65 label = "Brave Search"
66 66 url = BRAVE_ASK_URL
67 screenshot_url = f"{BRAVE_ASK_URL}/?q=Hello"
67 screenshot_url = f"{BRAVE_URL}?q=Hello"
68 68 working = True
69 69 needs_auth = False
70 70 supports_stream = True
Modified g4f/Provider/__init__.py +1 -1
@@ -27,7 +27,6 @@ class ProviderLoader:
27 27 "CopilotAccount",
28 28 "CopilotApp",
29 29 "CopilotSession",
30 "Custom",
31 30 "DeepInfra",
32 31 "DeepSeek",
33 32 "EdgeTTS",
@@ -514,6 +513,7 @@ __all__ = [
514 513 "CreateImagesProvider",
515 514 "ProviderUtils",
516 515 "G4FSpace",
516 "Custom",
517 517 "__providers__",
518 518 "__map__",
519 519 ] + ProviderLoader.names
Modified g4f/api/__init__.py +1 -1
@@ -1408,7 +1408,7 @@ class Api:
1408 1408 session = CDPSession(headless="headless=false" not in url)
1409 1409 await session.start()
1410 1410 try:
1411 screenshot_path = await session.capture_screenshot(url, 1 if "q=" in url else 3)
1411 screenshot_path = await session.capture_screenshot(url, 1 if "q=" in url and "q=Hello" not in url else 3)
1412 1412 return FileResponse(
1413 1413 screenshot_path,
1414 1414 media_type="image/webp",