Skip to content

Commit

Permalink
finalize available llm
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaygupta9 committed Aug 2, 2024
1 parent 54db619 commit 8ae3b68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
3 changes: 1 addition & 2 deletions backend/app/app/schemas/tool_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"azure-4-32k",
"azure-3.5",
"claude-3-opus",
"claude-3.5-sonnet",
"claude-3-sonnet",
"claude-3-haiku",
"gemini-1.0-pro",
]


Expand Down
22 changes: 4 additions & 18 deletions backend/app/app/services/chat_agent/helpers/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,20 @@ def get_llm(
anthropic_api_key=settings.ANTHROPIC_API_KEY,
streaming=True,
)
case "claude-3-sonnet":
case "claude-3.5-sonnet":
return ChatAnthropic(
temperature=0,
model_name="claude-3-sonnet-20240229",
model_name="claude-3-5-sonnet-20240620",
anthropic_api_key=settings.ANTHROPIC_API_KEY,
streaming=True,
)
case "claude-3-haiku":
case "claude-3-sonnet":
return ChatAnthropic(
temperature=0,
model_name="claude-3-haiku-20240307",
model_name="claude-3-sonnet-20240229",
anthropic_api_key=settings.ANTHROPIC_API_KEY,
streaming=True,
)
case "gemini-1.0-pro":
return ChatGoogleGenerativeAI(
temperature=0,
model="gemini-1.0-pro-latest",
google_api_key=settings.GOOGLE_API_KEY,
streaming=True,
convert_system_message_to_human=True,
safety_settings={
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,
},
)
# If an exact match is not confirmed, this last case will be used if provided
case _:
logger.warning(f"LLM {llm} not found, using default LLM")
Expand Down

0 comments on commit 8ae3b68

Please sign in to comment.