"""Validate that api key and python package exists in environment."""
        aviary_url = get_from_dict_or_env(values, "aviary_url", "AVIARY_URL")
        if not aviary_url.endswith("/"):
            aviary_url += "/"
        values["aviary_url"] = aviary_url
        aviary_token = get_from_dict_or_env(
            values, "aviary_token", "AVIARY_TOKEN", default=""
        )
        values["aviary_token"] = aviary_token
        aviary_endpoint = aviary_url + "models"
        headers = {"Authorization": f"Bearer {aviary_token}"} if aviary_token else {}
        try:
            response = requests.get(aviary_endpoint, headers=headers)
            result = response.json()
            # Confirm model is available
            if values["model"] not in result:
                raise ValueError(
                    f"{aviary_url} does not support model {values['model']}."
                )
        except requests.exceptions.RequestException as e:
            raise ValueError(e)
        return values
    @property
    def _identifying_params(self) -> Mapping[str, Any]:
        """Get the identifying parameters."""
        return {
            "aviary_url": self.aviary_url,
            "aviary_token": self.aviary_token,
        }
    @property
    def _llm_type(self) -> str:
        """Return type of llm."""
        return "aviary"
    @property
    def headers(self) -> Dict[str, str]:
        if self.aviary_token:
            return {"Authorization": f"Bearer {self.aviary_token}"}
        else:
            return {}
    def _call(
        self,
        prompt: str,
        stop: Optional[List[str]] = None,
rtdocs_stable/api.python.langchain.com/en/stable/_modules/langchain/llms/aviary.html