Skip to content

Commit

Permalink
feat(perplexity): add new Sonar models (#957)
Browse files Browse the repository at this point in the history
Because

- New Sonar models have been published by Perplexity AI.

This commit

- Updates the Perplexity component with these models.
  • Loading branch information
jvallesm authored Jan 23, 2025
1 parent 51540dd commit 2699679
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# mono occupies port 8084 which conflicts with mgmt-backend
- name: Stop mono service
run: |
sudo kill -9 `sudo lsof -t -i:8084`
sudo lsof -t -i:8084 | xargs -r sudo kill -9
sudo lsof -i -P -n | grep LISTEN
- name: Maximize build space
Expand Down
8 changes: 3 additions & 5 deletions pkg/component/ai/perplexity/v0/.compogen/bottom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ component:
task: TASK_CHAT
input:
data:
model: llama-3.1-sonar-small-128k-online
model: sonar
messages:
- content:
- text: Be precise and concise.
Expand All @@ -25,7 +25,7 @@ component:
- text: ${variable.prompt}
type: text
role: user
name: chunhao
name: Miles
parameter:
max-tokens: 500
temperature: 0.2
Expand All @@ -37,12 +37,10 @@ component:
top-k: 0
presence-penalty: 0
frequency-penalty: 1
setup:
api-key: ${secret.perplexity}

output:
perplexity:
title: Perplexity
value: ${perplexity-0.output}

```
```
10 changes: 4 additions & 6 deletions pkg/component/ai/perplexity/v0/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Input data.
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| [Chat Messages](#chat-chat-messages) | `messages` | array | List of chat messages. |
| Model Name | `model` | string | The model to be used for `TASK_CHAT`. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`llama-3.1-sonar-small-128k-online`</li><li>`llama-3.1-sonar-large-128k-online`</li><li>`llama-3.1-sonar-huge-128k-online`</li></ul></details> |
| Model Name | `model` | string | The model to be used for `TASK_CHAT`. <br/><details><summary><strong>Enum values</strong></summary><ul><li>`sonar`</li><li>`sonar-pro`</li><li>`llama-3.1-sonar-small-128k-online`</li><li>`llama-3.1-sonar-large-128k-online`</li><li>`llama-3.1-sonar-huge-128k-online`</li></ul></details> |
</div>
<h4 id="chat-chat-messages">Chat Messages</h4>

Expand Down Expand Up @@ -204,7 +204,7 @@ component:
task: TASK_CHAT
input:
data:
model: llama-3.1-sonar-small-128k-online
model: sonar
messages:
- content:
- text: Be precise and concise.
Expand All @@ -214,7 +214,7 @@ component:
- text: ${variable.prompt}
type: text
role: user
name: chunhao
name: Miles
parameter:
max-tokens: 500
temperature: 0.2
Expand All @@ -226,12 +226,10 @@ component:
top-k: 0
presence-penalty: 0
frequency-penalty: 1
setup:
api-key: ${secret.perplexity}

output:
perplexity:
title: Perplexity
value: ${perplexity-0.output}

```
```
7 changes: 7 additions & 0 deletions pkg/component/ai/perplexity/v0/config/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ TASK_CHAT:
shortDescription: The model to be used.
type: string
enum:
- sonar
- sonar-pro

# Deprecated models, unavailable after 2025-02-22
- llama-3.1-sonar-small-128k-online
- llama-3.1-sonar-large-128k-online
- llama-3.1-sonar-huge-128k-online
instillCredentialMap:
values:
- sonar
- sonar-pro

- llama-3.1-sonar-small-128k-online
- llama-3.1-sonar-large-128k-online
- llama-3.1-sonar-huge-128k-online
Expand Down

0 comments on commit 2699679

Please sign in to comment.