Coverage for fastagency/runtimes/ag2/agents/websurfer.py: 100%
5 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-19 12:16 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-19 12:16 +0000
1from typing import Any, Optional, Union 1bacde
3from autogen import AssistantAgent, ConversableAgent, LLMConfig 1bacde
5from ..tools import WebSurferTool 1bacde
8class WebSurferAgent(AssistantAgent): # type: ignore[misc] 1bacde
9 def __init__( 1bacde
10 self,
11 *args: Any,
12 name: str,
13 llm_config: LLMConfig,
14 summarizer_llm_config: LLMConfig,
15 executor: Union[ConversableAgent, list[ConversableAgent]],
16 system_message: str = "You are a web surfer",
17 bing_api_key: Optional[str] = None,
18 **kwargs: Any,
19 ):
20 """Initialize the WebSurferAgent.
22 Args:
23 *args (Any): The positional arguments.
24 name (str): The name of the agent.
25 llm_config (dict[str, Any]): The LLM configuration.
26 summarizer_llm_config (dict[str, Any]): The summarizer LLM configuration.
27 executor (Union[ConversableAgent, list[ConversableAgent]]): The executor agent(s).
28 system_message (str): The system message.
29 bing_api_key (Optional[str]): The Bing API key
30 **kwargs (Any): The keyword arguments.
31 """
32 super().__init__( 1a
33 *args,
34 name=name,
35 system_message=system_message,
36 llm_config=llm_config,
37 **kwargs,
38 )
39 self.web_surfer_tool = WebSurferTool( 1a
40 name_prefix="Web_Surfer",
41 llm_config=llm_config,
42 summarizer_llm_config=summarizer_llm_config,
43 bing_api_key=bing_api_key,
44 )
45 self.web_surfer_tool.register(caller=self, executor=executor) 1a