|
106 | 106 | "metadata": {},
|
107 | 107 | "outputs": [],
|
108 | 108 | "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\")" |
112 | 110 | ]
|
113 | 111 | },
|
114 | 112 | {
|
|
132 | 130 | },
|
133 | 131 | "outputs": [],
|
134 | 132 | "source": [
|
135 |
| - "chat = ChatPerplexity(temperature=0, model=\"llama-3.1-sonar-small-128k-online\")" |
| 133 | + "chat = ChatPerplexity(temperature=0, model=\"sonar\")" |
136 | 134 | ]
|
137 | 135 | },
|
138 | 136 | {
|
|
200 | 198 | }
|
201 | 199 | ],
|
202 | 200 | "source": [
|
203 |
| - "chat = ChatPerplexity(temperature=0, model=\"llama-3.1-sonar-small-128k-online\")\n", |
| 201 | + "chat = ChatPerplexity(temperature=0, model=\"sonar\")\n", |
204 | 202 | "prompt = ChatPromptTemplate.from_messages([(\"human\", \"Tell me a joke about {topic}\")])\n",
|
205 | 203 | "chain = prompt | chat\n",
|
206 | 204 | "response = chain.invoke({\"topic\": \"cats\"})\n",
|
|
235 | 233 | }
|
236 | 234 | ],
|
237 | 235 | "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", |
239 | 237 | "response = chat.invoke(\n",
|
240 | 238 | " \"Tell me a joke about cats\", extra_body={\"search_recency_filter\": \"week\"}\n",
|
241 | 239 | ")\n",
|
|
284 | 282 | }
|
285 | 283 | ],
|
286 | 284 | "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", |
288 | 286 | "\n",
|
289 | 287 | "for chunk in chat.stream(\"Give me a list of famous tourist attractions in Pakistan\"):\n",
|
290 | 288 | " print(chunk.content, end=\"\", flush=True)"
|
|
0 commit comments