mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 15:43:54 +00:00
docs: updated PPLX model (#23723)
Description: updated pplx docs to reference a currently [supported model](https://docs.perplexity.ai/docs/model-cards). pplx-70b-online ->llama-3-sonar-small-32k-online --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
parent
aa165539f6
commit
cc55823486
@ -45,7 +45,7 @@
|
||||
"The code provided assumes that your PPLX_API_KEY is set in your environment variables. If you would like to manually specify your API key and also choose a different model, you can use the following code:\n",
|
||||
"\n",
|
||||
"```python\n",
|
||||
"chat = ChatPerplexity(temperature=0, pplx_api_key=\"YOUR_API_KEY\", model=\"pplx-70b-online\")\n",
|
||||
"chat = ChatPerplexity(temperature=0, pplx_api_key=\"YOUR_API_KEY\", model=\"llama-3-sonar-small-32k-online\")\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"You can check a list of available models [here](https://docs.perplexity.ai/docs/model-cards). For reproducibility, we can set the API key dynamically by taking it as an input in this notebook."
|
||||
@ -78,7 +78,7 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"chat = ChatPerplexity(temperature=0, model=\"pplx-70b-online\")"
|
||||
"chat = ChatPerplexity(temperature=0, model=\"llama-3-sonar-small-32k-online\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -146,7 +146,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"chat = ChatPerplexity(temperature=0, model=\"pplx-70b-online\")\n",
|
||||
"chat = ChatPerplexity(temperature=0, model=\"llama-3-sonar-small-32k-online\")\n",
|
||||
"prompt = ChatPromptTemplate.from_messages([(\"human\", \"Tell me a joke about {topic}\")])\n",
|
||||
"chain = prompt | chat\n",
|
||||
"response = chain.invoke({\"topic\": \"cats\"})\n",
|
||||
@ -195,7 +195,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"chat = ChatPerplexity(temperature=0.7, model=\"pplx-70b-online\")\n",
|
||||
"chat = ChatPerplexity(temperature=0.7, model=\"llama-3-sonar-small-32k-online\")\n",
|
||||
"prompt = ChatPromptTemplate.from_messages(\n",
|
||||
" [(\"human\", \"Give me a list of famous tourist attractions in Pakistan\")]\n",
|
||||
")\n",
|
||||
|
@ -54,11 +54,14 @@ class ChatPerplexity(BaseChatModel):
|
||||
|
||||
from langchain_community.chat_models import ChatPerplexity
|
||||
|
||||
chat = ChatPerplexity(model="pplx-70b-online", temperature=0.7)
|
||||
chat = ChatPerplexity(
|
||||
model="llama-3-sonar-small-32k-online",
|
||||
temperature=0.7,
|
||||
)
|
||||
"""
|
||||
|
||||
client: Any #: :meta private:
|
||||
model: str = "pplx-70b-online"
|
||||
model: str = "llama-3-sonar-small-32k-online"
|
||||
"""Model name."""
|
||||
temperature: float = 0.7
|
||||
"""What sampling temperature to use."""
|
||||
|
Loading…
Reference in New Issue
Block a user