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',
|
url: '/chat/completions',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: {
|
body: {
|
||||||
model: 'r1-1776',
|
model: 'sonar',
|
||||||
messages: [{ role: 'user', content: 'test' }],
|
messages: [{ role: 'user', content: 'test' }],
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ const properties: INodeProperties[] = [
|
|||||||
displayName: 'Model',
|
displayName: 'Model',
|
||||||
name: 'model',
|
name: 'model',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
default: 'r1-1776',
|
default: 'sonar',
|
||||||
required: true,
|
required: true,
|
||||||
options: [
|
options: [
|
||||||
{ name: 'R1-1776', value: 'r1-1776' },
|
|
||||||
{ name: 'Sonar', value: 'sonar' },
|
{ name: 'Sonar', value: 'sonar' },
|
||||||
{ name: 'Sonar Deep Research', value: 'sonar-deep-research' },
|
{ name: 'Sonar Deep Research', value: 'sonar-deep-research' },
|
||||||
{ name: 'Sonar Pro', value: 'sonar-pro' },
|
{ name: 'Sonar Pro', value: 'sonar-pro' },
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ describe('Perplexity Node - Chat Completions', () => {
|
|||||||
nock('https://api.perplexity.ai')
|
nock('https://api.perplexity.ai')
|
||||||
.post('/chat/completions', (body) => {
|
.post('/chat/completions', (body) => {
|
||||||
return (
|
return (
|
||||||
body?.model?.value === 'r1-1776' &&
|
body?.model?.value === 'sonar' &&
|
||||||
body?.model?.mode === 'id' &&
|
body?.model?.mode === 'id' &&
|
||||||
Array.isArray(body?.messages) &&
|
Array.isArray(body?.messages) &&
|
||||||
body.messages.length === 3 &&
|
body.messages.length === 3 &&
|
||||||
@@ -25,7 +25,7 @@ describe('Perplexity Node - Chat Completions', () => {
|
|||||||
})
|
})
|
||||||
.reply(200, {
|
.reply(200, {
|
||||||
id: '6bb24c98-3071-4691-9a7b-dc4bc18c3c2c',
|
id: '6bb24c98-3071-4691-9a7b-dc4bc18c3c2c',
|
||||||
model: 'r1-1776',
|
model: 'sonar',
|
||||||
created: 1743161086,
|
created: 1743161086,
|
||||||
object: 'chat.completion',
|
object: 'chat.completion',
|
||||||
usage: {
|
usage: {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"parameters": {
|
"parameters": {
|
||||||
"model": {
|
"model": {
|
||||||
"__rl": true,
|
"__rl": true,
|
||||||
"value": "r1-1776",
|
"value": "sonar",
|
||||||
"mode": "id"
|
"mode": "id"
|
||||||
},
|
},
|
||||||
"messages": {
|
"messages": {
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
{
|
{
|
||||||
"json": {
|
"json": {
|
||||||
"id": "6bb24c98-3071-4691-9a7b-dc4bc18c3c2c",
|
"id": "6bb24c98-3071-4691-9a7b-dc4bc18c3c2c",
|
||||||
"model": "r1-1776",
|
"model": "sonar",
|
||||||
"created": 1743161086,
|
"created": 1743161086,
|
||||||
"usage": {
|
"usage": {
|
||||||
"prompt_tokens": 4,
|
"prompt_tokens": 4,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ describe('Perplexity API Credentials', () => {
|
|||||||
url: 'https://api.perplexity.ai/chat/completions',
|
url: 'https://api.perplexity.ai/chat/completions',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: {
|
body: {
|
||||||
model: 'r1-1776',
|
model: 'sonar',
|
||||||
messages: [{ role: 'user', content: 'test' }],
|
messages: [{ role: 'user', content: 'test' }],
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user