Integrate SearchHive with Microsoft AutoGen for conversational AI agents with web access.
import autogen
from searchhive_autogen import create_search_function
search_func = create_search_function({
"api_key": os.environ["SEARCHHIVE_API_KEY"]
})
assistant = autogen.AssistantAgent(
name="research_assistant",
llm_config={
"functions": [search_func],
"config_list": [{"model": "gpt-4"}]
}
)
user_proxy = autogen.UserProxyAgent(
name="user",
human_input_mode="NEVER"
)
user_proxy.initiate_chat(
assistant,
message="Research the latest AI trends"
)