MCPcopy
hub / github.com/AstrBotDevs/AstrBot / get

Method get

astrbot/core/tools/web_search_tools.py:68–80  ·  view source on GitHub ↗
(self, provider_settings: dict)

Source from the content-addressed store, hash-verified

66 lock: asyncio.Lock = field(default_factory=asyncio.Lock)
67
68 async def get(self, provider_settings: dict) -> str:
69 keys = provider_settings.get(self.setting_name, [])
70 if not keys:
71 raise ValueError(
72 f"Error: {self.provider_name} API key is not configured in AstrBot."
73 )
74
75 async with self.lock:
76 if self.index >= len(keys):
77 self.index = 0
78 key = keys[self.index]
79 self.index = (self.index + 1) % len(keys)
80 return key
81
82
83_TAVILY_KEY_ROTATOR = _KeyRotator("websearch_tavily_key", "Tavily")

Callers 15

filterMethod · 0.45
_get_short_level_nameFunction · 0.45
_setup_loguruMethod · 0.45
_add_file_sinkMethod · 0.45
configure_loggerMethod · 0.45
_apply_prompt_prefixFunction · 0.45
_request_img_captionFunction · 0.45
_get_image_compress_argsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected