mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(Perplexity Node): Update model from 'r1-1776' to 'sonar' in API and tests (#19440)
This commit is contained in:
@@ -39,7 +39,7 @@ export class PerplexityApi implements ICredentialType {
|
||||
url: '/chat/completions',
|
||||
method: 'POST',
|
||||
body: {
|
||||
model: 'r1-1776',
|
||||
model: 'sonar',
|
||||
messages: [{ role: 'user', content: 'test' }],
|
||||
},
|
||||
headers: {
|
||||
|
||||
@@ -6,10 +6,9 @@ const properties: INodeProperties[] = [
|
||||
displayName: 'Model',
|
||||
name: 'model',
|
||||
type: 'options',
|
||||
default: 'r1-1776',
|
||||
default: 'sonar',
|
||||
required: true,
|
||||
options: [
|
||||
{ name: 'R1-1776', value: 'r1-1776' },
|
||||
{ name: 'Sonar', value: 'sonar' },
|
||||
{ name: 'Sonar Deep Research', value: 'sonar-deep-research' },
|
||||
{ name: 'Sonar Pro', value: 'sonar-pro' },
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('Perplexity Node - Chat Completions', () => {
|
||||
nock('https://api.perplexity.ai')
|
||||
.post('/chat/completions', (body) => {
|
||||
return (
|
||||
body?.model?.value === 'r1-1776' &&
|
||||
body?.model?.value === 'sonar' &&
|
||||
body?.model?.mode === 'id' &&
|
||||
Array.isArray(body?.messages) &&
|
||||
body.messages.length === 3 &&
|
||||
@@ -25,7 +25,7 @@ describe('Perplexity Node - Chat Completions', () => {
|
||||
})
|
||||
.reply(200, {
|
||||
id: '6bb24c98-3071-4691-9a7b-dc4bc18c3c2c',
|
||||
model: 'r1-1776',
|
||||
model: 'sonar',
|
||||
created: 1743161086,
|
||||
object: 'chat.completion',
|
||||
usage: {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"value": "r1-1776",
|
||||
"value": "sonar",
|
||||
"mode": "id"
|
||||
},
|
||||
"messages": {
|
||||
@@ -73,7 +73,7 @@
|
||||
{
|
||||
"json": {
|
||||
"id": "6bb24c98-3071-4691-9a7b-dc4bc18c3c2c",
|
||||
"model": "r1-1776",
|
||||
"model": "sonar",
|
||||
"created": 1743161086,
|
||||
"usage": {
|
||||
"prompt_tokens": 4,
|
||||
|
||||
@@ -16,7 +16,7 @@ describe('Perplexity API Credentials', () => {
|
||||
url: 'https://api.perplexity.ai/chat/completions',
|
||||
method: 'POST',
|
||||
body: {
|
||||
model: 'r1-1776',
|
||||
model: 'sonar',
|
||||
messages: [{ role: 'user', content: 'test' }],
|
||||
},
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user