Skip to content

Commit

Permalink
feat: add latest models to Google Generative AI, Anthropic Models (la…
Browse files Browse the repository at this point in the history
…ngflow-ai#4685)

* updated models

models updates

* Update google_generative_ai_constants.py

formatting
  • Loading branch information
edwinjosechittilappilly authored and mieslep committed Nov 19, 2024
1 parent 09e03fa commit 6931a96
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/backend/base/langflow/base/models/anthropic_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ANTHROPIC_MODELS = [
"claude-3-5-sonnet-latest",
"claude-3-5-haiku-latest",
"claude-3-opus-latest",
"claude-3-5-sonnet-20240620",
"claude-3-5-sonnet-20241022",
"claude-3-5-haiku-20241022",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GOOGLE_GENERATIVE_AI_MODELS = [
"gemini-1.5-pro",
"gemini-1.5-flash",
"gemini-1.5-flash-8b",
"gemini-1.0-pro",
"gemini-1.0-pro-vision",
"gemini-1.5-pro-001",
"gemini-1.5-pro-002",
"gemini-1.5-flash-001",
"gemini-1.5-flash-002",
"gemini-1.5-pro-exp-0827",
"gemini-1.5-flash-exp-0827",
"gemini-1.5-flash-8b-exp-0827",
"gemini-1.5-flash-8b-exp-0924",
"gemini-exp-1114",
]
10 changes: 3 additions & 7 deletions src/backend/base/langflow/components/models/anthropic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pydantic.v1 import SecretStr

from langflow.base.models.anthropic_constants import ANTHROPIC_MODELS
from langflow.base.models.model import LCModelComponent
from langflow.field_typing import LanguageModel
from langflow.inputs.inputs import HandleInput
Expand All @@ -24,14 +25,9 @@ class AnthropicModelComponent(LCModelComponent):
DropdownInput(
name="model",
display_name="Model Name",
options=[
"claude-3-5-sonnet-20240620",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
],
options=ANTHROPIC_MODELS,
info="https://python.langchain.com/docs/integrations/chat/anthropic",
value="claude-3-5-sonnet-20240620",
value="claude-3-5-sonnet-latest",
),
SecretStrInput(name="anthropic_api_key", display_name="Anthropic API Key", info="Your Anthropic API key."),
FloatInput(name="temperature", display_name="Temperature", value=0.1),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pydantic.v1 import SecretStr

from langflow.base.models.google_generative_ai_constants import GOOGLE_GENERATIVE_AI_MODELS
from langflow.base.models.model import LCModelComponent
from langflow.field_typing import LanguageModel
from langflow.inputs import DropdownInput, FloatInput, IntInput, SecretStrInput
Expand All @@ -21,7 +22,7 @@ class GoogleGenerativeAIComponent(LCModelComponent):
name="model",
display_name="Model",
info="The name of the model to use.",
options=["gemini-1.5-pro", "gemini-1.5-flash", "gemini-1.0-pro", "gemini-1.0-pro-vision"],
options=GOOGLE_GENERATIVE_AI_MODELS,
value="gemini-1.5-pro",
),
SecretStrInput(
Expand Down

0 comments on commit 6931a96

Please sign in to comment.