Skip to content

Commit

Permalink
Use updated OpenAI GPT 4 turbo and 3.5 Turbo (langchain-ai#191)
Browse files Browse the repository at this point in the history
* Use gpt-4-turbo-preview instead of pinned version

* Simplify and use gpt-3.5-turbo-0125

* Update consistently

* Fix typo

* Use gpt-3.5-turbo

---------

Co-authored-by: Mikko Korpela <[email protected]>
  • Loading branch information
japborst and mkorpela authored Mar 20, 2024
1 parent 708ed16 commit 1f4d6cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions backend/app/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

class AgentType(str, Enum):
GPT_35_TURBO = "GPT 3.5 Turbo"
GPT_4 = "GPT 4"
GPT_4 = "GPT 4 Turbo"
AZURE_OPENAI = "GPT 4 (Azure OpenAI)"
CLAUDE2 = "Claude 2"
BEDROCK_CLAUDE2 = "Claude 2 (Amazon Bedrock)"
Expand Down Expand Up @@ -169,7 +169,7 @@ def __init__(

class LLMType(str, Enum):
GPT_35_TURBO = "GPT 3.5 Turbo"
GPT_4 = "GPT 4"
GPT_4 = "GPT 4 Turbo"
AZURE_OPENAI = "GPT 4 (Azure OpenAI)"
CLAUDE2 = "Claude 2"
BEDROCK_CLAUDE2 = "Claude 2 (Amazon Bedrock)"
Expand Down
21 changes: 7 additions & 14 deletions backend/app/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,13 @@ def get_openai_llm(gpt_4: bool = False, azure: bool = False):
logger.warn("Invalid proxy URL provided. Proceeding without proxy.")

if not azure:
if gpt_4:
llm = ChatOpenAI(
http_client=http_client,
model="gpt-4-1106-preview",
temperature=0,
streaming=True,
)
else:
llm = ChatOpenAI(
http_client=http_client,
model="gpt-3.5-turbo-1106",
temperature=0,
streaming=True,
)
openai_model = "gpt-4-turbo-preview" if gpt_4 else "gpt-3.5-turbo"
llm = ChatOpenAI(
http_client=http_client,
model=openai_model,
temperature=0,
streaming=True,
)
else:
llm = AzureChatOpenAI(
http_client=http_client,
Expand Down

0 comments on commit 1f4d6cf

Please sign in to comment.