Skip to content
New issue

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

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

Already on GitHub? # to your account

refactor: move API key input into Cohere and NVIDIA rerank components #6339

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions src/backend/base/langflow/base/compressors/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from langflow.custom import Component
from langflow.field_typing import BaseDocumentCompressor
from langflow.io import DataInput, IntInput, MultilineInput, SecretStrInput
from langflow.io import DataInput, IntInput, MultilineInput
from langflow.schema import Data
from langflow.schema.dataframe import DataFrame
from langflow.template.field.base import Output
Expand All @@ -15,10 +15,6 @@ class LCCompressorComponent(Component):
display_name="Search Query",
tool_mode=True,
),
SecretStrInput(
name="api_key",
display_name="API Key",
),
DataInput(
name="search_results",
display_name="Search Results",
Expand Down
5 changes: 5 additions & 0 deletions src/backend/base/langflow/components/cohere/cohere_rerank.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from langflow.base.compressors.model import LCCompressorComponent
from langflow.field_typing import BaseDocumentCompressor
from langflow.inputs.inputs import SecretStrInput
from langflow.io import DropdownInput
from langflow.template.field.base import Output

Expand All @@ -12,6 +13,10 @@ class CohereRerankComponent(LCCompressorComponent):

inputs = [
*LCCompressorComponent.inputs,
SecretStrInput(
name="api_key",
display_name="Cohere API Key",
),
DropdownInput(
name="model",
display_name="Model",
Expand Down
5 changes: 5 additions & 0 deletions src/backend/base/langflow/components/nvidia/nvidia_rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from langflow.base.compressors.model import LCCompressorComponent
from langflow.field_typing import BaseDocumentCompressor
from langflow.inputs.inputs import SecretStrInput
from langflow.io import DropdownInput, StrInput
from langflow.schema.dotdict import dotdict
from langflow.template.field.base import Output
Expand All @@ -14,6 +15,10 @@ class NvidiaRerankComponent(LCCompressorComponent):

inputs = [
*LCCompressorComponent.inputs,
SecretStrInput(
name="api_key",
display_name="NVIDIA API Key",
),
StrInput(
name="base_url",
display_name="Base URL",
Expand Down
Loading