Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAlpha VantageApifyArXivAWS LambdaShell (bash)Bearly Code InterpreterBing SearchBrave SearchChatGPT PluginsDall-E Image GeneratorDataForSeoDuckDuckGo SearchEden AIEleven Labs Text2SpeechFile SystemGolden QueryGoogle DriveGoogle PlacesGoogle SearchGoogle SerperGradioGraphQLHuggingFace Hub ToolsHuman as a toolIFTTT WebHooksLemon AgentMetaphor SearchNuclia UnderstandingOpenWeatherMapPubMedRequestsSceneXplainSearch ToolsSearchApiSearxNG SearchSerpAPITwilioWikipediaWolfram AlphaYahoo Finance NewsYouTubeZapier Natural Language ActionsAgents and toolkitsMemoryCallbacksChat loadersComponentsToolsMetaphor SearchOn this pageMetaphor SearchMetaphor is a search engine fully designed to be used by LLMs. You can search and then get the contents for any page.This notebook goes over how to use Metaphor search.First, you need to set up the proper API keys and environment variables. Get 1000 free searches/month here.Then enter your API key as an environment variable.import osos.environ["METAPHOR_API_KEY"] = "..."Using their SDK‚ÄãThis is the newer and more supported way to use the Metaphor API - via their SDK# !pip install metaphor-pythonfrom metaphor_python import Metaphorclient = Metaphor(api_key=os.environ["METAPHOR_API_KEY"])from langchain.agents import toolfrom typing import List@tooldef search(query: str):    """Call search engine with a query."""    return client.search(query, use_autoprompt=True, num_results=5)@tooldef get_contents(ids: List[str]):    """Get contents of a webpage.        The ids passed in should be a list of ids as fetched from `search`.    """    return client.get_contents(ids)@tooldef find_similar(url: str):    """Get search results similar to a given URL.        The url passed in
Metaphor is a search engine fully designed to be used by LLMs. You can search and then get the contents for any page.
Metaphor is a search engine fully designed to be used by LLMs. You can search and then get the contents for any page. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAlpha VantageApifyArXivAWS LambdaShell (bash)Bearly Code InterpreterBing SearchBrave SearchChatGPT PluginsDall-E Image GeneratorDataForSeoDuckDuckGo SearchEden AIEleven Labs Text2SpeechFile SystemGolden QueryGoogle DriveGoogle PlacesGoogle SearchGoogle SerperGradioGraphQLHuggingFace Hub ToolsHuman as a toolIFTTT WebHooksLemon AgentMetaphor SearchNuclia UnderstandingOpenWeatherMapPubMedRequestsSceneXplainSearch ToolsSearchApiSearxNG SearchSerpAPITwilioWikipediaWolfram AlphaYahoo Finance NewsYouTubeZapier Natural Language ActionsAgents and toolkitsMemoryCallbacksChat loadersComponentsToolsMetaphor SearchOn this pageMetaphor SearchMetaphor is a search engine fully designed to be used by LLMs. You can search and then get the contents for any page.This notebook goes over how to use Metaphor search.First, you need to set up the proper API keys and environment variables. Get 1000 free searches/month here.Then enter your API key as an environment variable.import osos.environ["METAPHOR_API_KEY"] = "..."Using their SDK‚ÄãThis is the newer and more supported way to use the Metaphor API - via their SDK# !pip install metaphor-pythonfrom metaphor_python import Metaphorclient = Metaphor(api_key=os.environ["METAPHOR_API_KEY"])from langchain.agents import toolfrom typing import List@tooldef search(query: str):    """Call search engine with a query."""    return client.search(query, use_autoprompt=True, num_results=5)@tooldef get_contents(ids: List[str]):    """Get contents of a webpage.        The ids passed in should be a list of ids as fetched from `search`.    """    return client.get_contents(ids)@tooldef find_similar(url: str):    """Get search results similar to a given URL.        The url passed in