OpenInterpreter / open-interpreter

A natural language interface for computers
http://openinterpreter.com/
GNU Affero General Public License v3.0
50.73k stars 4.43k forks source link

Update Perplexity to Newest Models #1068

Open slavakurilyak opened 3 months ago

slavakurilyak commented 3 months ago

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

It would be great to see LLM-first web browser (aka interpreter --os mode) use the new Perplexity sonar models:

Describe alternatives you've considered

No response

Additional context

Here is the official announcement which goes into effect on Mar 15

We are excited to announce the launch of our latest Perplexity models... along with their search-enhanced versions, sonar-small-online and sonar-medium-online. These new additions surpass our earlier models in cost-efficiency, speed, and performance.

randerzander commented 3 months ago
import os
from interpreter import interpreter    

interpreter.offline = True # Disables online features like Open Procedures    
interpreter.llm.model = "sonar-small-chat" # Tells OI to send messages in OpenAI's format    
interpreter.llm.api_key = os.environ["PERPLEXITY_API_KEY"]    
interpreter.llm.api_base = "https://api.perplexity.ai"    

interpreter.chat() 

works for me :)