Skip to content

JigsawStackConfig

Base classes

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

⋔ Inheritance diagram

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

🛈 DocStrings

Bases: BaseSearchProviderConfig

JigsawStack provider configuration.

Uses the JigsawStack API for web search with AI overview. Limited filtering options.

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

    Uses the JigsawStack API for web search with AI overview.
    Limited filtering options.
    """

    type: Literal["jigsawstack"] = Field("jigsawstack", init=False)
    """JigsawStack provider."""

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

    base_url: str = Field(default="https://api.jigsawstack.com/v1", title="Base URL")
    """Base URL for the API."""

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

    def get_provider(self) -> AsyncJigsawStackClient:
        """Create JigsawStack provider instance."""
        from searchly.providers.jigsawstack_provider.jigsawstack import AsyncJigsawStackClient

        api_key = self.api_key.get_secret_value() if self.api_key else None
        return AsyncJigsawStackClient(api_key=api_key, base_url=self.base_url)

api_key class-attribute instance-attribute

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

JigsawStack API key. Defaults to JIGSAWSTACK_API_KEY env var.

base_url class-attribute instance-attribute

base_url: str = Field(default='https://api.jigsawstack.com/v1', title='Base URL')

Base URL for the API.

type class-attribute instance-attribute

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

JigsawStack provider.

get_provider

get_provider() -> AsyncJigsawStackClient

Create JigsawStack provider instance.

Source code in src/searchly_config/configs.py
def get_provider(self) -> AsyncJigsawStackClient:
    """Create JigsawStack provider instance."""
    from searchly.providers.jigsawstack_provider.jigsawstack import AsyncJigsawStackClient

    api_key = self.api_key.get_secret_value() if self.api_key else None
    return AsyncJigsawStackClient(api_key=api_key, base_url=self.base_url)

is_configured

is_configured() -> bool

Check if JigsawStack credentials are configured.

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

:fa-brands-github: Show source on GitHub