Skip to content

Commit cc4f526

Browse files
w3bdesignmdrxy
andauthored
docs: replace deprecated llama 3 model with sonar in ChatPerplexity example (#31716)
**Description:** Updates ChatPerplexity documentation to replace deprecated llama 3 model reference with the current sonar model in the API key example code block. **Issue:** N/A (maintenance update for deprecated model) **Dependencies:** No new dependencies required --------- Co-authored-by: Mason Daugherty <[email protected]>
1 parent 8878a7b commit cc4f526

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

docs/docs/integrations/chat/perplexity.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@
106106
"metadata": {},
107107
"outputs": [],
108108
"source": [
109-
"chat = ChatPerplexity(\n",
110-
" temperature=0, pplx_api_key=\"YOUR_API_KEY\", model=\"llama-3-sonar-small-32k-online\"\n",
111-
")"
109+
"chat = ChatPerplexity(temperature=0, pplx_api_key=\"YOUR_API_KEY\", model=\"sonar\")"
112110
]
113111
},
114112
{
@@ -132,7 +130,7 @@
132130
},
133131
"outputs": [],
134132
"source": [
135-
"chat = ChatPerplexity(temperature=0, model=\"llama-3.1-sonar-small-128k-online\")"
133+
"chat = ChatPerplexity(temperature=0, model=\"sonar\")"
136134
]
137135
},
138136
{
@@ -200,7 +198,7 @@
200198
}
201199
],
202200
"source": [
203-
"chat = ChatPerplexity(temperature=0, model=\"llama-3.1-sonar-small-128k-online\")\n",
201+
"chat = ChatPerplexity(temperature=0, model=\"sonar\")\n",
204202
"prompt = ChatPromptTemplate.from_messages([(\"human\", \"Tell me a joke about {topic}\")])\n",
205203
"chain = prompt | chat\n",
206204
"response = chain.invoke({\"topic\": \"cats\"})\n",
@@ -235,7 +233,7 @@
235233
}
236234
],
237235
"source": [
238-
"chat = ChatPerplexity(temperature=0.7, model=\"llama-3.1-sonar-small-128k-online\")\n",
236+
"chat = ChatPerplexity(temperature=0.7, model=\"sonar\")\n",
239237
"response = chat.invoke(\n",
240238
" \"Tell me a joke about cats\", extra_body={\"search_recency_filter\": \"week\"}\n",
241239
")\n",
@@ -284,7 +282,7 @@
284282
}
285283
],
286284
"source": [
287-
"chat = ChatPerplexity(temperature=0.7, model=\"llama-3.1-sonar-small-128k-online\")\n",
285+
"chat = ChatPerplexity(temperature=0.7, model=\"sonar\")\n",
288286
"\n",
289287
"for chunk in chat.stream(\"Give me a list of famous tourist attractions in Pakistan\"):\n",
290288
" print(chunk.content, end=\"\", flush=True)"

0 commit comments

Comments
 (0)