MerriamWebsterAPIWrapper#

class langchain_community.utilities.merriam_webster.MerriamWebsterAPIWrapper[source]#

Bases: BaseModel

Wrapper for Merriam-Webster.

Docs for using:

  1. Go to https://www.dictionaryapi.com/register/index and register an developer account with a key for the Collegiate Dictionary

  2. Get your API Key from https://www.dictionaryapi.com/account/my-keys

  3. Save your API Key into MERRIAM_WEBSTER_API_KEY env variable

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param merriam_webster_api_key: str | None = None#
run(query: str) str[source]#

Run query through Merriam-Webster API and return a formatted result.

Parameters:

query (str)

Return type:

str