@property
def _invocation_params(self) -> Mapping[str, Any]:
"""Get the parameters used to invoke the model."""
pplx_creds: Dict[str, Any] = {
"api_key": self.pplx_api_key,
"api_base": "https://api.perplexity.ai",
"model": self.model,
"max_tokens": self.max_tokens,
}
return {**pplx_creds, **self._default_params}
System Info
System Information
OS: Darwin
OS Version: Darwin Kernel Version 24.1.0: Thu Oct 10 22:08:48 PDT 2024; root:xnu-11215.41.3~5/RELEASE_ARM64_T6000
Python Version: 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)]
aiohttp: 3.9.3
anthropic: 0.39.0
anthropic[vertexai]: Installed. No version info available.
async-timeout: 4.0.3
dataclasses-json: 0.6.7
defusedxml: 0.7.1
faker: Installed. No version info available.
google-cloud-aiplatform: 1.51.0
google-cloud-storage: 2.16.0
google-generativeai: 0.8.3
httpx: 0.27.2
jinja2: 3.1.2
jsonpatch: 1.33
numpy: 1.23.1
openai: 1.10.0
orjson: 3.10.2
packaging: 23.2
pandas: 2.2.0
pillow: 10.1.0
presidio-analyzer: Installed. No version info available.
presidio-anonymizer: Installed. No version info available.
pydantic: 2.9.2
pymongo: 4.8.0
PyYAML: 6.0.1
requests: 2.31.0
sentence-transformers: Installed. No version info available.
SQLAlchemy: 2.0.25
tabulate: 0.9.0
tenacity: 8.2.3
tiktoken: 0.5.2
typing-extensions: 4.9.0
vowpal-wabbit-next: Installed. No version info available.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
Perplexity Docs Example :
Langchain’s Current Implementation :
https://github.com/langchain-ai/langchain/blob/16918842bf86de1b493229310b0f6fc593d7a686/libs/community/langchain_community/chat_models/perplexity.py#L147-L156
https://github.com/langchain-ai/langchain/blob/16918842bf86de1b493229310b0f6fc593d7a686/libs/community/langchain_community/chat_models/perplexity.py#L267-L275
Suggestion :
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies