Skip to content

ExaConfig

Base classes

Name Children Inherits
BaseSearchProviderConfig
searchly_config.configs
Base search provider configuration.

⋔ Inheritance diagram

graph TD
  2436420511["configs.ExaConfig"]
  860522681["configs.BaseSearchProviderConfig"]
  330168112["schema.Schema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  860522681 --> 2436420511
  330168112 --> 860522681
  3879467795 --> 330168112
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseSearchProviderConfig

Exa provider configuration.

Uses the Exa API for neural/semantic web search. Supports domain filtering and date ranges but not country/language.

Source code in src/searchly_config/configs.py
class ExaConfig(BaseSearchProviderConfig):
    """Exa provider configuration.

    Uses the Exa API for neural/semantic web search.
    Supports domain filtering and date ranges but not country/language.
    """

    type: Literal["exa"] = Field("exa", init=False)
    """Exa provider."""

    api_key: SecretStr | None = Field(default=None, title="API Key")
    """Exa API key. Defaults to EXA_API_KEY env var."""

    def is_configured(self) -> bool:
        """Check if Exa credentials are configured."""
        return self.api_key is not None or bool(os.getenv("EXA_API_KEY"))

    def get_provider(self) -> AsyncExaClient:
        """Create Exa provider instance."""
        from searchly.providers.exa_provider.exa import AsyncExaClient

        api_key = self.api_key.get_secret_value() if self.api_key else None
        return AsyncExaClient(api_key=api_key)

api_key class-attribute instance-attribute

api_key: SecretStr | None = Field(default=None, title='API Key')

Exa API key. Defaults to EXA_API_KEY env var.

type class-attribute instance-attribute

type: Literal['exa'] = Field('exa', init=False)

Exa provider.

get_provider

get_provider() -> AsyncExaClient

Create Exa provider instance.

Source code in src/searchly_config/configs.py
def get_provider(self) -> AsyncExaClient:
    """Create Exa provider instance."""
    from searchly.providers.exa_provider.exa import AsyncExaClient

    api_key = self.api_key.get_secret_value() if self.api_key else None
    return AsyncExaClient(api_key=api_key)

is_configured

is_configured() -> bool

Check if Exa credentials are configured.

Source code in src/searchly_config/configs.py
def is_configured(self) -> bool:
    """Check if Exa credentials are configured."""
    return self.api_key is not None or bool(os.getenv("EXA_API_KEY"))

:fa-brands-github: Show source on GitHub