Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for using perplexity.ai #1261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions gpt_engineer/core/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
)
from langchain_anthropic import ChatAnthropic
from langchain_openai import AzureChatOpenAI, ChatOpenAI
from langchain_community.chat_models import ChatPerplexity

from gpt_engineer.core.token_usage import TokenUsageLog

Expand Down Expand Up @@ -362,6 +363,13 @@ def _create_chat_model(self) -> BaseChatModel:
streaming=self.streaming,
max_tokens_to_sample=4096,
)
elif os.getenv("PPLX_API_KEY") is not None:
return ChatPerplexity(
model=self.model_name,
temperature=self.temperature,
callbacks=[StreamingStdOutCallbackHandler()],
streaming=self.streaming,
)
elif self.vision:
return ChatOpenAI(
model=self.model_name,
Expand Down
Loading